NAKAMURA Takumi | cf396cf | 2013-12-28 13:04:29 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=x86_64-unknown-unknown -mcpu=corei7 -mattr=-sse4.1 < %s | FileCheck %s |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 2 | |
| 3 | ; Verify that we don't emit packed vector shifts instructions if the |
| 4 | ; condition used by the vector select is a vector of constants. |
| 5 | |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 6 | define <4 x float> @test1(<4 x float> %a, <4 x float> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 7 | ; CHECK-LABEL: test1: |
| 8 | ; CHECK: # BB#0: |
| 9 | ; CHECK-NEXT: andps {{.*}}(%rip), %xmm1 |
| 10 | ; CHECK-NEXT: andps {{.*}}(%rip), %xmm0 |
| 11 | ; CHECK-NEXT: orps %xmm1, %xmm0 |
| 12 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 13 | %1 = select <4 x i1> <i1 true, i1 false, i1 true, i1 false>, <4 x float> %a, <4 x float> %b |
| 14 | ret <4 x float> %1 |
| 15 | } |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 16 | |
| 17 | define <4 x float> @test2(<4 x float> %a, <4 x float> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 18 | ; CHECK-LABEL: test2: |
| 19 | ; CHECK: # BB#0: |
| 20 | ; CHECK-NEXT: movsd %xmm0, %xmm1 |
| 21 | ; CHECK-NEXT: movaps %xmm1, %xmm0 |
| 22 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 23 | %1 = select <4 x i1> <i1 true, i1 true, i1 false, i1 false>, <4 x float> %a, <4 x float> %b |
| 24 | ret <4 x float> %1 |
| 25 | } |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 26 | |
| 27 | define <4 x float> @test3(<4 x float> %a, <4 x float> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 28 | ; CHECK-LABEL: test3: |
| 29 | ; CHECK: # BB#0: |
| 30 | ; CHECK-NEXT: movsd %xmm1, %xmm0 |
| 31 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 32 | %1 = select <4 x i1> <i1 false, i1 false, i1 true, i1 true>, <4 x float> %a, <4 x float> %b |
| 33 | ret <4 x float> %1 |
| 34 | } |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 35 | |
| 36 | define <4 x float> @test4(<4 x float> %a, <4 x float> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 37 | ; CHECK-LABEL: test4: |
| 38 | ; CHECK: # BB#0: |
| 39 | ; CHECK-NEXT: movaps %xmm1, %xmm0 |
| 40 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 41 | %1 = select <4 x i1> <i1 false, i1 false, i1 false, i1 false>, <4 x float> %a, <4 x float> %b |
| 42 | ret <4 x float> %1 |
| 43 | } |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 44 | |
| 45 | define <4 x float> @test5(<4 x float> %a, <4 x float> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 46 | ; CHECK-LABEL: test5: |
| 47 | ; CHECK: # BB#0: |
| 48 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 49 | %1 = select <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x float> %a, <4 x float> %b |
| 50 | ret <4 x float> %1 |
| 51 | } |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 52 | |
| 53 | define <8 x i16> @test6(<8 x i16> %a, <8 x i16> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 54 | ; CHECK-LABEL: test6: |
| 55 | ; CHECK: # BB#0: |
| 56 | ; CHECK-NEXT: movaps {{.*#+}} xmm1 = [0,65535,0,65535,0,65535,0,65535] |
| 57 | ; CHECK-NEXT: andps %xmm0, %xmm1 |
| 58 | ; CHECK-NEXT: andps {{.*}}(%rip), %xmm0 |
| 59 | ; CHECK-NEXT: orps %xmm1, %xmm0 |
| 60 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 61 | %1 = select <8 x i1> <i1 true, i1 false, i1 true, i1 false, i1 true, i1 false, i1 true, i1 false>, <8 x i16> %a, <8 x i16> %a |
| 62 | ret <8 x i16> %1 |
| 63 | } |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 64 | |
| 65 | define <8 x i16> @test7(<8 x i16> %a, <8 x i16> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 66 | ; CHECK-LABEL: test7: |
| 67 | ; CHECK: # BB#0: |
| 68 | ; CHECK-NEXT: andps {{.*}}(%rip), %xmm1 |
| 69 | ; CHECK-NEXT: andps {{.*}}(%rip), %xmm0 |
| 70 | ; CHECK-NEXT: orps %xmm1, %xmm0 |
| 71 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 72 | %1 = select <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 false, i1 false, i1 false, i1 false>, <8 x i16> %a, <8 x i16> %b |
| 73 | ret <8 x i16> %1 |
| 74 | } |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 75 | |
| 76 | define <8 x i16> @test8(<8 x i16> %a, <8 x i16> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 77 | ; CHECK-LABEL: test8: |
| 78 | ; CHECK: # BB#0: |
| 79 | ; CHECK-NEXT: andps {{.*}}(%rip), %xmm1 |
| 80 | ; CHECK-NEXT: andps {{.*}}(%rip), %xmm0 |
| 81 | ; CHECK-NEXT: orps %xmm1, %xmm0 |
| 82 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 83 | %1 = select <8 x i1> <i1 false, i1 false, i1 false, i1 false, i1 true, i1 true, i1 true, i1 true>, <8 x i16> %a, <8 x i16> %b |
| 84 | ret <8 x i16> %1 |
| 85 | } |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 86 | |
| 87 | define <8 x i16> @test9(<8 x i16> %a, <8 x i16> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 88 | ; CHECK-LABEL: test9: |
| 89 | ; CHECK: # BB#0: |
| 90 | ; CHECK-NEXT: movaps %xmm1, %xmm0 |
| 91 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 92 | %1 = select <8 x i1> <i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false>, <8 x i16> %a, <8 x i16> %b |
| 93 | ret <8 x i16> %1 |
| 94 | } |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 95 | |
| 96 | define <8 x i16> @test10(<8 x i16> %a, <8 x i16> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 97 | ; CHECK-LABEL: test10: |
| 98 | ; CHECK: # BB#0: |
| 99 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 100 | %1 = select <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, <8 x i16> %a, <8 x i16> %b |
| 101 | ret <8 x i16> %1 |
| 102 | } |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 103 | |
| 104 | define <8 x i16> @test11(<8 x i16> %a, <8 x i16> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 105 | ; CHECK-LABEL: test11: |
| 106 | ; CHECK: # BB#0: |
| 107 | ; CHECK-NEXT: movaps {{.*#+}} xmm2 = <0,65535,65535,0,u,65535,65535,u> |
| 108 | ; CHECK-NEXT: andps %xmm2, %xmm0 |
| 109 | ; CHECK-NEXT: andnps %xmm1, %xmm2 |
| 110 | ; CHECK-NEXT: orps %xmm0, %xmm2 |
| 111 | ; CHECK-NEXT: movaps %xmm2, %xmm0 |
| 112 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 113 | %1 = select <8 x i1> <i1 false, i1 true, i1 true, i1 false, i1 undef, i1 true, i1 true, i1 undef>, <8 x i16> %a, <8 x i16> %b |
| 114 | ret <8 x i16> %1 |
| 115 | } |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 116 | |
| 117 | define <8 x i16> @test12(<8 x i16> %a, <8 x i16> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 118 | ; CHECK-LABEL: test12: |
| 119 | ; CHECK: # BB#0: |
| 120 | ; CHECK-NEXT: movaps %xmm1, %xmm0 |
| 121 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 122 | %1 = select <8 x i1> <i1 false, i1 false, i1 undef, i1 false, i1 false, i1 false, i1 false, i1 undef>, <8 x i16> %a, <8 x i16> %b |
| 123 | ret <8 x i16> %1 |
| 124 | } |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 125 | |
| 126 | define <8 x i16> @test13(<8 x i16> %a, <8 x i16> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 127 | ; CHECK-LABEL: test13: |
| 128 | ; CHECK: # BB#0: |
| 129 | ; CHECK-NEXT: movaps %xmm1, %xmm0 |
| 130 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 131 | %1 = select <8 x i1> <i1 undef, i1 undef, i1 undef, i1 undef, i1 undef, i1 undef, i1 undef, i1 undef>, <8 x i16> %a, <8 x i16> %b |
| 132 | ret <8 x i16> %1 |
| 133 | } |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 134 | |
Andrea Di Biagio | 23df4e4 | 2014-01-08 18:33:04 +0000 | [diff] [blame] | 135 | ; Fold (vselect (build_vector AllOnes), N1, N2) -> N1 |
Andrea Di Biagio | 23df4e4 | 2014-01-08 18:33:04 +0000 | [diff] [blame] | 136 | define <4 x float> @test14(<4 x float> %a, <4 x float> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 137 | ; CHECK-LABEL: test14: |
| 138 | ; CHECK: # BB#0: |
| 139 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 23df4e4 | 2014-01-08 18:33:04 +0000 | [diff] [blame] | 140 | %1 = select <4 x i1> <i1 true, i1 undef, i1 true, i1 undef>, <4 x float> %a, <4 x float> %b |
| 141 | ret <4 x float> %1 |
| 142 | } |
Andrea Di Biagio | 23df4e4 | 2014-01-08 18:33:04 +0000 | [diff] [blame] | 143 | |
| 144 | define <8 x i16> @test15(<8 x i16> %a, <8 x i16> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 145 | ; CHECK-LABEL: test15: |
| 146 | ; CHECK: # BB#0: |
| 147 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 23df4e4 | 2014-01-08 18:33:04 +0000 | [diff] [blame] | 148 | %1 = select <8 x i1> <i1 true, i1 true, i1 true, i1 undef, i1 undef, i1 true, i1 true, i1 undef>, <8 x i16> %a, <8 x i16> %b |
| 149 | ret <8 x i16> %1 |
| 150 | } |
Andrea Di Biagio | 23df4e4 | 2014-01-08 18:33:04 +0000 | [diff] [blame] | 151 | |
| 152 | ; Fold (vselect (build_vector AllZeros), N1, N2) -> N2 |
Andrea Di Biagio | 23df4e4 | 2014-01-08 18:33:04 +0000 | [diff] [blame] | 153 | define <4 x float> @test16(<4 x float> %a, <4 x float> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 154 | ; CHECK-LABEL: test16: |
| 155 | ; CHECK: # BB#0: |
| 156 | ; CHECK-NEXT: movaps %xmm1, %xmm0 |
| 157 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 23df4e4 | 2014-01-08 18:33:04 +0000 | [diff] [blame] | 158 | %1 = select <4 x i1> <i1 false, i1 undef, i1 false, i1 undef>, <4 x float> %a, <4 x float> %b |
| 159 | ret <4 x float> %1 |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 160 | } |
Andrea Di Biagio | 23df4e4 | 2014-01-08 18:33:04 +0000 | [diff] [blame] | 161 | |
| 162 | define <8 x i16> @test17(<8 x i16> %a, <8 x i16> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 163 | ; CHECK-LABEL: test17: |
| 164 | ; CHECK: # BB#0: |
| 165 | ; CHECK-NEXT: movaps %xmm1, %xmm0 |
| 166 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 23df4e4 | 2014-01-08 18:33:04 +0000 | [diff] [blame] | 167 | %1 = select <8 x i1> <i1 false, i1 false, i1 false, i1 undef, i1 undef, i1 false, i1 false, i1 undef>, <8 x i16> %a, <8 x i16> %b |
| 168 | ret <8 x i16> %1 |
| 169 | } |
Andrea Di Biagio | 46dcddb | 2013-12-27 20:20:28 +0000 | [diff] [blame] | 170 | |
Andrea Di Biagio | 450d166 | 2014-01-20 19:35:22 +0000 | [diff] [blame] | 171 | define <4 x float> @test18(<4 x float> %a, <4 x float> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 172 | ; CHECK-LABEL: test18: |
| 173 | ; CHECK: # BB#0: |
| 174 | ; CHECK-NEXT: movss %xmm1, %xmm0 |
| 175 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 450d166 | 2014-01-20 19:35:22 +0000 | [diff] [blame] | 176 | %1 = select <4 x i1> <i1 false, i1 true, i1 true, i1 true>, <4 x float> %a, <4 x float> %b |
| 177 | ret <4 x float> %1 |
| 178 | } |
Andrea Di Biagio | 450d166 | 2014-01-20 19:35:22 +0000 | [diff] [blame] | 179 | |
| 180 | define <4 x i32> @test19(<4 x i32> %a, <4 x i32> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 181 | ; CHECK-LABEL: test19: |
| 182 | ; CHECK: # BB#0: |
| 183 | ; CHECK-NEXT: movss %xmm1, %xmm0 |
| 184 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 450d166 | 2014-01-20 19:35:22 +0000 | [diff] [blame] | 185 | %1 = select <4 x i1> <i1 false, i1 true, i1 true, i1 true>, <4 x i32> %a, <4 x i32> %b |
| 186 | ret <4 x i32> %1 |
| 187 | } |
Andrea Di Biagio | 450d166 | 2014-01-20 19:35:22 +0000 | [diff] [blame] | 188 | |
| 189 | define <2 x double> @test20(<2 x double> %a, <2 x double> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 190 | ; CHECK-LABEL: test20: |
| 191 | ; CHECK: # BB#0: |
| 192 | ; CHECK-NEXT: movsd %xmm1, %xmm0 |
| 193 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 450d166 | 2014-01-20 19:35:22 +0000 | [diff] [blame] | 194 | %1 = select <2 x i1> <i1 false, i1 true>, <2 x double> %a, <2 x double> %b |
| 195 | ret <2 x double> %1 |
| 196 | } |
Andrea Di Biagio | 450d166 | 2014-01-20 19:35:22 +0000 | [diff] [blame] | 197 | |
| 198 | define <2 x i64> @test21(<2 x i64> %a, <2 x i64> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 199 | ; CHECK-LABEL: test21: |
| 200 | ; CHECK: # BB#0: |
| 201 | ; CHECK-NEXT: movsd %xmm1, %xmm0 |
| 202 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 450d166 | 2014-01-20 19:35:22 +0000 | [diff] [blame] | 203 | %1 = select <2 x i1> <i1 false, i1 true>, <2 x i64> %a, <2 x i64> %b |
| 204 | ret <2 x i64> %1 |
| 205 | } |
Andrea Di Biagio | 450d166 | 2014-01-20 19:35:22 +0000 | [diff] [blame] | 206 | |
| 207 | define <4 x float> @test22(<4 x float> %a, <4 x float> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 208 | ; CHECK-LABEL: test22: |
| 209 | ; CHECK: # BB#0: |
| 210 | ; CHECK-NEXT: movss %xmm0, %xmm1 |
| 211 | ; CHECK-NEXT: movaps %xmm1, %xmm0 |
| 212 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 450d166 | 2014-01-20 19:35:22 +0000 | [diff] [blame] | 213 | %1 = select <4 x i1> <i1 true, i1 false, i1 false, i1 false>, <4 x float> %a, <4 x float> %b |
| 214 | ret <4 x float> %1 |
| 215 | } |
Andrea Di Biagio | 450d166 | 2014-01-20 19:35:22 +0000 | [diff] [blame] | 216 | |
| 217 | define <4 x i32> @test23(<4 x i32> %a, <4 x i32> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 218 | ; CHECK-LABEL: test23: |
| 219 | ; CHECK: # BB#0: |
| 220 | ; CHECK-NEXT: movss %xmm0, %xmm1 |
| 221 | ; CHECK-NEXT: movaps %xmm1, %xmm0 |
| 222 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 450d166 | 2014-01-20 19:35:22 +0000 | [diff] [blame] | 223 | %1 = select <4 x i1> <i1 true, i1 false, i1 false, i1 false>, <4 x i32> %a, <4 x i32> %b |
| 224 | ret <4 x i32> %1 |
| 225 | } |
Andrea Di Biagio | 450d166 | 2014-01-20 19:35:22 +0000 | [diff] [blame] | 226 | |
| 227 | define <2 x double> @test24(<2 x double> %a, <2 x double> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 228 | ; CHECK-LABEL: test24: |
| 229 | ; CHECK: # BB#0: |
| 230 | ; CHECK-NEXT: movsd %xmm0, %xmm1 |
| 231 | ; CHECK-NEXT: movaps %xmm1, %xmm0 |
| 232 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 450d166 | 2014-01-20 19:35:22 +0000 | [diff] [blame] | 233 | %1 = select <2 x i1> <i1 true, i1 false>, <2 x double> %a, <2 x double> %b |
| 234 | ret <2 x double> %1 |
| 235 | } |
Andrea Di Biagio | 450d166 | 2014-01-20 19:35:22 +0000 | [diff] [blame] | 236 | |
| 237 | define <2 x i64> @test25(<2 x i64> %a, <2 x i64> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 238 | ; CHECK-LABEL: test25: |
| 239 | ; CHECK: # BB#0: |
| 240 | ; CHECK-NEXT: movsd %xmm0, %xmm1 |
| 241 | ; CHECK-NEXT: movaps %xmm1, %xmm0 |
| 242 | ; CHECK-NEXT: retq |
Andrea Di Biagio | 450d166 | 2014-01-20 19:35:22 +0000 | [diff] [blame] | 243 | %1 = select <2 x i1> <i1 true, i1 false>, <2 x i64> %a, <2 x i64> %b |
| 244 | ret <2 x i64> %1 |
| 245 | } |
Andrea Di Biagio | 450d166 | 2014-01-20 19:35:22 +0000 | [diff] [blame] | 246 | |
Filipe Cabecinhas | 82111f1 | 2014-05-30 23:03:11 +0000 | [diff] [blame] | 247 | define <4 x float> @select_of_shuffles_0(<2 x float> %a0, <2 x float> %b0, <2 x float> %a1, <2 x float> %b1) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 248 | ; CHECK-LABEL: select_of_shuffles_0: |
| 249 | ; CHECK: # BB#0: |
Chandler Carruth | 99627bf | 2014-10-04 03:52:55 +0000 | [diff] [blame] | 250 | ; CHECK-NEXT: unpcklpd {{.*#+}} xmm0 = xmm0[0],xmm2[0] |
| 251 | ; CHECK-NEXT: unpcklpd {{.*#+}} xmm1 = xmm1[0],xmm3[0] |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 252 | ; CHECK-NEXT: subps %xmm1, %xmm0 |
| 253 | ; CHECK-NEXT: retq |
Filipe Cabecinhas | 82111f1 | 2014-05-30 23:03:11 +0000 | [diff] [blame] | 254 | %1 = shufflevector <2 x float> %a0, <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef> |
| 255 | %2 = shufflevector <2 x float> %a1, <2 x float> undef, <4 x i32> <i32 undef, i32 undef, i32 0, i32 1> |
| 256 | %3 = select <4 x i1> <i1 false, i1 false, i1 true, i1 true>, <4 x float> %2, <4 x float> %1 |
| 257 | %4 = shufflevector <2 x float> %b0, <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef> |
| 258 | %5 = shufflevector <2 x float> %b1, <2 x float> undef, <4 x i32> <i32 undef, i32 undef, i32 0, i32 1> |
| 259 | %6 = select <4 x i1> <i1 false, i1 false, i1 true, i1 true>, <4 x float> %5, <4 x float> %4 |
| 260 | %7 = fsub <4 x float> %3, %6 |
| 261 | ret <4 x float> %7 |
| 262 | } |
Benjamin Kramer | ff8b883 | 2014-08-21 13:28:02 +0000 | [diff] [blame] | 263 | |
Benjamin Kramer | ff8b883 | 2014-08-21 13:28:02 +0000 | [diff] [blame] | 264 | ; PR20677 |
| 265 | define <16 x double> @select_illegal(<16 x double> %a, <16 x double> %b) { |
Chandler Carruth | 3a0883f | 2014-10-03 01:57:38 +0000 | [diff] [blame] | 266 | ; CHECK-LABEL: select_illegal: |
| 267 | ; CHECK: # BB#0: |
| 268 | ; CHECK-NEXT: movaps {{[0-9]+}}(%rsp), %xmm4 |
| 269 | ; CHECK-NEXT: movaps {{[0-9]+}}(%rsp), %xmm5 |
| 270 | ; CHECK-NEXT: movaps {{[0-9]+}}(%rsp), %xmm6 |
| 271 | ; CHECK-NEXT: movaps {{[0-9]+}}(%rsp), %xmm7 |
| 272 | ; CHECK-NEXT: movaps %xmm7, 112(%rdi) |
| 273 | ; CHECK-NEXT: movaps %xmm6, 96(%rdi) |
| 274 | ; CHECK-NEXT: movaps %xmm5, 80(%rdi) |
| 275 | ; CHECK-NEXT: movaps %xmm4, 64(%rdi) |
| 276 | ; CHECK-NEXT: movaps %xmm3, 48(%rdi) |
| 277 | ; CHECK-NEXT: movaps %xmm2, 32(%rdi) |
| 278 | ; CHECK-NEXT: movaps %xmm1, 16(%rdi) |
| 279 | ; CHECK-NEXT: movaps %xmm0, (%rdi) |
| 280 | ; CHECK-NEXT: retq |
Benjamin Kramer | ff8b883 | 2014-08-21 13:28:02 +0000 | [diff] [blame] | 281 | %sel = select <16 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false>, <16 x double> %a, <16 x double> %b |
| 282 | ret <16 x double> %sel |
| 283 | } |