mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-04 01:51:31 +00:00
Change LowerFP_TO_SINT to create the specific code it needs instead of
unconditionally creating an i64 bitcast. With the future legalizer design, operation legalization can't introduce new nodes with illegal types. This fixes the rest of olden on ppc32. llvm-svn: 43005
This commit is contained in:
parent
f5bcd3d737
commit
c641c8c6ec
@ -2028,7 +2028,7 @@ static SDOperand LowerSELECT_CC(SDOperand Op, SelectionDAG &DAG) {
|
||||
DAG.getNode(ISD::FNEG, MVT::f64, LHS), TV, FV);
|
||||
}
|
||||
|
||||
SDOperand Cmp;
|
||||
SDOperand Cmp;
|
||||
switch (CC) {
|
||||
default: break; // SETUO etc aren't handled by fsel.
|
||||
case ISD::SETULT:
|
||||
@ -2081,10 +2081,17 @@ static SDOperand LowerFP_TO_SINT(SDOperand Op, SelectionDAG &DAG) {
|
||||
}
|
||||
|
||||
// Convert the FP value to an int value through memory.
|
||||
SDOperand Bits = DAG.getNode(ISD::BIT_CONVERT, MVT::i64, Tmp);
|
||||
SDOperand FIPtr = DAG.CreateStackTemporary(MVT::f64);
|
||||
|
||||
// Emit a store to the stack slot.
|
||||
SDOperand Chain = DAG.getStore(DAG.getEntryNode(), Tmp, FIPtr, NULL, 0);
|
||||
|
||||
// Result is a load from the stack slot. If loading 4 bytes, make sure to
|
||||
// add in a bias.
|
||||
if (Op.getValueType() == MVT::i32)
|
||||
Bits = DAG.getNode(ISD::TRUNCATE, MVT::i32, Bits);
|
||||
return Bits;
|
||||
FIPtr = DAG.getNode(ISD::ADD, FIPtr.getValueType(), FIPtr,
|
||||
DAG.getConstant(4, FIPtr.getValueType()));
|
||||
return DAG.getLoad(Op.getValueType(), Chain, FIPtr, NULL, 0);
|
||||
}
|
||||
|
||||
static SDOperand LowerFP_ROUND_INREG(SDOperand Op, SelectionDAG &DAG) {
|
||||
|
Loading…
Reference in New Issue
Block a user