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

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

Issue 2364093002: Subzero, MIPS32: Intrinsic calls Ctlz and Cttz for i64 (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Bitcast added Created 4 years, 2 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
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: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ 3 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \
4 ; RUN: --target x8632 --sandbox -i %s --args -O2 \ 4 ; RUN: --target x8632 --sandbox -i %s --args -O2 \
5 ; RUN: -allow-externally-defined-symbols \ 5 ; RUN: -allow-externally-defined-symbols \
6 ; RUN: | %if --need=target_X8632 --command FileCheck %s 6 ; RUN: | %if --need=target_X8632 --command FileCheck %s
7 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ 7 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \
8 ; RUN: --target x8632 --sandbox -i %s --args -Om1 \ 8 ; RUN: --target x8632 --sandbox -i %s --args -Om1 \
9 ; RUN: -allow-externally-defined-symbols \ 9 ; RUN: -allow-externally-defined-symbols \
10 ; RUN: | %if --need=target_X8632 --command FileCheck %s 10 ; RUN: | %if --need=target_X8632 --command FileCheck %s
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 %r = call i32 @llvm.ctlz.i32(i32 123456, i1 false) 411 %r = call i32 @llvm.ctlz.i32(i32 123456, i1 false)
412 ret i32 %r 412 ret i32 %r
413 } 413 }
414 ; Could potentially constant fold this, but the front-end should have done that. 414 ; Could potentially constant fold this, but the front-end should have done that.
415 ; The dest operand must be a register and the source operand must be a register 415 ; The dest operand must be a register and the source operand must be a register
416 ; or memory. 416 ; or memory.
417 ; CHECK-LABEL: test_ctlz_32_const 417 ; CHECK-LABEL: test_ctlz_32_const
418 ; CHECK: bsr e{{.*}},{{.*}}e{{.*}} 418 ; CHECK: bsr e{{.*}},{{.*}}e{{.*}}
419 ; ARM32-LABEL: test_ctlz_32_const 419 ; ARM32-LABEL: test_ctlz_32_const
420 ; ARM32: clz 420 ; ARM32: clz
421 ; MIPS32-LABEL: test_ctlz_32_const
422 ; MIPS32: clz
421 423
422 define internal i32 @test_ctlz_32_ignored(i32 %x) { 424 define internal i32 @test_ctlz_32_ignored(i32 %x) {
423 entry: 425 entry:
424 %ignored = call i32 @llvm.ctlz.i32(i32 %x, i1 false) 426 %ignored = call i32 @llvm.ctlz.i32(i32 %x, i1 false)
425 ret i32 1 427 ret i32 1
426 } 428 }
427 ; CHECKO2REM-LABEL: test_ctlz_32_ignored 429 ; CHECKO2REM-LABEL: test_ctlz_32_ignored
428 ; CHECKO2REM-NOT: bsr 430 ; CHECKO2REM-NOT: bsr
429 431
430 define internal i64 @test_ctlz_64(i64 %x) { 432 define internal i64 @test_ctlz_64(i64 %x) {
(...skipping 12 matching lines...) Expand all
443 ; CHECK: xor [[REG_RES2]],0x1f 445 ; CHECK: xor [[REG_RES2]],0x1f
444 ; CHECK: test [[REG_UPPER:.*]],[[REG_UPPER]] 446 ; CHECK: test [[REG_UPPER:.*]],[[REG_UPPER]]
445 ; CHECK: cmove [[REG_RES2]],[[REG_RES1]] 447 ; CHECK: cmove [[REG_RES2]],[[REG_RES1]]
446 ; CHECK: mov {{.*}},0x0 448 ; CHECK: mov {{.*}},0x0
447 ; ARM32-LABEL: test_ctlz_64 449 ; ARM32-LABEL: test_ctlz_64
448 ; ARM32: clz 450 ; ARM32: clz
449 ; ARM32: cmp {{.*}}, #0 451 ; ARM32: cmp {{.*}}, #0
450 ; ARM32: add {{.*}}, #32 452 ; ARM32: add {{.*}}, #32
451 ; ARM32: clzne 453 ; ARM32: clzne
452 ; ARM32: mov {{.*}}, #0 454 ; ARM32: mov {{.*}}, #0
455 ; MIPS32-LABEL: test_ctlz_64
456 ; MIPS32: clz
457 ; MIPS32: clz
458 ; MIPS32: addiu
459 ; MIPS32: movn
460 ; MIPS32: addiu
453 461
454 define internal i32 @test_ctlz_64_const(i64 %x) { 462 define internal i32 @test_ctlz_64_const(i64 %x) {
455 entry: 463 entry:
456 %r = call i64 @llvm.ctlz.i64(i64 123456789012, i1 false) 464 %r = call i64 @llvm.ctlz.i64(i64 123456789012, i1 false)
457 %r2 = trunc i64 %r to i32 465 %r2 = trunc i64 %r to i32
458 ret i32 %r2 466 ret i32 %r2
459 } 467 }
460 ; CHECK-LABEL: test_ctlz_64_const 468 ; CHECK-LABEL: test_ctlz_64_const
461 ; CHECK: bsr e{{.*}},{{.*}}e{{.*}} 469 ; CHECK: bsr e{{.*}},{{.*}}e{{.*}}
462 ; CHECK: bsr e{{.*}},{{.*}}e{{.*}} 470 ; CHECK: bsr e{{.*}},{{.*}}e{{.*}}
463 ; ARM32-LABEL: test_ctlz_64 471 ; ARM32-LABEL: test_ctlz_64
464 ; ARM32: clz 472 ; ARM32: clz
465 ; ARM32: clzne 473 ; ARM32: clzne
474 ; MIPS32-LABEL: test_ctlz_64_const
475 ; MIPS32: clz
476 ; MIPS32: clz
477 ; MIPS32: addiu
478 ; MIPS32: movn
479 ; MIPS32: addiu
466 480
467 define internal i32 @test_ctlz_64_ignored(i64 %x) { 481 define internal i32 @test_ctlz_64_ignored(i64 %x) {
468 entry: 482 entry:
469 %ignored = call i64 @llvm.ctlz.i64(i64 1234567890, i1 false) 483 %ignored = call i64 @llvm.ctlz.i64(i64 1234567890, i1 false)
470 ret i32 2 484 ret i32 2
471 } 485 }
472 ; CHECKO2REM-LABEL: test_ctlz_64_ignored 486 ; CHECKO2REM-LABEL: test_ctlz_64_ignored
473 ; CHECKO2REM-NOT: bsr 487 ; CHECKO2REM-NOT: bsr
474 488
475 define internal i32 @test_cttz_32(i32 %x) { 489 define internal i32 @test_cttz_32(i32 %x) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 ; CHECK: cmove [[REG_RES2]],[[REG_RES1]] 521 ; CHECK: cmove [[REG_RES2]],[[REG_RES1]]
508 ; CHECK: mov {{.*}},0x0 522 ; CHECK: mov {{.*}},0x0
509 ; ARM32-LABEL: test_cttz_64 523 ; ARM32-LABEL: test_cttz_64
510 ; ARM32: rbit 524 ; ARM32: rbit
511 ; ARM32: rbit 525 ; ARM32: rbit
512 ; ARM32: clz 526 ; ARM32: clz
513 ; ARM32: cmp {{.*}}, #0 527 ; ARM32: cmp {{.*}}, #0
514 ; ARM32: add {{.*}}, #32 528 ; ARM32: add {{.*}}, #32
515 ; ARM32: clzne 529 ; ARM32: clzne
516 ; ARM32: mov {{.*}}, #0 530 ; ARM32: mov {{.*}}, #0
531 ; MIPS32-LABEL: test_cttz_64
532 ; MIPS32: addiu
533 ; MIPS32: nor
534 ; MIPS32: and
535 ; MIPS32: clz
536 ; MIPS32: li
537 ; MIPS32: subu
538 ; MIPS32: addiu
539 ; MIPS32: nor
540 ; MIPS32: and
541 ; MIPS32: clz
542 ; MIPS32: li
543 ; MIPS32: subu
517 544
518 define internal i32 @test_popcount_32(i32 %x) { 545 define internal i32 @test_popcount_32(i32 %x) {
519 entry: 546 entry:
520 %r = call i32 @llvm.ctpop.i32(i32 %x) 547 %r = call i32 @llvm.ctpop.i32(i32 %x)
521 ret i32 %r 548 ret i32 %r
522 } 549 }
523 ; CHECK-LABEL: test_popcount_32 550 ; CHECK-LABEL: test_popcount_32
524 ; CHECK: call {{.*}} R_{{.*}} __popcountsi2 551 ; CHECK: call {{.*}} R_{{.*}} __popcountsi2
525 ; ARM32-LABEL: test_popcount_32 552 ; ARM32-LABEL: test_popcount_32
526 ; ARM32: bl {{.*}} __popcountsi2 553 ; ARM32: bl {{.*}} __popcountsi2
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 ; CHECK: lea {{.*}},[esp+0x10] 636 ; CHECK: lea {{.*}},[esp+0x10]
610 ; CHECK: lea {{.*}},[esp+0x10] 637 ; CHECK: lea {{.*}},[esp+0x10]
611 ; CHECK: call 638 ; CHECK: call
612 ; CHECK: mov esp,{{.*}} 639 ; CHECK: mov esp,{{.*}}
613 ; CHECK: mov esp,ebp 640 ; CHECK: mov esp,ebp
614 ; ARM32-LABEL: test_stacksave_multiple 641 ; ARM32-LABEL: test_stacksave_multiple
615 ; ARM32: mov {{.*}}, sp 642 ; ARM32: mov {{.*}}, sp
616 ; ARM32: mov {{.*}}, sp 643 ; ARM32: mov {{.*}}, sp
617 ; ARM32: mov {{.*}}, sp 644 ; ARM32: mov {{.*}}, sp
618 ; ARM32: mov sp, {{.*}} 645 ; ARM32: mov sp, {{.*}}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698