diff options
| author | Weiming Zhao <weimingz@codeaurora.org> | 2013-06-28 17:26:02 +0000 |
|---|---|---|
| committer | Weiming Zhao <weimingz@codeaurora.org> | 2013-06-28 17:26:02 +0000 |
| commit | a3d87a10246f17ef11749701750a4cac47ebf294 (patch) | |
| tree | fd9c92536298cda8d49154e37ec4071cf85d5014 /llvm/test/CodeGen/ARM | |
| parent | ce2c766f61fb43747106a2dde34b90c1016371d4 (diff) | |
| download | bcm5719-llvm-a3d87a10246f17ef11749701750a4cac47ebf294.tar.gz bcm5719-llvm-a3d87a10246f17ef11749701750a4cac47ebf294.zip | |
Bug 13662: Enable GPRPair for all i64 operands of inline asm on ARM
This patch assigns paired GPRs for inline asm with
64-bit data on ARM. It's enabled for both ARM and Thumb to support modifiers
like %H, %Q, %R.
llvm-svn: 185169
Diffstat (limited to 'llvm/test/CodeGen/ARM')
| -rw-r--r-- | llvm/test/CodeGen/ARM/inlineasm-64bit.ll | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/llvm/test/CodeGen/ARM/inlineasm-64bit.ll b/llvm/test/CodeGen/ARM/inlineasm-64bit.ll index be5eb815731..ade0154dd9d 100644 --- a/llvm/test/CodeGen/ARM/inlineasm-64bit.ll +++ b/llvm/test/CodeGen/ARM/inlineasm-64bit.ll @@ -1,5 +1,5 @@ ; RUN: llc < %s -O3 -mtriple=arm-linux-gnueabi | FileCheck %s - +; RUN: llc -mtriple=thumbv7-none-linux-gnueabi -verify-machineinstrs < %s | FileCheck %s ; check if regs are passing correctly define void @i64_write(i64* %p, i64 %val) nounwind { ; CHECK: i64_write: @@ -45,10 +45,43 @@ entry: ; check if callee-saved registers used by inline asm are saved/restored define void @foo(i64* %p, i64 %i) nounwind { ; CHECK:foo: -; CHECK: push {{{r[4-9]|r10|r11}} +; CHECK: {{push|push.w}} {{{r[4-9]|r10|r11}} ; CHECK: ldrexd [[REG1:(r[0-9]?[02468])]], {{r[0-9]?[13579]}}, [r{{[0-9]+}}] ; CHECK: strexd [[REG1]], {{r[0-9]?[02468]}}, {{r[0-9]?[13579]}} -; CHECK: pop {{{r[4-9]|r10|r11}} +; CHECK: {{pop|pop.w}} {{{r[4-9]|r10|r11}} %1 = tail call { i64, i64 } asm sideeffect "@ atomic64_set\0A1: ldrexd $0, ${0:H}, [$3]\0Aldrexd $1, ${1:H}, [$3]\0A strexd $0, $4, ${4:H}, [$3]\0A teq $0, #0\0A bne 1b", "=&r,=&r,=*Qo,r,r,~{cc}"(i64* %p, i64* %p, i64 %i) nounwind ret void } + +; return *p; +define i64 @ldrd_test(i64* %p) nounwind { +; CHECK: ldrd_test: + %1 = tail call i64 asm "ldrd $0, ${0:H}, [$1]", "=r,r"(i64* %p) nounwind + ret i64 %1 +} + +define i64 @QR_test(i64* %p) nounwind { +; CHECK: QR_test: +; CHECK: ldrd {{r[0-9]?[02468]}}, {{r[0-9]?[13579]}} + %1 = tail call i64 asm "ldrd ${0:Q}, ${0:R}, [$1]", "=r,r"(i64* %p) nounwind + ret i64 %1 +} + +define i64 @defuse_test(i64 %p) nounwind { +; CHECK: defuse_test: +; CHECK: add {{r[0-9]?[02468]}}, {{r[0-9]?[13579]}}, #1 + %1 = tail call i64 asm "add $0, ${0:H}, #1", "=r,0"(i64 %p) nounwind + ret i64 %1 +} + +; *p = (hi << 32) | lo; +define void @strd_test(i64* %p, i32 %lo, i32 %hi) nounwind { +; CHECK: strd_test: +; CHECK: strd {{r[0-9]?[02468]}}, {{r[0-9]?[13579]}} + %1 = zext i32 %hi to i64 + %2 = shl nuw i64 %1, 32 + %3 = sext i32 %lo to i64 + %4 = or i64 %2, %3 + tail call void asm sideeffect "strd $0, ${0:H}, [$1]", "r,r"(i64 %4, i64* %p) nounwind + ret void +} |

