mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 00:20:25 +00:00
Add the ability to lower return instructions to TargetLowering. This
allows us to lower legal return types to something else, to meet ABI requirements (such as that i64 be returned in two i32 regs on Darwin/ppc). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23802 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -693,6 +693,19 @@ PPCTargetLowering::LowerCallTo(SDOperand Chain,
|
||||
return std::make_pair(RetVal, Chain);
|
||||
}
|
||||
|
||||
SDOperand PPCTargetLowering::LowerReturnTo(SDOperand Chain, SDOperand Op,
|
||||
SelectionDAG &DAG) {
|
||||
if (Op.getValueType() == MVT::i64) {
|
||||
SDOperand Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, MVT::i32, Op,
|
||||
DAG.getConstant(1, MVT::i32));
|
||||
SDOperand Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, MVT::i32, Op,
|
||||
DAG.getConstant(0, MVT::i32));
|
||||
return DAG.getNode(ISD::RET, MVT::Other, Chain, Lo, Hi);
|
||||
} else {
|
||||
return DAG.getNode(ISD::RET, MVT::Other, Chain, Op);
|
||||
}
|
||||
}
|
||||
|
||||
SDOperand PPCTargetLowering::LowerVAStart(SDOperand Chain, SDOperand VAListP,
|
||||
Value *VAListV, SelectionDAG &DAG) {
|
||||
// vastart just stores the address of the VarArgsFrameIndex slot into the
|
||||
|
||||
Reference in New Issue
Block a user