mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-17 06:33:21 +00:00
Remove ISD::RET select code. Now tblgen'd.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24889 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b077b842b6
commit
8263c5e920
@ -409,47 +409,6 @@ SDOperand X86DAGToDAGISel::Select(SDOperand N) {
|
||||
return CodeGenMap[N] = CurDAG->getTargetNode(Opc, VT, Result);
|
||||
break;
|
||||
}
|
||||
|
||||
case ISD::RET: {
|
||||
SDOperand Chain = Node->getOperand(0); // Token chain.
|
||||
unsigned NumOps = Node->getNumOperands();
|
||||
|
||||
// Note: A bit of a hack / optimization... Try to delay chain selection
|
||||
// as much as possible. So it's more likely it has already been selected
|
||||
// for a real use.
|
||||
switch (NumOps) {
|
||||
default:
|
||||
assert(0 && "Unknown return instruction!");
|
||||
case 3:
|
||||
Chain = Select(Chain);
|
||||
assert(0 && "Not yet handled return instruction!");
|
||||
break;
|
||||
case 2: {
|
||||
SDOperand Val = Select(Node->getOperand(1));
|
||||
Chain = Select(Chain);
|
||||
switch (Node->getOperand(1).getValueType()) {
|
||||
default:
|
||||
assert(0 && "All other types should have been promoted!!");
|
||||
case MVT::i32:
|
||||
Chain = CurDAG->getCopyToReg(Chain, X86::EAX, Val);
|
||||
break;
|
||||
case MVT::f32:
|
||||
case MVT::f64:
|
||||
assert(0 && "Not yet handled return instruction!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
case 1:
|
||||
Chain = Select(Chain);
|
||||
break;
|
||||
}
|
||||
if (X86Lowering.getBytesToPopOnReturn() == 0)
|
||||
return CurDAG->SelectNodeTo(Node, X86::RET, MVT::Other, Chain);
|
||||
else
|
||||
return CurDAG->SelectNodeTo(Node, X86::RET, MVT::Other,
|
||||
getI16Imm(X86Lowering.getBytesToPopOnReturn()),
|
||||
Chain);
|
||||
}
|
||||
}
|
||||
|
||||
return SelectCode(N);
|
||||
|
Loading…
x
Reference in New Issue
Block a user