OLD | NEW |
1 ; This tests the NaCl intrinsics not related to atomic operations. | 1 ; This tests the NaCl intrinsics not related to atomic operations. |
2 | 2 |
3 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 -sandbox \ | 3 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 -sandbox \ |
4 ; RUN: | FileCheck %s | 4 ; RUN: | FileCheck %s |
5 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 -sandbox \ | 5 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 -sandbox \ |
6 ; RUN: | FileCheck %s | 6 ; RUN: | FileCheck %s |
7 | 7 |
8 ; Do another run w/ O2 and a different check-prefix (otherwise O2 and Om1 | 8 ; Do another run w/ O2 and a different check-prefix (otherwise O2 and Om1 |
9 ; share the same "CHECK" prefix). This separate run helps check that | 9 ; share the same "CHECK" prefix). This separate run helps check that |
10 ; some code is optimized out. | 10 ; some code is optimized out. |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 ; CHECKO2REM-NOT: sqrtsd | 272 ; CHECKO2REM-NOT: sqrtsd |
273 | 273 |
274 define float @test_fabs_float(float %x) { | 274 define float @test_fabs_float(float %x) { |
275 entry: | 275 entry: |
276 %r = call float @llvm.fabs.f32(float %x) | 276 %r = call float @llvm.fabs.f32(float %x) |
277 %r2 = call float @llvm.fabs.f32(float %r) | 277 %r2 = call float @llvm.fabs.f32(float %r) |
278 %r3 = call float @llvm.fabs.f32(float -0.0) | 278 %r3 = call float @llvm.fabs.f32(float -0.0) |
279 %r4 = fadd float %r2, %r3 | 279 %r4 = fadd float %r2, %r3 |
280 ret float %r4 | 280 ret float %r4 |
281 } | 281 } |
| 282 ;;; Specially check that the pand instruction doesn't try to operate on a 32-bit |
| 283 ;;; (f32) memory operand, and instead uses two xmm registers. |
282 ; CHECK-LABEL: test_fabs_float | 284 ; CHECK-LABEL: test_fabs_float |
283 ; CHECK: pcmpeqd | 285 ; CHECK: pcmpeqd |
284 ; CHECK: psrld | 286 ; CHECK: psrld |
285 ; CHECK: pand | 287 ; CHECK: pand {{.*}}xmm{{.*}}xmm |
286 ; CHECK: pcmpeqd | 288 ; CHECK: pcmpeqd |
287 ; CHECK: psrld | 289 ; CHECK: psrld |
288 ; CHECK: pand | 290 ; CHECK: pand {{.*}}xmm{{.*}}xmm |
289 ; CHECK: pcmpeqd | 291 ; CHECK: pcmpeqd |
290 ; CHECK: psrld | 292 ; CHECK: psrld |
291 ; CHECK: pand | 293 ; CHECK: pand {{.*}}xmm{{.*}}xmm |
292 | 294 |
293 define double @test_fabs_double(double %x) { | 295 define double @test_fabs_double(double %x) { |
294 entry: | 296 entry: |
295 %r = call double @llvm.fabs.f64(double %x) | 297 %r = call double @llvm.fabs.f64(double %x) |
296 %r2 = call double @llvm.fabs.f64(double %r) | 298 %r2 = call double @llvm.fabs.f64(double %r) |
297 %r3 = call double @llvm.fabs.f64(double -0.0) | 299 %r3 = call double @llvm.fabs.f64(double -0.0) |
298 %r4 = fadd double %r2, %r3 | 300 %r4 = fadd double %r2, %r3 |
299 ret double %r4 | 301 ret double %r4 |
300 } | 302 } |
| 303 ;;; Specially check that the pand instruction doesn't try to operate on a 64-bit |
| 304 ;;; (f64) memory operand, and instead uses two xmm registers. |
301 ; CHECK-LABEL: test_fabs_double | 305 ; CHECK-LABEL: test_fabs_double |
302 ; CHECK: pcmpeqd | 306 ; CHECK: pcmpeqd |
303 ; CHECK: psrlq | 307 ; CHECK: psrlq |
304 ; CHECK: pand | 308 ; CHECK: pand {{.*}}xmm{{.*}}xmm |
305 ; CHECK: pcmpeqd | 309 ; CHECK: pcmpeqd |
306 ; CHECK: psrlq | 310 ; CHECK: psrlq |
307 ; CHECK: pand | 311 ; CHECK: pand {{.*}}xmm{{.*}}xmm |
308 ; CHECK: pcmpeqd | 312 ; CHECK: pcmpeqd |
309 ; CHECK: psrlq | 313 ; CHECK: psrlq |
310 ; CHECK: pand | 314 ; CHECK: pand {{.*}}xmm{{.*}}xmm |
311 | 315 |
312 define <4 x float> @test_fabs_v4f32(<4 x float> %x) { | 316 define <4 x float> @test_fabs_v4f32(<4 x float> %x) { |
313 entry: | 317 entry: |
314 %r = call <4 x float> @llvm.fabs.v4f32(<4 x float> %x) | 318 %r = call <4 x float> @llvm.fabs.v4f32(<4 x float> %x) |
315 %r2 = call <4 x float> @llvm.fabs.v4f32(<4 x float> %r) | 319 %r2 = call <4 x float> @llvm.fabs.v4f32(<4 x float> %r) |
316 %r3 = call <4 x float> @llvm.fabs.v4f32(<4 x float> undef) | 320 %r3 = call <4 x float> @llvm.fabs.v4f32(<4 x float> undef) |
317 %r4 = fadd <4 x float> %r2, %r3 | 321 %r4 = fadd <4 x float> %r2, %r3 |
318 ret <4 x float> %r4 | 322 ret <4 x float> %r4 |
319 } | 323 } |
320 ; CHECK-LABEL: test_fabs_v4f32 | 324 ; CHECK-LABEL: test_fabs_v4f32 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 | 537 |
534 call void @llvm.stackrestore(i8* %sp1) | 538 call void @llvm.stackrestore(i8* %sp1) |
535 ret void | 539 ret void |
536 } | 540 } |
537 ; CHECK-LABEL: test_stacksave_multiple | 541 ; CHECK-LABEL: test_stacksave_multiple |
538 ; At least 3 copies of esp, but probably more from having to do the allocas. | 542 ; At least 3 copies of esp, but probably more from having to do the allocas. |
539 ; CHECK: mov {{.*}},esp | 543 ; CHECK: mov {{.*}},esp |
540 ; CHECK: mov {{.*}},esp | 544 ; CHECK: mov {{.*}},esp |
541 ; CHECK: mov {{.*}},esp | 545 ; CHECK: mov {{.*}},esp |
542 ; CHECK: mov esp,{{.*}} | 546 ; CHECK: mov esp,{{.*}} |
OLD | NEW |