Matt Arsenault | 9fe669c | 2014-03-06 17:34:03 +0000 | [diff] [blame] | 1 | ; RUN: llc -verify-machineinstrs -march=r600 -mcpu=SI < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s |
| 2 | |
| 3 | ; Test expansion of scalar selects on vectors. |
| 4 | ; Evergreen not enabled since it seems to be having problems with doubles. |
| 5 | |
| 6 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 7 | ; FUNC-LABEL: {{^}}select_v4i8: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame^] | 8 | ; SI: v_cndmask_b32_e64 |
| 9 | ; SI: v_cndmask_b32_e64 |
| 10 | ; SI: v_cndmask_b32_e64 |
| 11 | ; SI: v_cndmask_b32_e64 |
Matt Arsenault | 9fe669c | 2014-03-06 17:34:03 +0000 | [diff] [blame] | 12 | define void @select_v4i8(<4 x i8> addrspace(1)* %out, <4 x i8> %a, <4 x i8> %b, i8 %c) nounwind { |
| 13 | %cmp = icmp eq i8 %c, 0 |
| 14 | %select = select i1 %cmp, <4 x i8> %a, <4 x i8> %b |
| 15 | store <4 x i8> %select, <4 x i8> addrspace(1)* %out, align 4 |
| 16 | ret void |
| 17 | } |
| 18 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 19 | ; FUNC-LABEL: {{^}}select_v4i16: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame^] | 20 | ; SI: v_cndmask_b32_e64 |
| 21 | ; SI: v_cndmask_b32_e64 |
| 22 | ; SI: v_cndmask_b32_e64 |
| 23 | ; SI: v_cndmask_b32_e64 |
Matt Arsenault | 9fe669c | 2014-03-06 17:34:03 +0000 | [diff] [blame] | 24 | define void @select_v4i16(<4 x i16> addrspace(1)* %out, <4 x i16> %a, <4 x i16> %b, i32 %c) nounwind { |
| 25 | %cmp = icmp eq i32 %c, 0 |
| 26 | %select = select i1 %cmp, <4 x i16> %a, <4 x i16> %b |
| 27 | store <4 x i16> %select, <4 x i16> addrspace(1)* %out, align 4 |
| 28 | ret void |
| 29 | } |
| 30 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 31 | ; FUNC-LABEL: {{^}}select_v2i32: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame^] | 32 | ; SI: v_cndmask_b32_e64 |
| 33 | ; SI: v_cndmask_b32_e64 |
| 34 | ; SI: buffer_store_dwordx2 |
Matt Arsenault | 9fe669c | 2014-03-06 17:34:03 +0000 | [diff] [blame] | 35 | define void @select_v2i32(<2 x i32> addrspace(1)* %out, <2 x i32> %a, <2 x i32> %b, i32 %c) nounwind { |
| 36 | %cmp = icmp eq i32 %c, 0 |
| 37 | %select = select i1 %cmp, <2 x i32> %a, <2 x i32> %b |
| 38 | store <2 x i32> %select, <2 x i32> addrspace(1)* %out, align 8 |
| 39 | ret void |
| 40 | } |
| 41 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 42 | ; FUNC-LABEL: {{^}}select_v4i32: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame^] | 43 | ; SI: v_cndmask_b32_e64 |
| 44 | ; SI: v_cndmask_b32_e64 |
| 45 | ; SI: v_cndmask_b32_e64 |
| 46 | ; SI: v_cndmask_b32_e64 |
| 47 | ; SI: buffer_store_dwordx4 |
Matt Arsenault | 9fe669c | 2014-03-06 17:34:03 +0000 | [diff] [blame] | 48 | define void @select_v4i32(<4 x i32> addrspace(1)* %out, <4 x i32> %a, <4 x i32> %b, i32 %c) nounwind { |
| 49 | %cmp = icmp eq i32 %c, 0 |
| 50 | %select = select i1 %cmp, <4 x i32> %a, <4 x i32> %b |
| 51 | store <4 x i32> %select, <4 x i32> addrspace(1)* %out, align 16 |
| 52 | ret void |
| 53 | } |
| 54 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 55 | ; FUNC-LABEL: {{^}}select_v8i32: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame^] | 56 | ; SI: v_cndmask_b32_e64 |
| 57 | ; SI: v_cndmask_b32_e64 |
| 58 | ; SI: v_cndmask_b32_e64 |
| 59 | ; SI: v_cndmask_b32_e64 |
| 60 | ; SI: v_cndmask_b32_e64 |
| 61 | ; SI: v_cndmask_b32_e64 |
| 62 | ; SI: v_cndmask_b32_e64 |
| 63 | ; SI: v_cndmask_b32_e64 |
Matt Arsenault | 9fe669c | 2014-03-06 17:34:03 +0000 | [diff] [blame] | 64 | define void @select_v8i32(<8 x i32> addrspace(1)* %out, <8 x i32> %a, <8 x i32> %b, i32 %c) nounwind { |
| 65 | %cmp = icmp eq i32 %c, 0 |
| 66 | %select = select i1 %cmp, <8 x i32> %a, <8 x i32> %b |
| 67 | store <8 x i32> %select, <8 x i32> addrspace(1)* %out, align 16 |
| 68 | ret void |
| 69 | } |
| 70 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 71 | ; FUNC-LABEL: {{^}}select_v2f32: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame^] | 72 | ; SI: buffer_store_dwordx2 |
Matt Arsenault | 9fe669c | 2014-03-06 17:34:03 +0000 | [diff] [blame] | 73 | define void @select_v2f32(<2 x float> addrspace(1)* %out, <2 x float> %a, <2 x float> %b, i32 %c) nounwind { |
| 74 | %cmp = icmp eq i32 %c, 0 |
| 75 | %select = select i1 %cmp, <2 x float> %a, <2 x float> %b |
| 76 | store <2 x float> %select, <2 x float> addrspace(1)* %out, align 16 |
| 77 | ret void |
| 78 | } |
| 79 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 80 | ; FUNC-LABEL: {{^}}select_v4f32: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame^] | 81 | ; SI: buffer_store_dwordx4 |
Matt Arsenault | 9fe669c | 2014-03-06 17:34:03 +0000 | [diff] [blame] | 82 | define void @select_v4f32(<4 x float> addrspace(1)* %out, <4 x float> %a, <4 x float> %b, i32 %c) nounwind { |
| 83 | %cmp = icmp eq i32 %c, 0 |
| 84 | %select = select i1 %cmp, <4 x float> %a, <4 x float> %b |
| 85 | store <4 x float> %select, <4 x float> addrspace(1)* %out, align 16 |
| 86 | ret void |
| 87 | } |
| 88 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 89 | ; FUNC-LABEL: {{^}}select_v8f32: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame^] | 90 | ; SI: v_cndmask_b32_e64 |
| 91 | ; SI: v_cndmask_b32_e64 |
| 92 | ; SI: v_cndmask_b32_e64 |
| 93 | ; SI: v_cndmask_b32_e64 |
| 94 | ; SI: v_cndmask_b32_e64 |
| 95 | ; SI: v_cndmask_b32_e64 |
| 96 | ; SI: v_cndmask_b32_e64 |
| 97 | ; SI: v_cndmask_b32_e64 |
Matt Arsenault | 9fe669c | 2014-03-06 17:34:03 +0000 | [diff] [blame] | 98 | define void @select_v8f32(<8 x float> addrspace(1)* %out, <8 x float> %a, <8 x float> %b, i32 %c) nounwind { |
| 99 | %cmp = icmp eq i32 %c, 0 |
| 100 | %select = select i1 %cmp, <8 x float> %a, <8 x float> %b |
| 101 | store <8 x float> %select, <8 x float> addrspace(1)* %out, align 16 |
| 102 | ret void |
| 103 | } |
| 104 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 105 | ; FUNC-LABEL: {{^}}select_v2f64: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame^] | 106 | ; SI: v_cndmask_b32_e64 |
| 107 | ; SI: v_cndmask_b32_e64 |
| 108 | ; SI: v_cndmask_b32_e64 |
| 109 | ; SI: v_cndmask_b32_e64 |
Matt Arsenault | 9fe669c | 2014-03-06 17:34:03 +0000 | [diff] [blame] | 110 | define void @select_v2f64(<2 x double> addrspace(1)* %out, <2 x double> %a, <2 x double> %b, i32 %c) nounwind { |
| 111 | %cmp = icmp eq i32 %c, 0 |
| 112 | %select = select i1 %cmp, <2 x double> %a, <2 x double> %b |
| 113 | store <2 x double> %select, <2 x double> addrspace(1)* %out, align 16 |
| 114 | ret void |
| 115 | } |
| 116 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 117 | ; FUNC-LABEL: {{^}}select_v4f64: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame^] | 118 | ; SI: v_cndmask_b32_e64 |
| 119 | ; SI: v_cndmask_b32_e64 |
| 120 | ; SI: v_cndmask_b32_e64 |
| 121 | ; SI: v_cndmask_b32_e64 |
| 122 | ; SI: v_cndmask_b32_e64 |
| 123 | ; SI: v_cndmask_b32_e64 |
| 124 | ; SI: v_cndmask_b32_e64 |
| 125 | ; SI: v_cndmask_b32_e64 |
Matt Arsenault | 9fe669c | 2014-03-06 17:34:03 +0000 | [diff] [blame] | 126 | define void @select_v4f64(<4 x double> addrspace(1)* %out, <4 x double> %a, <4 x double> %b, i32 %c) nounwind { |
| 127 | %cmp = icmp eq i32 %c, 0 |
| 128 | %select = select i1 %cmp, <4 x double> %a, <4 x double> %b |
| 129 | store <4 x double> %select, <4 x double> addrspace(1)* %out, align 16 |
| 130 | ret void |
| 131 | } |
| 132 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 133 | ; FUNC-LABEL: {{^}}select_v8f64: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame^] | 134 | ; SI: v_cndmask_b32_e64 |
| 135 | ; SI: v_cndmask_b32_e64 |
| 136 | ; SI: v_cndmask_b32_e64 |
| 137 | ; SI: v_cndmask_b32_e64 |
| 138 | ; SI: v_cndmask_b32_e64 |
| 139 | ; SI: v_cndmask_b32_e64 |
| 140 | ; SI: v_cndmask_b32_e64 |
| 141 | ; SI: v_cndmask_b32_e64 |
| 142 | ; SI: v_cndmask_b32_e64 |
| 143 | ; SI: v_cndmask_b32_e64 |
| 144 | ; SI: v_cndmask_b32_e64 |
| 145 | ; SI: v_cndmask_b32_e64 |
| 146 | ; SI: v_cndmask_b32_e64 |
| 147 | ; SI: v_cndmask_b32_e64 |
| 148 | ; SI: v_cndmask_b32_e64 |
| 149 | ; SI: v_cndmask_b32_e64 |
Matt Arsenault | 9fe669c | 2014-03-06 17:34:03 +0000 | [diff] [blame] | 150 | define void @select_v8f64(<8 x double> addrspace(1)* %out, <8 x double> %a, <8 x double> %b, i32 %c) nounwind { |
| 151 | %cmp = icmp eq i32 %c, 0 |
| 152 | %select = select i1 %cmp, <8 x double> %a, <8 x double> %b |
| 153 | store <8 x double> %select, <8 x double> addrspace(1)* %out, align 16 |
| 154 | ret void |
| 155 | } |