| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 ; ARM32: tst | 71 ; ARM32: tst |
| 72 ; ARM32-Om1: movne {{.*}}, #10 | 72 ; ARM32-Om1: movne {{.*}}, #10 |
| 73 ; ARM32-O2: movne [[REG]], #10 | 73 ; ARM32-O2: movne [[REG]], #10 |
| 74 ; ARM32: bl {{.*}} useInt | 74 ; ARM32: bl {{.*}} useInt |
| 75 ; ARM32: bl {{.*}} useInt | 75 ; ARM32: bl {{.*}} useInt |
| 76 ; ARM32: bl {{.*}} useInt | 76 ; ARM32: bl {{.*}} useInt |
| 77 ; ARM32: bx lr | 77 ; ARM32: bx lr |
| 78 ; MIPS32-LABEL: testSelect | 78 ; MIPS32-LABEL: testSelect |
| 79 ; MIPS32: slt {{.*}} | 79 ; MIPS32: slt {{.*}} |
| 80 ; MIPS32: movn {{.*}} | 80 ; MIPS32: movn {{.*}} |
| 81 ; MIPS32: move {{.*}} | |
| 82 | 81 |
| 83 ; Check for valid addressing mode in the cmp instruction when the | 82 ; Check for valid addressing mode in the cmp instruction when the |
| 84 ; operand is an immediate. | 83 ; operand is an immediate. |
| 85 define internal i32 @testSelectImm32(i32 %a, i32 %b) { | 84 define internal i32 @testSelectImm32(i32 %a, i32 %b) { |
| 86 entry: | 85 entry: |
| 87 %cond = select i1 false, i32 %a, i32 %b | 86 %cond = select i1 false, i32 %a, i32 %b |
| 88 ret i32 %cond | 87 ret i32 %cond |
| 89 } | 88 } |
| 90 ; CHECK-LABEL: testSelectImm32 | 89 ; CHECK-LABEL: testSelectImm32 |
| 91 ; CHECK-NOT: cmp 0x{{[0-9a-f]+}}, | 90 ; CHECK-NOT: cmp 0x{{[0-9a-f]+}}, |
| 92 ; ARM32-LABEL: testSelectImm32 | 91 ; ARM32-LABEL: testSelectImm32 |
| 93 ; ARM32-NOT: cmp #{{.*}}, | 92 ; ARM32-NOT: cmp #{{.*}}, |
| 94 ; MIPS32-LABEL: testSelectImm32 | 93 ; MIPS32-LABEL: testSelectImm32 |
| 95 ; MIPS32: movn {{.*}} | 94 ; MIPS32: movn {{.*}} |
| 96 ; MIPS32: move {{.*}} | |
| 97 | 95 |
| 98 ; Check for valid addressing mode in the cmp instruction when the | 96 ; Check for valid addressing mode in the cmp instruction when the |
| 99 ; operand is an immediate. There is a different x86-32 lowering | 97 ; operand is an immediate. There is a different x86-32 lowering |
| 100 ; sequence for 64-bit operands. | 98 ; sequence for 64-bit operands. |
| 101 define internal i64 @testSelectImm64(i64 %a, i64 %b) { | 99 define internal i64 @testSelectImm64(i64 %a, i64 %b) { |
| 102 entry: | 100 entry: |
| 103 %cond = select i1 true, i64 %a, i64 %b | 101 %cond = select i1 true, i64 %a, i64 %b |
| 104 ret i64 %cond | 102 ret i64 %cond |
| 105 } | 103 } |
| 106 ; CHECK-LABEL: testSelectImm64 | 104 ; CHECK-LABEL: testSelectImm64 |
| 107 ; CHECK-NOT: cmp 0x{{[0-9a-f]+}}, | 105 ; CHECK-NOT: cmp 0x{{[0-9a-f]+}}, |
| 108 ; ARM32-LABEL: testSelectImm64 | 106 ; ARM32-LABEL: testSelectImm64 |
| 109 ; ARM32-NOT: cmp #{{.*}}, | 107 ; ARM32-NOT: cmp #{{.*}}, |
| 110 ; MIPS32-LABEL: testSelectImm64 | 108 ; MIPS32-LABEL: testSelectImm64 |
| 109 ; MIPS32: movn |
| 110 ; MIPS32: movn |
| OLD | NEW |