OLD | NEW |
1 ; Simple test of the select instruction. The CHECK lines are only | 1 ; Simple test of the select instruction. The CHECK lines are only |
2 ; checking for basic instruction patterns that should be present | 2 ; checking for basic instruction patterns that should be present |
3 ; regardless of the optimization level, so there are no special OPTM1 | 3 ; regardless of the optimization level, so there are no special OPTM1 |
4 ; match lines. | 4 ; match lines. |
5 | 5 |
6 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ | 6 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ |
7 ; RUN: --target x8632 -i %s --args -O2 -allow-externally-defined-symbols \ | 7 ; RUN: --target x8632 -i %s --args -O2 -allow-externally-defined-symbols \ |
8 ; RUN: | %if --need=target_X8632 --command FileCheck %s | 8 ; RUN: | %if --need=target_X8632 --command FileCheck %s |
9 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ | 9 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ |
10 ; RUN: --target x8632 -i %s --args -Om1 -allow-externally-defined-symbols \ | 10 ; RUN: --target x8632 -i %s --args -Om1 -allow-externally-defined-symbols \ |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 ; CHECK-LABEL: testSelect | 44 ; CHECK-LABEL: testSelect |
45 ; CHECK: cmp | 45 ; CHECK: cmp |
46 ; CHECK: cmp | 46 ; CHECK: cmp |
47 ; CHECK: call {{.*}} R_{{.*}} useInt | 47 ; CHECK: call {{.*}} R_{{.*}} useInt |
48 ; CHECK: cmp | 48 ; CHECK: cmp |
49 ; CHECK: cmp | 49 ; CHECK: cmp |
50 ; CHECK: call {{.*}} R_{{.*}} useInt | 50 ; CHECK: call {{.*}} R_{{.*}} useInt |
51 ; CHECK: ret | 51 ; CHECK: ret |
52 ; ARM32-LABEL: testSelect | 52 ; ARM32-LABEL: testSelect |
53 ; ARM32: cmp | 53 ; ARM32: cmp |
54 ; ARM32: bl {{.*}} useInt | 54 ; ARM32: movw [[CALL:r[0-9]]], {{.+}} useInt |
| 55 ; ARM32: movt [[CALL]] |
| 56 ; ARM32; blx [[CALL]] |
55 ; ARM32-Om1: mov {{.*}}, #20 | 57 ; ARM32-Om1: mov {{.*}}, #20 |
56 ; ARM32-O2: mov [[REG:r[0-9]+]], #20 | 58 ; ARM32-O2: mov [[REG:r[0-9]+]], #20 |
57 ; ARM32: tst | 59 ; ARM32: tst |
58 ; ARM32-Om1: movne {{.*}}, #10 | 60 ; ARM32-Om1: movne {{.*}}, #10 |
59 ; ARM32-O2: movne [[REG]], #10 | 61 ; ARM32-O2: movne [[REG]], #10 |
60 ; ARM32: bl {{.*}} useInt | 62 ; ARM32: movw [[CALL:r[0-9]]], {{.+}} useInt |
61 ; ARM32: bl {{.*}} useInt | 63 ; ARM32: movt [[CALL]] |
62 ; ARM32: bl {{.*}} useInt | 64 ; ARM32; blx [[CALL]] |
| 65 ; ARM32: movw [[CALL:r[0-9]]], {{.+}} useInt |
| 66 ; ARM32: movt [[CALL]] |
| 67 ; ARM32; blx [[CALL]] |
| 68 ; ARM32: movw [[CALL:r[0-9]]], {{.+}} useInt |
| 69 ; ARM32: movt [[CALL]] |
| 70 ; ARM32; blx [[CALL]] |
63 ; ARM32: bx lr | 71 ; ARM32: bx lr |
64 | 72 |
65 ; Check for valid addressing mode in the cmp instruction when the | 73 ; Check for valid addressing mode in the cmp instruction when the |
66 ; operand is an immediate. | 74 ; operand is an immediate. |
67 define internal i32 @testSelectImm32(i32 %a, i32 %b) { | 75 define internal i32 @testSelectImm32(i32 %a, i32 %b) { |
68 entry: | 76 entry: |
69 %cond = select i1 false, i32 %a, i32 %b | 77 %cond = select i1 false, i32 %a, i32 %b |
70 ret i32 %cond | 78 ret i32 %cond |
71 } | 79 } |
72 ; CHECK-LABEL: testSelectImm32 | 80 ; CHECK-LABEL: testSelectImm32 |
73 ; CHECK-NOT: cmp 0x{{[0-9a-f]+}}, | 81 ; CHECK-NOT: cmp 0x{{[0-9a-f]+}}, |
74 ; ARM32-LABEL: testSelectImm32 | 82 ; ARM32-LABEL: testSelectImm32 |
75 ; ARM32-NOT: cmp #{{.*}}, | 83 ; ARM32-NOT: cmp #{{.*}}, |
76 | 84 |
77 ; Check for valid addressing mode in the cmp instruction when the | 85 ; Check for valid addressing mode in the cmp instruction when the |
78 ; operand is an immediate. There is a different x86-32 lowering | 86 ; operand is an immediate. There is a different x86-32 lowering |
79 ; sequence for 64-bit operands. | 87 ; sequence for 64-bit operands. |
80 define internal i64 @testSelectImm64(i64 %a, i64 %b) { | 88 define internal i64 @testSelectImm64(i64 %a, i64 %b) { |
81 entry: | 89 entry: |
82 %cond = select i1 true, i64 %a, i64 %b | 90 %cond = select i1 true, i64 %a, i64 %b |
83 ret i64 %cond | 91 ret i64 %cond |
84 } | 92 } |
85 ; CHECK-LABEL: testSelectImm64 | 93 ; CHECK-LABEL: testSelectImm64 |
86 ; CHECK-NOT: cmp 0x{{[0-9a-f]+}}, | 94 ; CHECK-NOT: cmp 0x{{[0-9a-f]+}}, |
87 ; ARM32-LABEL: testSelectImm64 | 95 ; ARM32-LABEL: testSelectImm64 |
88 ; ARM32-NOT: cmp #{{.*}}, | 96 ; ARM32-NOT: cmp #{{.*}}, |
OLD | NEW |