OLD | NEW |
1 ; This test checks support for vector arithmetic. | 1 ; This test checks support for vector arithmetic. |
2 | 2 |
3 ; RUN: %llvm2ice -O2 --verbose none %s | FileCheck %s | 3 ; RUN: %llvm2ice -O2 --verbose none %s | FileCheck %s |
4 ; RUN: %llvm2ice -Om1 --verbose none %s | FileCheck %s | 4 ; RUN: %llvm2ice -Om1 --verbose none %s | FileCheck %s |
5 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s | 5 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s |
6 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s | 6 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s |
7 ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \ | 7 ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \ |
8 ; RUN: | FileCheck --check-prefix=DUMP %s | 8 ; RUN: | FileCheck --check-prefix=DUMP %s |
9 | 9 |
10 define <4 x float> @test_fadd(<4 x float> %arg0, <4 x float> %arg1) { | 10 define <4 x float> @test_fadd(<4 x float> %arg0, <4 x float> %arg1) { |
(...skipping 26 matching lines...) Expand all Loading... |
37 ret <4 x float> %res | 37 ret <4 x float> %res |
38 ; CHECK-LABEL: test_fdiv: | 38 ; CHECK-LABEL: test_fdiv: |
39 ; CHECK: divps | 39 ; CHECK: divps |
40 } | 40 } |
41 | 41 |
42 define <4 x float> @test_frem(<4 x float> %arg0, <4 x float> %arg1) { | 42 define <4 x float> @test_frem(<4 x float> %arg0, <4 x float> %arg1) { |
43 entry: | 43 entry: |
44 %res = frem <4 x float> %arg0, %arg1 | 44 %res = frem <4 x float> %arg0, %arg1 |
45 ret <4 x float> %res | 45 ret <4 x float> %res |
46 ; CHECK-LABEL: test_frem: | 46 ; CHECK-LABEL: test_frem: |
47 ; CHECK: __frem_v4f32 | 47 ; CHECK: Sz_frem_v4f32 |
| 48 } |
| 49 |
| 50 define <16 x i8> @test_add_v16i8(<16 x i8> %arg0, <16 x i8> %arg1) { |
| 51 entry: |
| 52 %res = add <16 x i8> %arg0, %arg1 |
| 53 ret <16 x i8> %res |
| 54 ; CHECK-LABEL: test_add_v16i8: |
| 55 ; CHECK: paddb |
| 56 } |
| 57 |
| 58 define <16 x i8> @test_and_v16i8(<16 x i8> %arg0, <16 x i8> %arg1) { |
| 59 entry: |
| 60 %res = and <16 x i8> %arg0, %arg1 |
| 61 ret <16 x i8> %res |
| 62 ; CHECK-LABEL: test_and_v16i8: |
| 63 ; CHECK: pand |
| 64 } |
| 65 |
| 66 define <16 x i8> @test_or_v16i8(<16 x i8> %arg0, <16 x i8> %arg1) { |
| 67 entry: |
| 68 %res = or <16 x i8> %arg0, %arg1 |
| 69 ret <16 x i8> %res |
| 70 ; CHECK-LABEL: test_or_v16i8: |
| 71 ; CHECK: por |
| 72 } |
| 73 |
| 74 define <16 x i8> @test_xor_v16i8(<16 x i8> %arg0, <16 x i8> %arg1) { |
| 75 entry: |
| 76 %res = xor <16 x i8> %arg0, %arg1 |
| 77 ret <16 x i8> %res |
| 78 ; CHECK-LABEL: test_xor_v16i8: |
| 79 ; CHECK: pxor |
| 80 } |
| 81 |
| 82 define <16 x i8> @test_sub_v16i8(<16 x i8> %arg0, <16 x i8> %arg1) { |
| 83 entry: |
| 84 %res = sub <16 x i8> %arg0, %arg1 |
| 85 ret <16 x i8> %res |
| 86 ; CHECK-LABEL: test_sub_v16i8: |
| 87 ; CHECK: psubb |
| 88 } |
| 89 |
| 90 define <16 x i8> @test_mul_v16i8(<16 x i8> %arg0, <16 x i8> %arg1) { |
| 91 entry: |
| 92 %res = mul <16 x i8> %arg0, %arg1 |
| 93 ret <16 x i8> %res |
| 94 ; CHECK-LABEL: test_mul_v16i8: |
| 95 ; CHECK: Sz_mul_v16i8 |
| 96 } |
| 97 |
| 98 define <16 x i8> @test_shl_v16i8(<16 x i8> %arg0, <16 x i8> %arg1) { |
| 99 entry: |
| 100 %res = shl <16 x i8> %arg0, %arg1 |
| 101 ret <16 x i8> %res |
| 102 ; CHECK-LABEL: test_shl_v16i8: |
| 103 ; CHECK: Sz_shl_v16i8 |
| 104 } |
| 105 |
| 106 define <16 x i8> @test_lshr_v16i8(<16 x i8> %arg0, <16 x i8> %arg1) { |
| 107 entry: |
| 108 %res = lshr <16 x i8> %arg0, %arg1 |
| 109 ret <16 x i8> %res |
| 110 ; CHECK-LABEL: test_lshr_v16i8: |
| 111 ; CHECK: Sz_lshr_v16i8 |
| 112 } |
| 113 |
| 114 define <16 x i8> @test_ashr_v16i8(<16 x i8> %arg0, <16 x i8> %arg1) { |
| 115 entry: |
| 116 %res = ashr <16 x i8> %arg0, %arg1 |
| 117 ret <16 x i8> %res |
| 118 ; CHECK-LABEL: test_ashr_v16i8: |
| 119 ; CHECK: Sz_ashr_v16i8 |
| 120 } |
| 121 |
| 122 define <16 x i8> @test_udiv_v16i8(<16 x i8> %arg0, <16 x i8> %arg1) { |
| 123 entry: |
| 124 %res = udiv <16 x i8> %arg0, %arg1 |
| 125 ret <16 x i8> %res |
| 126 ; CHECK-LABEL: test_udiv_v16i8: |
| 127 ; CHECK: Sz_udiv_v16i8 |
| 128 } |
| 129 |
| 130 define <16 x i8> @test_sdiv_v16i8(<16 x i8> %arg0, <16 x i8> %arg1) { |
| 131 entry: |
| 132 %res = sdiv <16 x i8> %arg0, %arg1 |
| 133 ret <16 x i8> %res |
| 134 ; CHECK-LABEL: test_sdiv_v16i8: |
| 135 ; CHECK: Sz_sdiv_v16i8 |
| 136 } |
| 137 |
| 138 define <16 x i8> @test_urem_v16i8(<16 x i8> %arg0, <16 x i8> %arg1) { |
| 139 entry: |
| 140 %res = urem <16 x i8> %arg0, %arg1 |
| 141 ret <16 x i8> %res |
| 142 ; CHECK-LABEL: test_urem_v16i8: |
| 143 ; CHECK: Sz_urem_v16i8 |
| 144 } |
| 145 |
| 146 define <16 x i8> @test_srem_v16i8(<16 x i8> %arg0, <16 x i8> %arg1) { |
| 147 entry: |
| 148 %res = srem <16 x i8> %arg0, %arg1 |
| 149 ret <16 x i8> %res |
| 150 ; CHECK-LABEL: test_srem_v16i8: |
| 151 ; CHECK: Sz_srem_v16i8 |
| 152 } |
| 153 |
| 154 define <8 x i16> @test_add_v8i16(<8 x i16> %arg0, <8 x i16> %arg1) { |
| 155 entry: |
| 156 %res = add <8 x i16> %arg0, %arg1 |
| 157 ret <8 x i16> %res |
| 158 ; CHECK-LABEL: test_add_v8i16: |
| 159 ; CHECK: paddw |
| 160 } |
| 161 |
| 162 define <8 x i16> @test_and_v8i16(<8 x i16> %arg0, <8 x i16> %arg1) { |
| 163 entry: |
| 164 %res = and <8 x i16> %arg0, %arg1 |
| 165 ret <8 x i16> %res |
| 166 ; CHECK-LABEL: test_and_v8i16: |
| 167 ; CHECK: pand |
| 168 } |
| 169 |
| 170 define <8 x i16> @test_or_v8i16(<8 x i16> %arg0, <8 x i16> %arg1) { |
| 171 entry: |
| 172 %res = or <8 x i16> %arg0, %arg1 |
| 173 ret <8 x i16> %res |
| 174 ; CHECK-LABEL: test_or_v8i16: |
| 175 ; CHECK: por |
| 176 } |
| 177 |
| 178 define <8 x i16> @test_xor_v8i16(<8 x i16> %arg0, <8 x i16> %arg1) { |
| 179 entry: |
| 180 %res = xor <8 x i16> %arg0, %arg1 |
| 181 ret <8 x i16> %res |
| 182 ; CHECK-LABEL: test_xor_v8i16: |
| 183 ; CHECK: pxor |
| 184 } |
| 185 |
| 186 define <8 x i16> @test_sub_v8i16(<8 x i16> %arg0, <8 x i16> %arg1) { |
| 187 entry: |
| 188 %res = sub <8 x i16> %arg0, %arg1 |
| 189 ret <8 x i16> %res |
| 190 ; CHECK-LABEL: test_sub_v8i16: |
| 191 ; CHECK: psubw |
| 192 } |
| 193 |
| 194 define <8 x i16> @test_mul_v8i16(<8 x i16> %arg0, <8 x i16> %arg1) { |
| 195 entry: |
| 196 %res = mul <8 x i16> %arg0, %arg1 |
| 197 ret <8 x i16> %res |
| 198 ; CHECK-LABEL: test_mul_v8i16: |
| 199 ; CHECK: pmullw |
| 200 } |
| 201 |
| 202 define <8 x i16> @test_shl_v8i16(<8 x i16> %arg0, <8 x i16> %arg1) { |
| 203 entry: |
| 204 %res = shl <8 x i16> %arg0, %arg1 |
| 205 ret <8 x i16> %res |
| 206 ; CHECK-LABEL: test_shl_v8i16: |
| 207 ; CHECK: Sz_shl_v8i16 |
| 208 } |
| 209 |
| 210 define <8 x i16> @test_lshr_v8i16(<8 x i16> %arg0, <8 x i16> %arg1) { |
| 211 entry: |
| 212 %res = lshr <8 x i16> %arg0, %arg1 |
| 213 ret <8 x i16> %res |
| 214 ; CHECK-LABEL: test_lshr_v8i16: |
| 215 ; CHECK: Sz_lshr_v8i16 |
| 216 } |
| 217 |
| 218 define <8 x i16> @test_ashr_v8i16(<8 x i16> %arg0, <8 x i16> %arg1) { |
| 219 entry: |
| 220 %res = ashr <8 x i16> %arg0, %arg1 |
| 221 ret <8 x i16> %res |
| 222 ; CHECK-LABEL: test_ashr_v8i16: |
| 223 ; CHECK: Sz_ashr_v8i16 |
| 224 } |
| 225 |
| 226 define <8 x i16> @test_udiv_v8i16(<8 x i16> %arg0, <8 x i16> %arg1) { |
| 227 entry: |
| 228 %res = udiv <8 x i16> %arg0, %arg1 |
| 229 ret <8 x i16> %res |
| 230 ; CHECK-LABEL: test_udiv_v8i16: |
| 231 ; CHECK: Sz_udiv_v8i16 |
| 232 } |
| 233 |
| 234 define <8 x i16> @test_sdiv_v8i16(<8 x i16> %arg0, <8 x i16> %arg1) { |
| 235 entry: |
| 236 %res = sdiv <8 x i16> %arg0, %arg1 |
| 237 ret <8 x i16> %res |
| 238 ; CHECK-LABEL: test_sdiv_v8i16: |
| 239 ; CHECK: Sz_sdiv_v8i16 |
| 240 } |
| 241 |
| 242 define <8 x i16> @test_urem_v8i16(<8 x i16> %arg0, <8 x i16> %arg1) { |
| 243 entry: |
| 244 %res = urem <8 x i16> %arg0, %arg1 |
| 245 ret <8 x i16> %res |
| 246 ; CHECK-LABEL: test_urem_v8i16: |
| 247 ; CHECK: Sz_urem_v8i16 |
| 248 } |
| 249 |
| 250 define <8 x i16> @test_srem_v8i16(<8 x i16> %arg0, <8 x i16> %arg1) { |
| 251 entry: |
| 252 %res = srem <8 x i16> %arg0, %arg1 |
| 253 ret <8 x i16> %res |
| 254 ; CHECK-LABEL: test_srem_v8i16: |
| 255 ; CHECK: Sz_srem_v8i16 |
| 256 } |
| 257 |
| 258 define <4 x i32> @test_add_v4i32(<4 x i32> %arg0, <4 x i32> %arg1) { |
| 259 entry: |
| 260 %res = add <4 x i32> %arg0, %arg1 |
| 261 ret <4 x i32> %res |
| 262 ; CHECK-LABEL: test_add_v4i32: |
| 263 ; CHECK: paddd |
| 264 } |
| 265 |
| 266 define <4 x i32> @test_and_v4i32(<4 x i32> %arg0, <4 x i32> %arg1) { |
| 267 entry: |
| 268 %res = and <4 x i32> %arg0, %arg1 |
| 269 ret <4 x i32> %res |
| 270 ; CHECK-LABEL: test_and_v4i32: |
| 271 ; CHECK: pand |
| 272 } |
| 273 |
| 274 define <4 x i32> @test_or_v4i32(<4 x i32> %arg0, <4 x i32> %arg1) { |
| 275 entry: |
| 276 %res = or <4 x i32> %arg0, %arg1 |
| 277 ret <4 x i32> %res |
| 278 ; CHECK-LABEL: test_or_v4i32: |
| 279 ; CHECK: por |
| 280 } |
| 281 |
| 282 define <4 x i32> @test_xor_v4i32(<4 x i32> %arg0, <4 x i32> %arg1) { |
| 283 entry: |
| 284 %res = xor <4 x i32> %arg0, %arg1 |
| 285 ret <4 x i32> %res |
| 286 ; CHECK-LABEL: test_xor_v4i32: |
| 287 ; CHECK: pxor |
| 288 } |
| 289 |
| 290 define <4 x i32> @test_sub_v4i32(<4 x i32> %arg0, <4 x i32> %arg1) { |
| 291 entry: |
| 292 %res = sub <4 x i32> %arg0, %arg1 |
| 293 ret <4 x i32> %res |
| 294 ; CHECK-LABEL: test_sub_v4i32: |
| 295 ; CHECK: psubd |
| 296 } |
| 297 |
| 298 define <4 x i32> @test_mul_v4i32(<4 x i32> %arg0, <4 x i32> %arg1) { |
| 299 entry: |
| 300 %res = mul <4 x i32> %arg0, %arg1 |
| 301 ret <4 x i32> %res |
| 302 ; CHECK-LABEL: test_mul_v4i32: |
| 303 ; CHECK: pmuludq |
| 304 ; CHECK: pmuludq |
| 305 } |
| 306 |
| 307 define <4 x i32> @test_shl_v4i32(<4 x i32> %arg0, <4 x i32> %arg1) { |
| 308 entry: |
| 309 %res = shl <4 x i32> %arg0, %arg1 |
| 310 ret <4 x i32> %res |
| 311 ; CHECK-LABEL: test_shl_v4i32: |
| 312 ; CHECK: Sz_shl_v4i32 |
| 313 } |
| 314 |
| 315 define <4 x i32> @test_lshr_v4i32(<4 x i32> %arg0, <4 x i32> %arg1) { |
| 316 entry: |
| 317 %res = lshr <4 x i32> %arg0, %arg1 |
| 318 ret <4 x i32> %res |
| 319 ; CHECK-LABEL: test_lshr_v4i32: |
| 320 ; CHECK: Sz_lshr_v4i32 |
| 321 } |
| 322 |
| 323 define <4 x i32> @test_ashr_v4i32(<4 x i32> %arg0, <4 x i32> %arg1) { |
| 324 entry: |
| 325 %res = ashr <4 x i32> %arg0, %arg1 |
| 326 ret <4 x i32> %res |
| 327 ; CHECK-LABEL: test_ashr_v4i32: |
| 328 ; CHECK: Sz_ashr_v4i32 |
| 329 } |
| 330 |
| 331 define <4 x i32> @test_udiv_v4i32(<4 x i32> %arg0, <4 x i32> %arg1) { |
| 332 entry: |
| 333 %res = udiv <4 x i32> %arg0, %arg1 |
| 334 ret <4 x i32> %res |
| 335 ; CHECK-LABEL: test_udiv_v4i32: |
| 336 ; CHECK: Sz_udiv_v4i32 |
| 337 } |
| 338 |
| 339 define <4 x i32> @test_sdiv_v4i32(<4 x i32> %arg0, <4 x i32> %arg1) { |
| 340 entry: |
| 341 %res = sdiv <4 x i32> %arg0, %arg1 |
| 342 ret <4 x i32> %res |
| 343 ; CHECK-LABEL: test_sdiv_v4i32: |
| 344 ; CHECK: Sz_sdiv_v4i32 |
| 345 } |
| 346 |
| 347 define <4 x i32> @test_urem_v4i32(<4 x i32> %arg0, <4 x i32> %arg1) { |
| 348 entry: |
| 349 %res = urem <4 x i32> %arg0, %arg1 |
| 350 ret <4 x i32> %res |
| 351 ; CHECK-LABEL: test_urem_v4i32: |
| 352 ; CHECK: Sz_urem_v4i32 |
| 353 } |
| 354 |
| 355 define <4 x i32> @test_srem_v4i32(<4 x i32> %arg0, <4 x i32> %arg1) { |
| 356 entry: |
| 357 %res = srem <4 x i32> %arg0, %arg1 |
| 358 ret <4 x i32> %res |
| 359 ; CHECK-LABEL: test_srem_v4i32: |
| 360 ; CHECK: Sz_srem_v4i32 |
48 } | 361 } |
49 | 362 |
50 ; ERRORS-NOT: ICE translation error | 363 ; ERRORS-NOT: ICE translation error |
51 ; DUMP-NOT: SZ | 364 ; DUMP-NOT: SZ |
OLD | NEW |