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