OLD | NEW |
1 ; Tests various aspects of x86 immediate encoding. Some encodings are shorter. | 1 ; Tests various aspects of x86 immediate encoding. Some encodings are shorter. |
2 ; For example, the encoding is shorter for 8-bit immediates or when using EAX. | 2 ; For example, the encoding is shorter for 8-bit immediates or when using EAX. |
3 ; This assumes that EAX is chosen as the first free register in O2 mode. | 3 ; This assumes that EAX is chosen as the first free register in O2 mode. |
4 | 4 |
5 ; RUN: %p2i -i %s --args -O2 --verbose none \ | 5 ; RUN: %p2i -i %s --args -O2 --verbose none \ |
6 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \ | 6 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \ |
7 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s | 7 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s |
8 ; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s | |
9 ; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s | |
10 | 8 |
11 define internal i32 @testXor8Imm8(i32 %arg) { | 9 define internal i32 @testXor8Imm8(i32 %arg) { |
12 entry: | 10 entry: |
13 %arg_i8 = trunc i32 %arg to i8 | 11 %arg_i8 = trunc i32 %arg to i8 |
14 %result_i8 = xor i8 %arg_i8, 127 | 12 %result_i8 = xor i8 %arg_i8, 127 |
15 %result = zext i8 %result_i8 to i32 | 13 %result = zext i8 %result_i8 to i32 |
16 ret i32 %result | 14 ret i32 %result |
17 } | 15 } |
18 ; CHECK-LABEL: testXor8Imm8 | 16 ; CHECK-LABEL: testXor8Imm8 |
19 ; CHECK: 34 7f xor al, 127 | 17 ; CHECK: 34 7f xor al, 127 |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 %r4 = call i64 @llvm.ctlz.i64(i64 %w, i1 false) | 301 %r4 = call i64 @llvm.ctlz.i64(i64 %w, i1 false) |
304 %res1 = add i64 %r, %r2 | 302 %res1 = add i64 %r, %r2 |
305 %res2 = add i64 %r3, %r4 | 303 %res2 = add i64 %r3, %r4 |
306 %res = add i64 %res1, %res2 | 304 %res = add i64 %res1, %res2 |
307 ret i64 %res | 305 ret i64 %res |
308 } | 306 } |
309 ; CHECK-LABEL: test_via_ctlz_64 | 307 ; CHECK-LABEL: test_via_ctlz_64 |
310 ; CHECK-DAG: 85 c0 test eax, eax | 308 ; CHECK-DAG: 85 c0 test eax, eax |
311 ; CHECK-DAG: 85 db test ebx, ebx | 309 ; CHECK-DAG: 85 db test ebx, ebx |
312 ; CHECK-DAG: 85 f6 test esi, esi | 310 ; CHECK-DAG: 85 f6 test esi, esi |
313 | |
314 ; ERRORS-NOT: ICE translation error | |
315 ; DUMP-NOT: SZ | |
OLD | NEW |