| 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: %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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 NonZero: | 122 NonZero: |
| 123 ret i32 1 | 123 ret i32 1 |
| 124 } | 124 } |
| 125 ; CHECK-LABEL: test_setjmplongjmp | 125 ; CHECK-LABEL: test_setjmplongjmp |
| 126 ; CHECK: call {{.*}} R_{{.*}} setjmp | 126 ; CHECK: call {{.*}} R_{{.*}} setjmp |
| 127 ; CHECK: call {{.*}} R_{{.*}} longjmp | 127 ; CHECK: call {{.*}} R_{{.*}} longjmp |
| 128 ; CHECKO2REM-LABEL: test_setjmplongjmp | 128 ; CHECKO2REM-LABEL: test_setjmplongjmp |
| 129 ; CHECKO2REM: call {{.*}} R_{{.*}} setjmp | 129 ; CHECKO2REM: call {{.*}} R_{{.*}} setjmp |
| 130 ; CHECKO2REM: call {{.*}} R_{{.*}} longjmp | 130 ; CHECKO2REM: call {{.*}} R_{{.*}} longjmp |
| 131 ; ARM32-LABEL: test_setjmplongjmp | 131 ; ARM32-LABEL: test_setjmplongjmp |
| 132 ; ARM32: movw [[CALL:r[0-9]]], {{.+}} setjmp | 132 ; ARM32: bl {{.*}} setjmp |
| 133 ; ARM32: movt [[CALL]] | 133 ; ARM32: bl {{.*}} longjmp |
| 134 ; ARM32: blx [[CALL]] | |
| 135 ; ARM32: movw [[CALL:r[0-9]]], {{.+}} longjmp | |
| 136 ; ARM32: movt [[CALL]] | |
| 137 ; ARM32: blx [[CALL]] | |
| 138 | 134 |
| 139 define internal i32 @test_setjmp_unused(i32 %iptr_env, i32 %i_other) { | 135 define internal i32 @test_setjmp_unused(i32 %iptr_env, i32 %i_other) { |
| 140 entry: | 136 entry: |
| 141 %env = inttoptr i32 %iptr_env to i8* | 137 %env = inttoptr i32 %iptr_env to i8* |
| 142 %i = call i32 @llvm.nacl.setjmp(i8* %env) | 138 %i = call i32 @llvm.nacl.setjmp(i8* %env) |
| 143 ret i32 %i_other | 139 ret i32 %i_other |
| 144 } | 140 } |
| 145 ; Don't consider setjmp side-effect free, so it's not eliminated if | 141 ; Don't consider setjmp side-effect free, so it's not eliminated if |
| 146 ; result unused. | 142 ; result unused. |
| 147 ; CHECKO2REM-LABEL: test_setjmp_unused | 143 ; CHECKO2REM-LABEL: test_setjmp_unused |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 ; ARM32: mov {{.*}}, #0 | 464 ; ARM32: mov {{.*}}, #0 |
| 469 | 465 |
| 470 define internal i32 @test_popcount_32(i32 %x) { | 466 define internal i32 @test_popcount_32(i32 %x) { |
| 471 entry: | 467 entry: |
| 472 %r = call i32 @llvm.ctpop.i32(i32 %x) | 468 %r = call i32 @llvm.ctpop.i32(i32 %x) |
| 473 ret i32 %r | 469 ret i32 %r |
| 474 } | 470 } |
| 475 ; CHECK-LABEL: test_popcount_32 | 471 ; CHECK-LABEL: test_popcount_32 |
| 476 ; CHECK: call {{.*}} R_{{.*}} __popcountsi2 | 472 ; CHECK: call {{.*}} R_{{.*}} __popcountsi2 |
| 477 ; ARM32-LABEL: test_popcount_32 | 473 ; ARM32-LABEL: test_popcount_32 |
| 478 ; ARM32: movw [[CALL:r[0-9]]], {{.+}} __popcountsi2 | 474 ; ARM32: bl {{.*}} __popcountsi2 |
| 479 ; ARM32: movt [[CALL]] | |
| 480 ; ARM32: blx [[CALL]] | |
| 481 | 475 |
| 482 define internal i64 @test_popcount_64(i64 %x) { | 476 define internal i64 @test_popcount_64(i64 %x) { |
| 483 entry: | 477 entry: |
| 484 %r = call i64 @llvm.ctpop.i64(i64 %x) | 478 %r = call i64 @llvm.ctpop.i64(i64 %x) |
| 485 ret i64 %r | 479 ret i64 %r |
| 486 } | 480 } |
| 487 ; CHECK-LABEL: test_popcount_64 | 481 ; CHECK-LABEL: test_popcount_64 |
| 488 ; CHECK: call {{.*}} R_{{.*}} __popcountdi2 | 482 ; CHECK: call {{.*}} R_{{.*}} __popcountdi2 |
| 489 ; __popcountdi2 only returns a 32-bit result, so clear the upper bits of | 483 ; __popcountdi2 only returns a 32-bit result, so clear the upper bits of |
| 490 ; the return value just in case. | 484 ; the return value just in case. |
| 491 ; CHECK: mov {{.*}},0x0 | 485 ; CHECK: mov {{.*}},0x0 |
| 492 ; ARM32-LABEL: test_popcount_64 | 486 ; ARM32-LABEL: test_popcount_64 |
| 493 ; ARM32: movw [[CALL:r[0-9]]], {{.+}} __popcountdi2 | 487 ; ARM32: bl {{.*}} __popcountdi2 |
| 494 ; ARM32: movt [[CALL]] | |
| 495 ; ARM32: blx [[CALL]] | |
| 496 ; ARM32: mov {{.*}}, #0 | 488 ; ARM32: mov {{.*}}, #0 |
| 497 | 489 |
| 498 define internal i32 @test_popcount_64_ret_i32(i64 %x) { | 490 define internal i32 @test_popcount_64_ret_i32(i64 %x) { |
| 499 entry: | 491 entry: |
| 500 %r_i64 = call i64 @llvm.ctpop.i64(i64 %x) | 492 %r_i64 = call i64 @llvm.ctpop.i64(i64 %x) |
| 501 %r = trunc i64 %r_i64 to i32 | 493 %r = trunc i64 %r_i64 to i32 |
| 502 ret i32 %r | 494 ret i32 %r |
| 503 } | 495 } |
| 504 ; If there is a trunc, then the mov {{.*}}, 0 is dead and gets optimized out. | 496 ; If there is a trunc, then the mov {{.*}}, 0 is dead and gets optimized out. |
| 505 ; CHECKO2REM-LABEL: test_popcount_64_ret_i32 | 497 ; CHECKO2REM-LABEL: test_popcount_64_ret_i32 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 ; CHECK: lea {{.*}},[esp+0x10] | 547 ; CHECK: lea {{.*}},[esp+0x10] |
| 556 ; CHECK: lea {{.*}},[esp+0x10] | 548 ; CHECK: lea {{.*}},[esp+0x10] |
| 557 ; CHECK: call | 549 ; CHECK: call |
| 558 ; CHECK: mov esp,{{.*}} | 550 ; CHECK: mov esp,{{.*}} |
| 559 ; CHECK: mov esp,ebp | 551 ; CHECK: mov esp,ebp |
| 560 ; ARM32-LABEL: test_stacksave_multiple | 552 ; ARM32-LABEL: test_stacksave_multiple |
| 561 ; ARM32: mov {{.*}}, sp | 553 ; ARM32: mov {{.*}}, sp |
| 562 ; ARM32: mov {{.*}}, sp | 554 ; ARM32: mov {{.*}}, sp |
| 563 ; ARM32: mov {{.*}}, sp | 555 ; ARM32: mov {{.*}}, sp |
| 564 ; ARM32: mov sp, {{.*}} | 556 ; ARM32: mov sp, {{.*}} |
| OLD | NEW |