- switch (Opcode) {
- case ISD::FNEG:
- V.changeSign();
- return getConstantFP(V, VT);
- case ISD::FABS:
- V.clearSign();
- return getConstantFP(V, VT);
- case ISD::FP_ROUND:
- case ISD::FP_EXTEND:
- // This can return overflow, underflow, or inexact; we don't care.
- // FIXME need to be more flexible about rounding mode.
- (void) V.convert(VT==MVT::f32 ? APFloat::IEEEsingle :
- VT==MVT::f64 ? APFloat::IEEEdouble :
- VT==MVT::f80 ? APFloat::x87DoubleExtended :
- VT==MVT::f128 ? APFloat::IEEEquad :
- APFloat::Bogus,
- APFloat::rmNearestTiesToEven);
- return getConstantFP(V, VT);
- case ISD::FP_TO_SINT:
- case ISD::FP_TO_UINT: {
- integerPart x;
- assert(integerPartWidth >= 64);
- // FIXME need to be more flexible about rounding mode.
- APFloat::opStatus s = V.convertToInteger(&x, 64U,
- Opcode==ISD::FP_TO_SINT,
- APFloat::rmTowardZero);
- if (s==APFloat::opInvalidOp) // inexact is OK, in fact usual
+ if (VT!=MVT::ppcf128 && Operand.getValueType()!=MVT::ppcf128) {
+ switch (Opcode) {
+ case ISD::FNEG:
+ V.changeSign();
+ return getConstantFP(V, VT);
+ case ISD::FABS:
+ V.clearSign();
+ return getConstantFP(V, VT);
+ case ISD::FP_ROUND:
+ case ISD::FP_EXTEND:
+ // This can return overflow, underflow, or inexact; we don't care.
+ // FIXME need to be more flexible about rounding mode.
+ (void) V.convert(VT==MVT::f32 ? APFloat::IEEEsingle :
+ VT==MVT::f64 ? APFloat::IEEEdouble :
+ VT==MVT::f80 ? APFloat::x87DoubleExtended :
+ VT==MVT::f128 ? APFloat::IEEEquad :
+ APFloat::Bogus,
+ APFloat::rmNearestTiesToEven);
+ return getConstantFP(V, VT);
+ case ISD::FP_TO_SINT:
+ case ISD::FP_TO_UINT: {
+ integerPart x;
+ assert(integerPartWidth >= 64);
+ // FIXME need to be more flexible about rounding mode.
+ APFloat::opStatus s = V.convertToInteger(&x, 64U,
+ Opcode==ISD::FP_TO_SINT,
+ APFloat::rmTowardZero);
+ if (s==APFloat::opInvalidOp) // inexact is OK, in fact usual
+ break;
+ return getConstant(x, VT);
+ }
+ case ISD::BIT_CONVERT:
+ if (VT == MVT::i32 && C->getValueType(0) == MVT::f32)
+ return getConstant((uint32_t)V.convertToAPInt().getZExtValue(), VT);
+ else if (VT == MVT::i64 && C->getValueType(0) == MVT::f64)
+ return getConstant(V.convertToAPInt().getZExtValue(), VT);