From 3cf889f75ef6e4ae454ddb72fdf7bdeb89193f0a Mon Sep 17 00:00:00 2001 From: Dale Johannesen Date: Fri, 31 Aug 2007 04:03:46 +0000 Subject: Enhance APFloat to retain bits of NaNs (fixes oggenc). Use APFloat interfaces for more references, mostly of ConstantFPSDNode. llvm-svn: 41632 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'llvm/lib/Target/PowerPC/PPCISelLowering.cpp') diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp index f2de2a30382..0528eaf80a3 100644 --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -362,12 +362,12 @@ const char *PPCTargetLowering::getTargetNodeName(unsigned Opcode) const { /// isFloatingPointZero - Return true if this is 0.0 or -0.0. static bool isFloatingPointZero(SDOperand Op) { if (ConstantFPSDNode *CFP = dyn_cast(Op)) - return CFP->isExactlyValue(-0.0) || CFP->isExactlyValue(0.0); + return CFP->getValueAPF().isZero(); else if (ISD::isEXTLoad(Op.Val) || ISD::isNON_EXTLoad(Op.Val)) { // Maybe this has already been legalized into the constant pool? if (ConstantPoolSDNode *CP = dyn_cast(Op.getOperand(1))) if (ConstantFP *CFP = dyn_cast(CP->getConstVal())) - return CFP->isExactlyValue(-0.0) || CFP->isExactlyValue(0.0); + return CFP->getValueAPF().isZero(); } return false; } @@ -530,7 +530,7 @@ bool PPC::isAllNegativeZeroVector(SDNode *N) { assert(N->getOpcode() == ISD::BUILD_VECTOR); if (PPC::isSplatShuffleMask(N, N->getNumOperands())) if (ConstantFPSDNode *CFP = dyn_cast(N)) - return CFP->isExactlyValue(-0.0); + return CFP->getValueAPF().isNegZero(); return false; } @@ -622,7 +622,7 @@ SDOperand PPC::get_VSPLTI_elt(SDNode *N, unsigned ByteSize, SelectionDAG &DAG) { ValSizeInBytes = MVT::getSizeInBits(CN->getValueType(0))/8; } else if (ConstantFPSDNode *CN = dyn_cast(OpVal)) { assert(CN->getValueType(0) == MVT::f32 && "Only one legal FP vector type!"); - Value = FloatToBits(CN->getValue()); + Value = FloatToBits(CN->getValueAPF().convertToFloat()); ValSizeInBytes = 4; } @@ -2194,7 +2194,7 @@ static bool GetConstantBuildVectorBits(SDNode *BV, uint64_t VectorBits[2], } else if (ConstantFPSDNode *CN = dyn_cast(OpVal)) { assert(CN->getValueType(0) == MVT::f32 && "Only one legal FP vector type!"); - EltBits = FloatToBits(CN->getValue()); + EltBits = FloatToBits(CN->getValueAPF().convertToFloat()); } else { // Nonconstant element. return true; -- cgit v1.2.3