Venkatraman Govindaraju | 407e442 | 2014-01-22 01:29:51 +0000 | [diff] [blame^] | 1 | ; RUN: llc -march=sparc <%s | FileCheck %s |
| 2 | |
| 3 | ; CHECK-LABEL: test_constraint_r |
| 4 | ; CHECK: add %o1, %o0, %o0 |
| 5 | define i32 @test_constraint_r(i32 %a, i32 %b) { |
| 6 | entry: |
| 7 | %0 = tail call i32 asm sideeffect "add $2, $1, $0", "=r,r,r"(i32 %a, i32 %b) |
| 8 | ret i32 %0 |
| 9 | } |
| 10 | |
| 11 | ; CHECK-LABEL: test_constraint_I |
| 12 | ; CHECK: add %o0, 1023, %o0 |
| 13 | define i32 @test_constraint_I(i32 %a) { |
| 14 | entry: |
| 15 | %0 = tail call i32 asm sideeffect "add $1, $2, $0", "=r,r,rI"(i32 %a, i32 1023) |
| 16 | ret i32 %0 |
| 17 | } |
| 18 | |
| 19 | ; CHECK-LABEL: test_constraint_I_neg |
| 20 | ; CHECK: add %o0, -4096, %o0 |
| 21 | define i32 @test_constraint_I_neg(i32 %a) { |
| 22 | entry: |
| 23 | %0 = tail call i32 asm sideeffect "add $1, $2, $0", "=r,r,rI"(i32 %a, i32 -4096) |
| 24 | ret i32 %0 |
| 25 | } |
| 26 | |
| 27 | ; CHECK-LABEL: test_constraint_I_largeimm |
| 28 | ; CHECK: sethi 9, [[R0:%[gilo][0-7]]] |
| 29 | ; CHECK: or [[R0]], 784, [[R1:%[gilo][0-7]]] |
| 30 | ; CHECK: add %o0, [[R1]], %o0 |
| 31 | define i32 @test_constraint_I_largeimm(i32 %a) { |
| 32 | entry: |
| 33 | %0 = tail call i32 asm sideeffect "add $1, $2, $0", "=r,r,rI"(i32 %a, i32 10000) |
| 34 | ret i32 %0 |
| 35 | } |