mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-05 06:41:51 +00:00
more complete Lowering for vacopy and vaarg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22274 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
213e557cef
commit
cdf233d55d
@ -159,6 +159,10 @@ namespace {
|
|||||||
LowerVAArgNext(SDOperand Chain, SDOperand VAList,
|
LowerVAArgNext(SDOperand Chain, SDOperand VAList,
|
||||||
const Type *ArgTy, SelectionDAG &DAG);
|
const Type *ArgTy, SelectionDAG &DAG);
|
||||||
|
|
||||||
|
std::pair<SDOperand,SDOperand>
|
||||||
|
LowerVACopy(SDOperand Chain, SDOperand Src, SDOperand Dest,
|
||||||
|
SelectionDAG &DAG);
|
||||||
|
|
||||||
virtual std::pair<SDOperand, SDOperand>
|
virtual std::pair<SDOperand, SDOperand>
|
||||||
LowerFrameReturnAddress(bool isFrameAddr, SDOperand Chain, unsigned Depth,
|
LowerFrameReturnAddress(bool isFrameAddr, SDOperand Chain, unsigned Depth,
|
||||||
SelectionDAG &DAG);
|
SelectionDAG &DAG);
|
||||||
@ -418,7 +422,17 @@ LowerVAArgNext(SDOperand Chain, SDOperand VAList,
|
|||||||
DAG.getConstant(8, MVT::i64));
|
DAG.getConstant(8, MVT::i64));
|
||||||
SDOperand Offset = DAG.getLoad(MVT::i64, Chain, Tmp, DAG.getSrcValue(NULL));
|
SDOperand Offset = DAG.getLoad(MVT::i64, Chain, Tmp, DAG.getSrcValue(NULL));
|
||||||
SDOperand DataPtr = DAG.getNode(ISD::ADD, MVT::i64, Base, Offset);
|
SDOperand DataPtr = DAG.getNode(ISD::ADD, MVT::i64, Base, Offset);
|
||||||
SDOperand Result = DAG.getLoad(MVT::i64, Chain, DataPtr,
|
if (ArgTy->isFloatingPoint())
|
||||||
|
{
|
||||||
|
//if fp && Offset < 6*8, then subtract 6*8 from DataPtr
|
||||||
|
SDOperand FPDataPtr = DAG.getNode(ISD::SUB, MVT::i64, DataPtr,
|
||||||
|
DAG.getConstant(8*6, MVT::i64));
|
||||||
|
SDOperand CC = DAG.getSetCC(ISD::SETLT, MVT::i64,
|
||||||
|
Offset, DAG.getConstant(8*6, MVT::i64));
|
||||||
|
DataPtr = DAG.getNode(ISD::SELECT, MVT::i64, CC, FPDataPtr, DataPtr);
|
||||||
|
}
|
||||||
|
|
||||||
|
SDOperand Result = DAG.getLoad(getValueType(ArgTy), Chain, DataPtr,
|
||||||
DAG.getSrcValue(NULL));
|
DAG.getSrcValue(NULL));
|
||||||
SDOperand NewOffset = DAG.getNode(ISD::ADD, MVT::i64, Offset,
|
SDOperand NewOffset = DAG.getNode(ISD::ADD, MVT::i64, Offset,
|
||||||
DAG.getConstant(8, MVT::i64));
|
DAG.getConstant(8, MVT::i64));
|
||||||
@ -427,6 +441,20 @@ LowerVAArgNext(SDOperand Chain, SDOperand VAList,
|
|||||||
return std::make_pair(Result, Update);
|
return std::make_pair(Result, Update);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::pair<SDOperand,SDOperand> AlphaTargetLowering::
|
||||||
|
LowerVACopy(SDOperand Chain, SDOperand Src, SDOperand Dest,
|
||||||
|
SelectionDAG &DAG) {
|
||||||
|
//Default to returning the input list
|
||||||
|
SDOperand Val = DAG.getLoad(getPointerTy(), Chain, Src, DAG.getSrcValue(NULL));
|
||||||
|
SDOperand Result = DAG.getNode(ISD::STORE, MVT::Other, Val.getValue(1),
|
||||||
|
Val, Dest, DAG.getSrcValue(NULL));
|
||||||
|
SDOperand NP = DAG.getNode(ISD::ADD, MVT::i64, Src,
|
||||||
|
DAG.getConstant(8, MVT::i64));
|
||||||
|
Val = DAG.getLoad(MVT::i32, Chain, NP, DAG.getSrcValue(NULL));
|
||||||
|
Result = DAG.getNode(ISD::STORE, MVT::Other, Val.getValue(1),
|
||||||
|
Val, Dest, DAG.getSrcValue(NULL));
|
||||||
|
return std::make_pair(Result, Result);
|
||||||
|
}
|
||||||
|
|
||||||
std::pair<SDOperand, SDOperand> AlphaTargetLowering::
|
std::pair<SDOperand, SDOperand> AlphaTargetLowering::
|
||||||
LowerFrameReturnAddress(bool isFrameAddress, SDOperand Chain, unsigned Depth,
|
LowerFrameReturnAddress(bool isFrameAddress, SDOperand Chain, unsigned Depth,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user