mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 19:29:31 +00:00
Add support for 64-bit arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24792 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9a60ff654a
commit
217aabf89e
@ -102,6 +102,18 @@ SparcV8TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) {
|
||||
Arg = DAG.getNode(ISD::TRUNCATE, ObjectVT, Arg);
|
||||
}
|
||||
ArgValues.push_back(Arg);
|
||||
break;
|
||||
}
|
||||
case MVT::i64: {
|
||||
unsigned VRegLo = RegMap->createVirtualRegister(&V8::IntRegsRegClass);
|
||||
MF.addLiveIn(GPR[ArgNo++], VRegLo);
|
||||
unsigned VRegHi = RegMap->createVirtualRegister(&V8::IntRegsRegClass);
|
||||
MF.addLiveIn(GPR[ArgNo++], VRegHi);
|
||||
SDOperand ArgLo = DAG.getCopyFromReg(DAG.getRoot(), VRegLo, MVT::i32);
|
||||
SDOperand ArgHi = DAG.getCopyFromReg(ArgLo.getValue(1), VRegHi, MVT::i32);
|
||||
DAG.setRoot(ArgHi.getValue(1));
|
||||
ArgValues.push_back(DAG.getNode(ISD::BUILD_PAIR, MVT::i64, ArgLo, ArgHi));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -102,6 +102,18 @@ SparcV8TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) {
|
||||
Arg = DAG.getNode(ISD::TRUNCATE, ObjectVT, Arg);
|
||||
}
|
||||
ArgValues.push_back(Arg);
|
||||
break;
|
||||
}
|
||||
case MVT::i64: {
|
||||
unsigned VRegLo = RegMap->createVirtualRegister(&V8::IntRegsRegClass);
|
||||
MF.addLiveIn(GPR[ArgNo++], VRegLo);
|
||||
unsigned VRegHi = RegMap->createVirtualRegister(&V8::IntRegsRegClass);
|
||||
MF.addLiveIn(GPR[ArgNo++], VRegHi);
|
||||
SDOperand ArgLo = DAG.getCopyFromReg(DAG.getRoot(), VRegLo, MVT::i32);
|
||||
SDOperand ArgHi = DAG.getCopyFromReg(ArgLo.getValue(1), VRegHi, MVT::i32);
|
||||
DAG.setRoot(ArgHi.getValue(1));
|
||||
ArgValues.push_back(DAG.getNode(ISD::BUILD_PAIR, MVT::i64, ArgLo, ArgHi));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user