Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(497)

Side by Side Diff: tests_lit/llvm2ice_tests/nacl-other-intrinsics.ll

Issue 1022573004: Subzero: Add fabs intrinsic support. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/assembler_ia32.cpp ('k') | tests_lit/reader_tests/nacl-other-intrinsics.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.
11 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 -sandbox \ 11 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 -sandbox \
12 ; RUN: | FileCheck --check-prefix=CHECKO2REM %s 12 ; RUN: | FileCheck --check-prefix=CHECKO2REM %s
13 13
14 ; Do O2 runs without -sandbox to make sure llvm.nacl.read.tp gets 14 ; Do O2 runs without -sandbox to make sure llvm.nacl.read.tp gets
15 ; lowered to __nacl_read_tp instead of gs:0x0. 15 ; lowered to __nacl_read_tp instead of gs:0x0.
16 ; We also know that because it's O2, it'll have the O2REM optimizations. 16 ; We also know that because it's O2, it'll have the O2REM optimizations.
17 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \ 17 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \
18 ; RUN: | FileCheck --check-prefix=CHECKO2UNSANDBOXEDREM %s 18 ; RUN: | FileCheck --check-prefix=CHECKO2UNSANDBOXEDREM %s
19 19
20 declare i8* @llvm.nacl.read.tp() 20 declare i8* @llvm.nacl.read.tp()
21 declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) 21 declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
22 declare void @llvm.memmove.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) 22 declare void @llvm.memmove.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
23 declare void @llvm.memset.p0i8.i32(i8*, i8, i32, i32, i1) 23 declare void @llvm.memset.p0i8.i32(i8*, i8, i32, i32, i1)
24 declare void @llvm.nacl.longjmp(i8*, i32) 24 declare void @llvm.nacl.longjmp(i8*, i32)
25 declare i32 @llvm.nacl.setjmp(i8*) 25 declare i32 @llvm.nacl.setjmp(i8*)
26 declare float @llvm.sqrt.f32(float) 26 declare float @llvm.sqrt.f32(float)
27 declare double @llvm.sqrt.f64(double) 27 declare double @llvm.sqrt.f64(double)
28 declare float @llvm.fabs.f32(float)
29 declare double @llvm.fabs.f64(double)
30 declare <4 x float> @llvm.fabs.v4f32(<4 x float>)
28 declare void @llvm.trap() 31 declare void @llvm.trap()
29 declare i16 @llvm.bswap.i16(i16) 32 declare i16 @llvm.bswap.i16(i16)
30 declare i32 @llvm.bswap.i32(i32) 33 declare i32 @llvm.bswap.i32(i32)
31 declare i64 @llvm.bswap.i64(i64) 34 declare i64 @llvm.bswap.i64(i64)
32 declare i32 @llvm.ctlz.i32(i32, i1) 35 declare i32 @llvm.ctlz.i32(i32, i1)
33 declare i64 @llvm.ctlz.i64(i64, i1) 36 declare i64 @llvm.ctlz.i64(i64, i1)
34 declare i32 @llvm.cttz.i32(i32, i1) 37 declare i32 @llvm.cttz.i32(i32, i1)
35 declare i64 @llvm.cttz.i64(i64, i1) 38 declare i64 @llvm.cttz.i64(i64, i1)
36 declare i32 @llvm.ctpop.i32(i32) 39 declare i32 @llvm.ctpop.i32(i32)
37 declare i64 @llvm.ctpop.i64(i64) 40 declare i64 @llvm.ctpop.i64(i64)
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 define float @test_sqrt_ignored(float %x, double %y) { 264 define float @test_sqrt_ignored(float %x, double %y) {
262 entry: 265 entry:
263 %ignored1 = call float @llvm.sqrt.f32(float %x) 266 %ignored1 = call float @llvm.sqrt.f32(float %x)
264 %ignored2 = call double @llvm.sqrt.f64(double %y) 267 %ignored2 = call double @llvm.sqrt.f64(double %y)
265 ret float 0.0 268 ret float 0.0
266 } 269 }
267 ; CHECKO2REM-LABEL: test_sqrt_ignored 270 ; CHECKO2REM-LABEL: test_sqrt_ignored
268 ; CHECKO2REM-NOT: sqrtss 271 ; CHECKO2REM-NOT: sqrtss
269 ; CHECKO2REM-NOT: sqrtsd 272 ; CHECKO2REM-NOT: sqrtsd
270 273
274 define float @test_fabs_float(float %x) {
275 entry:
276 %r = call float @llvm.fabs.f32(float %x)
277 %r2 = call float @llvm.fabs.f32(float %r)
278 %r3 = call float @llvm.fabs.f32(float -0.0)
279 %r4 = fadd float %r2, %r3
280 ret float %r4
281 }
282 ; CHECK-LABEL: test_fabs_float
283 ; CHECK: pcmpeqd
284 ; CHECK: psrld
285 ; CHECK: pand
286 ; CHECK: pcmpeqd
287 ; CHECK: psrld
288 ; CHECK: pand
289 ; CHECK: pcmpeqd
290 ; CHECK: psrld
291 ; CHECK: pand
292
293 define double @test_fabs_double(double %x) {
294 entry:
295 %r = call double @llvm.fabs.f64(double %x)
296 %r2 = call double @llvm.fabs.f64(double %r)
297 %r3 = call double @llvm.fabs.f64(double -0.0)
298 %r4 = fadd double %r2, %r3
299 ret double %r4
300 }
301 ; CHECK-LABEL: test_fabs_double
302 ; CHECK: pcmpeqd
303 ; CHECK: psrlq
304 ; CHECK: pand
305 ; CHECK: pcmpeqd
306 ; CHECK: psrlq
307 ; CHECK: pand
308 ; CHECK: pcmpeqd
309 ; CHECK: psrlq
310 ; CHECK: pand
311
312 define <4 x float> @test_fabs_v4f32(<4 x float> %x) {
313 entry:
314 %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)
316 %r3 = call <4 x float> @llvm.fabs.v4f32(<4 x float> undef)
317 %r4 = fadd <4 x float> %r2, %r3
318 ret <4 x float> %r4
319 }
320 ; CHECK-LABEL: test_fabs_v4f32
321 ; CHECK: pcmpeqd
322 ; CHECK: psrld
323 ; CHECK: pand
324 ; CHECK: pcmpeqd
325 ; CHECK: psrld
326 ; CHECK: pand
327 ; CHECK: pcmpeqd
328 ; CHECK: psrld
329 ; CHECK: pand
330
271 define i32 @test_trap(i32 %br) { 331 define i32 @test_trap(i32 %br) {
272 entry: 332 entry:
273 %r1 = icmp eq i32 %br, 0 333 %r1 = icmp eq i32 %br, 0
274 br i1 %r1, label %Zero, label %NonZero 334 br i1 %r1, label %Zero, label %NonZero
275 Zero: 335 Zero:
276 call void @llvm.trap() 336 call void @llvm.trap()
277 unreachable 337 unreachable
278 NonZero: 338 NonZero:
279 ret i32 1 339 ret i32 1
280 } 340 }
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 533
474 call void @llvm.stackrestore(i8* %sp1) 534 call void @llvm.stackrestore(i8* %sp1)
475 ret void 535 ret void
476 } 536 }
477 ; CHECK-LABEL: test_stacksave_multiple 537 ; CHECK-LABEL: test_stacksave_multiple
478 ; At least 3 copies of esp, but probably more from having to do the allocas. 538 ; At least 3 copies of esp, but probably more from having to do the allocas.
479 ; CHECK: mov {{.*}},esp 539 ; CHECK: mov {{.*}},esp
480 ; CHECK: mov {{.*}},esp 540 ; CHECK: mov {{.*}},esp
481 ; CHECK: mov {{.*}},esp 541 ; CHECK: mov {{.*}},esp
482 ; CHECK: mov esp,{{.*}} 542 ; CHECK: mov esp,{{.*}}
OLDNEW
« no previous file with comments | « src/assembler_ia32.cpp ('k') | tests_lit/reader_tests/nacl-other-intrinsics.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698