diff options
author | Christian Pirker <cpirker@a-bix.com> | 2014-03-26 14:51:22 +0000 |
---|---|---|
committer | Christian Pirker <cpirker@a-bix.com> | 2014-03-26 14:51:22 +0000 |
commit | 94708f1784b3a8c85433ac405dd63709b2c419d3 (patch) | |
tree | 891f4cd0ab7943e0c443daad0677c48ca99b2543 /lib/Target/AArch64 | |
parent | fc4fa22846593a4129496a2db6a9ad1926a472f3 (diff) | |
download | llvm-94708f1784b3a8c85433ac405dd63709b2c419d3.tar.gz llvm-94708f1784b3a8c85433ac405dd63709b2c419d3.tar.bz2 llvm-94708f1784b3a8c85433ac405dd63709b2c419d3.tar.xz |
AArch64_BE function argument passing for ARM ABI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204814 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/AArch64')
-rw-r--r-- | lib/Target/AArch64/AArch64ISelLowering.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/Target/AArch64/AArch64ISelLowering.cpp b/lib/Target/AArch64/AArch64ISelLowering.cpp index cf2e46dbe3..86fa341bc2 100644 --- a/lib/Target/AArch64/AArch64ISelLowering.cpp +++ b/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -1324,8 +1324,11 @@ AArch64TargetLowering::LowerFormalArguments(SDValue Chain, int Size = Flags.getByValSize(); unsigned NumRegs = (Size + 7) / 8; + uint32_t BEAlign = 0; + if (Size < 8 && !getSubtarget()->isLittle()) + BEAlign = 8-Size; unsigned FrameIdx = MFI->CreateFixedObject(8 * NumRegs, - VA.getLocMemOffset(), + VA.getLocMemOffset() + BEAlign, false); SDValue FrameIdxN = DAG.getFrameIndex(FrameIdx, PtrTy); InVals.push_back(FrameIdxN); @@ -1634,7 +1637,13 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI, // loaded before this eventual operation. Otherwise they'll be clobbered. Chain = addTokenForArgument(Chain, DAG, MF.getFrameInfo(), FI); } else { - SDValue PtrOff = DAG.getIntPtrConstant(VA.getLocMemOffset()); + uint32_t OpSize = Flags.isByVal() ? Flags.getByValSize()*8 : + VA.getLocVT().getSizeInBits(); + OpSize = (OpSize + 7) / 8; + uint32_t BEAlign = 0; + if (OpSize < 8 && !getSubtarget()->isLittle()) + BEAlign = 8-OpSize; + SDValue PtrOff = DAG.getIntPtrConstant(VA.getLocMemOffset() + BEAlign); DstAddr = DAG.getNode(ISD::ADD, dl, getPointerTy(), StackPtr, PtrOff); DstInfo = MachinePointerInfo::getStack(VA.getLocMemOffset()); |