mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-01 01:14:12 +00:00
Fix 'ret long' to return the high and lo parts in the right registers. This
fixes crafty and probably others. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23167 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fe75a2836a
commit
7a49fdcd11
@ -1569,7 +1569,7 @@ SDOperand PPC32DAGToDAGISel::Select(SDOperand Op) {
|
||||
case ISD::RET: {
|
||||
SDOperand Chain = Select(N->getOperand(0)); // Token chain.
|
||||
|
||||
if (N->getNumOperands() > 1) {
|
||||
if (N->getNumOperands() == 2) {
|
||||
SDOperand Val = Select(N->getOperand(1));
|
||||
if (N->getOperand(1).getValueType() == MVT::i32) {
|
||||
Chain = CurDAG->getCopyToReg(Chain, PPC::R3, Val);
|
||||
@ -1577,14 +1577,12 @@ SDOperand PPC32DAGToDAGISel::Select(SDOperand Op) {
|
||||
assert(MVT::isFloatingPoint(N->getOperand(1).getValueType()));
|
||||
Chain = CurDAG->getCopyToReg(Chain, PPC::F1, Val);
|
||||
}
|
||||
|
||||
if (N->getNumOperands() > 2) {
|
||||
assert(N->getOperand(1).getValueType() == MVT::i32 &&
|
||||
N->getOperand(2).getValueType() == MVT::i32 &&
|
||||
N->getNumOperands() == 3 && "Unknown two-register ret value!");
|
||||
Val = Select(N->getOperand(2));
|
||||
Chain = CurDAG->getCopyToReg(Chain, PPC::R4, Val);
|
||||
}
|
||||
} else if (N->getNumOperands() > 1) {
|
||||
assert(N->getOperand(1).getValueType() == MVT::i32 &&
|
||||
N->getOperand(2).getValueType() == MVT::i32 &&
|
||||
N->getNumOperands() == 3 && "Unknown two-register ret value!");
|
||||
Chain = CurDAG->getCopyToReg(Chain, PPC::R4, Select(N->getOperand(1)));
|
||||
Chain = CurDAG->getCopyToReg(Chain, PPC::R3, Select(N->getOperand(2)));
|
||||
}
|
||||
|
||||
// Finally, select this to a blr (return) instruction.
|
||||
|
Loading…
Reference in New Issue
Block a user