mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-13 23:18:51 +00:00
Update alpha to reflect recent constantfp legalize changes. It's not clear
why all this code isn't autogenerated. :( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25770 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ac0d723825
commit
08a90229ae
@ -237,23 +237,23 @@ SDOperand AlphaDAGToDAGISel::Select(SDOperand Op) {
|
||||
return CurDAG->SelectNodeTo(N, Alpha::LDQr, MVT::i64, MVT::Other,
|
||||
CPI, Tmp, CurDAG->getEntryNode());
|
||||
}
|
||||
case ISD::ConstantFP:
|
||||
if (ConstantFPSDNode *CN = dyn_cast<ConstantFPSDNode>(N)) {
|
||||
bool isDouble = N->getValueType(0) == MVT::f64;
|
||||
MVT::ValueType T = isDouble ? MVT::f64 : MVT::f32;
|
||||
if (CN->isExactlyValue(+0.0)) {
|
||||
return CurDAG->SelectNodeTo(N, isDouble ? Alpha::CPYST : Alpha::CPYSS,
|
||||
T, CurDAG->getRegister(Alpha::F31, T),
|
||||
CurDAG->getRegister(Alpha::F31, T));
|
||||
} else if ( CN->isExactlyValue(-0.0)) {
|
||||
return CurDAG->SelectNodeTo(N, isDouble ? Alpha::CPYSNT : Alpha::CPYSNS,
|
||||
T, CurDAG->getRegister(Alpha::F31, T),
|
||||
CurDAG->getRegister(Alpha::F31, T));
|
||||
} else {
|
||||
abort();
|
||||
}
|
||||
break;
|
||||
case ISD::TargetConstantFP: {
|
||||
ConstantFPSDNode *CN = cast<ConstantFPSDNode>(N);
|
||||
bool isDouble = N->getValueType(0) == MVT::f64;
|
||||
MVT::ValueType T = isDouble ? MVT::f64 : MVT::f32;
|
||||
if (CN->isExactlyValue(+0.0)) {
|
||||
return CurDAG->SelectNodeTo(N, isDouble ? Alpha::CPYST : Alpha::CPYSS,
|
||||
T, CurDAG->getRegister(Alpha::F31, T),
|
||||
CurDAG->getRegister(Alpha::F31, T));
|
||||
} else if ( CN->isExactlyValue(-0.0)) {
|
||||
return CurDAG->SelectNodeTo(N, isDouble ? Alpha::CPYSNT : Alpha::CPYSNS,
|
||||
T, CurDAG->getRegister(Alpha::F31, T),
|
||||
CurDAG->getRegister(Alpha::F31, T));
|
||||
} else {
|
||||
abort();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case ISD::SETCC:
|
||||
if (MVT::isFloatingPoint(N->getOperand(0).Val->getValueType(0))) {
|
||||
|
@ -145,6 +145,8 @@ AlphaTargetLowering::AlphaTargetLowering(TargetMachine &TM) : TargetLowering(TM)
|
||||
|
||||
setStackPointerRegisterToSaveRestore(Alpha::R30);
|
||||
|
||||
setOperationAction(ISD::ConstantFP, MVT::f64, Expand);
|
||||
setOperationAction(ISD::ConstantFP, MVT::f32, Expand);
|
||||
addLegalFPImmediate(+0.0); //F31
|
||||
addLegalFPImmediate(-0.0); //-F31
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user