2013-04-21 11:57:07 +00:00
|
|
|
; RUN: llc -mtriple=armv7-none-linux-gnueabi -verify-machineinstrs < %s | FileCheck %s --check-prefix=CHECK-WITH-LDRD
|
|
|
|
; RUN: llc -mtriple=armv4-none-linux-gnueabi -verify-machineinstrs < %s | FileCheck %s --check-prefix=CHECK-WITHOUT-LDRD
|
|
|
|
; RUN: llc -mtriple=thumbv7-none-linux-gnueabi -verify-machineinstrs < %s | FileCheck %s --check-prefix=CHECK-WITH-LDRD
|
2013-04-20 19:31:00 +00:00
|
|
|
|
|
|
|
define void @foo(i64* %addr) {
|
2013-04-21 11:57:07 +00:00
|
|
|
%val1 = tail call i64 asm sideeffect "ldrexd $0, ${0:H}, [r0]", "=&r,r"(i64* %addr)
|
|
|
|
%val2 = tail call i64 asm sideeffect "ldrexd $0, ${0:H}, [r0]", "=&r,r"(i64* %addr)
|
|
|
|
%val3 = tail call i64 asm sideeffect "ldrexd $0, ${0:H}, [r0]", "=&r,r"(i64* %addr)
|
|
|
|
%val4 = tail call i64 asm sideeffect "ldrexd $0, ${0:H}, [r0]", "=&r,r"(i64* %addr)
|
|
|
|
%val5 = tail call i64 asm sideeffect "ldrexd $0, ${0:H}, [r0]", "=&r,r"(i64* %addr)
|
|
|
|
%val6 = tail call i64 asm sideeffect "ldrexd $0, ${0:H}, [r0]", "=&r,r"(i64* %addr)
|
|
|
|
%val7 = tail call i64 asm sideeffect "ldrexd $0, ${0:H}, [r0]", "=&r,r"(i64* %addr)
|
2013-04-20 19:31:00 +00:00
|
|
|
|
|
|
|
; Key point is that enough 64-bit paired GPR values are live that
|
|
|
|
; one of them has to be spilled. This used to cause an abort because
|
|
|
|
; an LDMIA was created with both a FrameIndex and an offset, which
|
|
|
|
; is not allowed.
|
|
|
|
|
2013-04-21 11:57:07 +00:00
|
|
|
; CHECK-WITH-LDRD: strd {{r[0-9]+}}, {{r[0-9]+}}, [sp, #8]
|
|
|
|
; CHECK-WITH-LDRD: strd {{r[0-9]+}}, {{r[0-9]+}}, [sp]
|
|
|
|
|
|
|
|
; CHECK-WITH-LDRD: ldrd {{r[0-9]+}}, {{r[0-9]+}}, [sp, #8]
|
|
|
|
; CHECK-WITH-LDRD: ldrd {{r[0-9]+}}, {{r[0-9]+}}, [sp]
|
|
|
|
|
2013-04-20 19:31:00 +00:00
|
|
|
; We also want to ensure the register scavenger is working (i.e. an
|
|
|
|
; offset from sp can be generated), so we need two spills.
|
2013-04-21 11:57:07 +00:00
|
|
|
; CHECK-WITHOUT-LDRD: add [[ADDRREG:[a-z0-9]+]], sp, #{{[0-9]+}}
|
|
|
|
; CHECK-WITHOUT-LDRD: stm [[ADDRREG]], {r{{[0-9]+}}, r{{[0-9]+}}}
|
|
|
|
; CHECK-WITHOUT-LDRD: stm sp, {r{{[0-9]+}}, r{{[0-9]+}}}
|
2013-04-20 19:31:00 +00:00
|
|
|
|
|
|
|
; In principle LLVM may have to recalculate the offset. At the moment
|
|
|
|
; it reuses the original though.
|
2013-04-21 11:57:07 +00:00
|
|
|
; CHECK-WITHOUT-LDRD: ldm [[ADDRREG]], {r{{[0-9]+}}, r{{[0-9]+}}}
|
|
|
|
; CHECK-WITHOUT-LDRD: ldm sp, {r{{[0-9]+}}, r{{[0-9]+}}}
|
|
|
|
|
2013-04-20 19:31:00 +00:00
|
|
|
store volatile i64 %val1, i64* %addr
|
|
|
|
store volatile i64 %val2, i64* %addr
|
|
|
|
store volatile i64 %val3, i64* %addr
|
|
|
|
store volatile i64 %val4, i64* %addr
|
|
|
|
store volatile i64 %val5, i64* %addr
|
|
|
|
store volatile i64 %val6, i64* %addr
|
|
|
|
store volatile i64 %val7, i64* %addr
|
|
|
|
ret void
|
|
|
|
}
|