diff options
author | Stepan Dyatkovskiy <stpworld@narod.ru> | 2013-04-22 13:06:52 +0000 |
---|---|---|
committer | Stepan Dyatkovskiy <stpworld@narod.ru> | 2013-04-22 13:06:52 +0000 |
commit | f80f9513ce4b03ed5ff412559b1dff049f8e3ff8 (patch) | |
tree | 0c8ba7304132bd9b8f1ff0de8b638c413f755d42 /llvm/lib/Target/ARM/ARMCallingConv.h | |
parent | f5654986689c857879f9315ab955cda581290374 (diff) | |
download | bcm5719-llvm-f80f9513ce4b03ed5ff412559b1dff049f8e3ff8.tar.gz bcm5719-llvm-f80f9513ce4b03ed5ff412559b1dff049f8e3ff8.zip |
Fix for 5.5 Parameter Passing --> Stage C:
-- C.4 and C.5 statements, when NSAA is not equal to SP.
-- C.1.cp statement for VA functions. Note: There are no VFP CPRCs in a
variadic procedure.
Before this patch "NSAA != 0" means "don't use GPRs anymore ". But there are
some exceptions in AAPCS.
1. For non VA function: allocate all VFP regs for CPRC. When all VFPs are allocated
CPRCs would be sent to stack, while non CPRCs may be still allocated in GRPs.
2. Check that for VA functions all params uses GPRs and then stack.
No exceptions, no CPRCs here.
llvm-svn: 180011
Diffstat (limited to 'llvm/lib/Target/ARM/ARMCallingConv.h')
-rw-r--r-- | llvm/lib/Target/ARM/ARMCallingConv.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMCallingConv.h b/llvm/lib/Target/ARM/ARMCallingConv.h index e6e8c3d5fac..4f94ad2403d 100644 --- a/llvm/lib/Target/ARM/ARMCallingConv.h +++ b/llvm/lib/Target/ARM/ARMCallingConv.h @@ -74,9 +74,15 @@ static bool f64AssignAAPCS(unsigned &ValNo, MVT &ValVT, MVT &LocVT, static const uint16_t HiRegList[] = { ARM::R0, ARM::R2 }; static const uint16_t LoRegList[] = { ARM::R1, ARM::R3 }; static const uint16_t ShadowRegList[] = { ARM::R0, ARM::R1 }; + static const uint16_t GPRArgRegs[] = { ARM::R0, ARM::R1, ARM::R2, ARM::R3 }; unsigned Reg = State.AllocateReg(HiRegList, ShadowRegList, 2); if (Reg == 0) { + + // If we had R3 unallocated only, now we still must to waste it. + Reg = State.AllocateReg(GPRArgRegs, 4); + assert((!Reg || Reg == ARM::R3) && "Wrong GPRs usage for f64"); + // For the 2nd half of a v2f64, do not just fail. if (CanFail) return false; |