make it clearer what the function does. No functional
change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57325
91177308-0d34-0410-b5e6-
96231b3b80d8
15 files changed:
static const fltSemantics IEEEquad;
static const fltSemantics PPCDoubleDouble;
static const fltSemantics x87DoubleExtended;
static const fltSemantics IEEEquad;
static const fltSemantics PPCDoubleDouble;
static const fltSemantics x87DoubleExtended;
- /* And this psuedo, used to construct APFloats that cannot
+ /* And this pseudo, used to construct APFloats that cannot
conflict with anything real. */
static const fltSemantics Bogus;
conflict with anything real. */
static const fltSemantics Bogus;
opStatus convertFromZeroExtendedInteger(const integerPart *, unsigned int,
bool, roundingMode);
opStatus convertFromString(const char *, roundingMode);
opStatus convertFromZeroExtendedInteger(const integerPart *, unsigned int,
bool, roundingMode);
opStatus convertFromString(const char *, roundingMode);
- APInt convertToAPInt() const;
+ APInt bitcastToAPInt() const;
double convertToDouble() const;
float convertToFloat() const;
double convertToDouble() const;
float convertToFloat() const;
compare unordered, 0==-0). */
cmpResult compare(const APFloat &) const;
compare unordered, 0==-0). */
cmpResult compare(const APFloat &) const;
+ /* Bitwise comparison for equality (QNaNs compare equal, 0!=-0). */
+ bool bitwiseIsEqual(const APFloat &) const;
+
/* Write out a hexadecimal representation of the floating point
value to DST, which must be of sufficient size, in the C99 form
[-]0xh.hhhhp[+-]d. Return the number of characters written,
/* Write out a hexadecimal representation of the floating point
value to DST, which must be of sufficient size, in the C99 form
[-]0xh.hhhhp[+-]d. Return the number of characters written,
unsigned int convertToHexString(char *dst, unsigned int hexDigits,
bool upperCase, roundingMode) const;
unsigned int convertToHexString(char *dst, unsigned int hexDigits,
bool upperCase, roundingMode) const;
- /* Bitwise comparison for equality (QNaNs compare equal, 0!=-0). */
- bool bitwiseIsEqual(const APFloat &) const;
-
/* Simple queries. */
fltCategory getCategory() const { return category; }
const fltSemantics &getSemantics() const { return *semantics; }
/* Simple queries. */
fltCategory getCategory() const { return category; }
const fltSemantics &getSemantics() const { return *semantics; }
Code = bitc::CST_CODE_FLOAT;
const Type *Ty = CFP->getType();
if (Ty == Type::FloatTy || Ty == Type::DoubleTy) {
Code = bitc::CST_CODE_FLOAT;
const Type *Ty = CFP->getType();
if (Ty == Type::FloatTy || Ty == Type::DoubleTy) {
- Record.push_back(CFP->getValueAPF().convertToAPInt().getZExtValue());
+ Record.push_back(CFP->getValueAPF().bitcastToAPInt().getZExtValue());
} else if (Ty == Type::X86_FP80Ty) {
// api needed to prevent premature destruction
} else if (Ty == Type::X86_FP80Ty) {
// api needed to prevent premature destruction
- APInt api = CFP->getValueAPF().convertToAPInt();
+ APInt api = CFP->getValueAPF().bitcastToAPInt();
const uint64_t *p = api.getRawData();
Record.push_back(p[0]);
Record.push_back((uint16_t)p[1]);
} else if (Ty == Type::FP128Ty || Ty == Type::PPC_FP128Ty) {
const uint64_t *p = api.getRawData();
Record.push_back(p[0]);
Record.push_back((uint16_t)p[1]);
} else if (Ty == Type::FP128Ty || Ty == Type::PPC_FP128Ty) {
- APInt api = CFP->getValueAPF().convertToAPInt();
+ APInt api = CFP->getValueAPF().bitcastToAPInt();
const uint64_t *p = api.getRawData();
Record.push_back(p[0]);
Record.push_back(p[1]);
const uint64_t *p = api.getRawData();
Record.push_back(p[0]);
Record.push_back(p[1]);
using namespace llvm;
void APFloat::Emit(Serializer& S) const {
using namespace llvm;
void APFloat::Emit(Serializer& S) const {
- S.Emit(convertToAPInt());
+ S.Emit(bitcastToAPInt());
// precision...
if (CFP->getType() == Type::DoubleTy) {
double Val = CFP->getValueAPF().convertToDouble(); // for comment only
// precision...
if (CFP->getType() == Type::DoubleTy) {
double Val = CFP->getValueAPF().convertToDouble(); // for comment only
- uint64_t i = CFP->getValueAPF().convertToAPInt().getZExtValue();
+ uint64_t i = CFP->getValueAPF().bitcastToAPInt().getZExtValue();
if (TAI->getData64bitsDirective())
O << TAI->getData64bitsDirective() << i << '\t'
<< TAI->getCommentString() << " double value: " << Val << '\n';
if (TAI->getData64bitsDirective())
O << TAI->getData64bitsDirective() << i << '\t'
<< TAI->getCommentString() << " double value: " << Val << '\n';
} else if (CFP->getType() == Type::FloatTy) {
float Val = CFP->getValueAPF().convertToFloat(); // for comment only
O << TAI->getData32bitsDirective()
} else if (CFP->getType() == Type::FloatTy) {
float Val = CFP->getValueAPF().convertToFloat(); // for comment only
O << TAI->getData32bitsDirective()
- << CFP->getValueAPF().convertToAPInt().getZExtValue()
+ << CFP->getValueAPF().bitcastToAPInt().getZExtValue()
<< '\t' << TAI->getCommentString() << " float " << Val << '\n';
return;
} else if (CFP->getType() == Type::X86_FP80Ty) {
// all long double variants are printed as hex
// api needed to prevent premature destruction
<< '\t' << TAI->getCommentString() << " float " << Val << '\n';
return;
} else if (CFP->getType() == Type::X86_FP80Ty) {
// all long double variants are printed as hex
// api needed to prevent premature destruction
- APInt api = CFP->getValueAPF().convertToAPInt();
+ APInt api = CFP->getValueAPF().bitcastToAPInt();
const uint64_t *p = api.getRawData();
APFloat DoubleVal = CFP->getValueAPF();
DoubleVal.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven);
const uint64_t *p = api.getRawData();
APFloat DoubleVal = CFP->getValueAPF();
DoubleVal.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven);
} else if (CFP->getType() == Type::PPC_FP128Ty) {
// all long double variants are printed as hex
// api needed to prevent premature destruction
} else if (CFP->getType() == Type::PPC_FP128Ty) {
// all long double variants are printed as hex
// api needed to prevent premature destruction
- APInt api = CFP->getValueAPF().convertToAPInt();
+ APInt api = CFP->getValueAPF().bitcastToAPInt();
const uint64_t *p = api.getRawData();
if (TD->isBigEndian()) {
O << TAI->getData32bitsDirective() << uint32_t(p[0] >> 32)
const uint64_t *p = api.getRawData();
if (TD->isBigEndian()) {
O << TAI->getData32bitsDirective() << uint32_t(p[0] >> 32)
break;
}
case Type::FloatTyID: {
break;
}
case Type::FloatTyID: {
- uint32_t val = cast<ConstantFP>(PC)->getValueAPF().convertToAPInt().
+ uint32_t val = cast<ConstantFP>(PC)->getValueAPF().bitcastToAPInt().
getZExtValue();
if (TD->isBigEndian())
val = ByteSwap_32(val);
getZExtValue();
if (TD->isBigEndian())
val = ByteSwap_32(val);
break;
}
case Type::DoubleTyID: {
break;
}
case Type::DoubleTyID: {
- uint64_t val = cast<ConstantFP>(PC)->getValueAPF().convertToAPInt().
+ uint64_t val = cast<ConstantFP>(PC)->getValueAPF().bitcastToAPInt().
getZExtValue();
if (TD->isBigEndian())
val = ByteSwap_64(val);
getZExtValue();
if (TD->isBigEndian())
val = ByteSwap_64(val);
if ((!AfterLegalize && !ST->isVolatile()) ||
TLI.isOperationLegal(ISD::STORE, MVT::i32)) {
Tmp = DAG.getConstant((uint32_t)CFP->getValueAPF().
if ((!AfterLegalize && !ST->isVolatile()) ||
TLI.isOperationLegal(ISD::STORE, MVT::i32)) {
Tmp = DAG.getConstant((uint32_t)CFP->getValueAPF().
- convertToAPInt().getZExtValue(), MVT::i32);
+ bitcastToAPInt().getZExtValue(), MVT::i32);
return DAG.getStore(Chain, Tmp, Ptr, ST->getSrcValue(),
ST->getSrcValueOffset(), ST->isVolatile(),
ST->getAlignment());
return DAG.getStore(Chain, Tmp, Ptr, ST->getSrcValue(),
ST->getSrcValueOffset(), ST->isVolatile(),
ST->getAlignment());
case MVT::f64:
if ((!AfterLegalize && !ST->isVolatile()) ||
TLI.isOperationLegal(ISD::STORE, MVT::i64)) {
case MVT::f64:
if ((!AfterLegalize && !ST->isVolatile()) ||
TLI.isOperationLegal(ISD::STORE, MVT::i64)) {
- Tmp = DAG.getConstant(CFP->getValueAPF().convertToAPInt().
+ Tmp = DAG.getConstant(CFP->getValueAPF().bitcastToAPInt().
getZExtValue(), MVT::i64);
return DAG.getStore(Chain, Tmp, Ptr, ST->getSrcValue(),
ST->getSrcValueOffset(), ST->isVolatile(),
getZExtValue(), MVT::i64);
return DAG.getStore(Chain, Tmp, Ptr, ST->getSrcValue(),
ST->getSrcValueOffset(), ST->isVolatile(),
// Many FP stores are not made apparent until after legalize, e.g. for
// argument passing. Since this is so common, custom legalize the
// 64-bit integer store into two 32-bit stores.
// Many FP stores are not made apparent until after legalize, e.g. for
// argument passing. Since this is so common, custom legalize the
// 64-bit integer store into two 32-bit stores.
- uint64_t Val = CFP->getValueAPF().convertToAPInt().getZExtValue();
+ uint64_t Val = CFP->getValueAPF().bitcastToAPInt().getZExtValue();
SDValue Lo = DAG.getConstant(Val & 0xFFFFFFFF, MVT::i32);
SDValue Hi = DAG.getConstant(Val >> 32, MVT::i32);
if (TLI.isBigEndian()) std::swap(Lo, Hi);
SDValue Lo = DAG.getConstant(Val & 0xFFFFFFFF, MVT::i32);
SDValue Hi = DAG.getConstant(Val >> 32, MVT::i32);
if (TLI.isBigEndian()) std::swap(Lo, Hi);
if (!UseCP) {
if (VT!=MVT::f64 && VT!=MVT::f32)
assert(0 && "Invalid type expansion");
if (!UseCP) {
if (VT!=MVT::f64 && VT!=MVT::f32)
assert(0 && "Invalid type expansion");
- return DAG.getConstant(LLVMC->getValueAPF().convertToAPInt(),
+ return DAG.getConstant(LLVMC->getValueAPF().bitcastToAPInt(),
(VT == MVT::f64) ? MVT::i64 : MVT::i32);
}
(VT == MVT::f64) ? MVT::i64 : MVT::i32);
}
if (CFP->getValueType(0) == MVT::f32 &&
getTypeAction(MVT::i32) == Legal) {
Tmp3 = DAG.getConstant(CFP->getValueAPF().
if (CFP->getValueType(0) == MVT::f32 &&
getTypeAction(MVT::i32) == Legal) {
Tmp3 = DAG.getConstant(CFP->getValueAPF().
- convertToAPInt().zextOrTrunc(32),
+ bitcastToAPInt().zextOrTrunc(32),
MVT::i32);
Result = DAG.getStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(),
SVOffset, isVolatile, Alignment);
MVT::i32);
Result = DAG.getStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(),
SVOffset, isVolatile, Alignment);
} else if (CFP->getValueType(0) == MVT::f64) {
// If this target supports 64-bit registers, do a single 64-bit store.
if (getTypeAction(MVT::i64) == Legal) {
} else if (CFP->getValueType(0) == MVT::f64) {
// If this target supports 64-bit registers, do a single 64-bit store.
if (getTypeAction(MVT::i64) == Legal) {
- Tmp3 = DAG.getConstant(CFP->getValueAPF().convertToAPInt().
+ Tmp3 = DAG.getConstant(CFP->getValueAPF().bitcastToAPInt().
zextOrTrunc(64), MVT::i64);
Result = DAG.getStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(),
SVOffset, isVolatile, Alignment);
zextOrTrunc(64), MVT::i64);
Result = DAG.getStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(),
SVOffset, isVolatile, Alignment);
// Otherwise, if the target supports 32-bit registers, use 2 32-bit
// stores. If the target supports neither 32- nor 64-bits, this
// xform is certainly not worth it.
// Otherwise, if the target supports 32-bit registers, use 2 32-bit
// stores. If the target supports neither 32- nor 64-bits, this
// xform is certainly not worth it.
- const APInt &IntVal =CFP->getValueAPF().convertToAPInt();
+ const APInt &IntVal =CFP->getValueAPF().bitcastToAPInt();
SDValue Lo = DAG.getConstant(APInt(IntVal).trunc(32), MVT::i32);
SDValue Hi = DAG.getConstant(IntVal.lshr(32).trunc(32), MVT::i32);
if (TLI.isBigEndian()) std::swap(Lo, Hi);
SDValue Lo = DAG.getConstant(APInt(IntVal).trunc(32), MVT::i32);
SDValue Hi = DAG.getConstant(IntVal.lshr(32).trunc(32), MVT::i32);
if (TLI.isBigEndian()) std::swap(Lo, Hi);
case ISD::ConstantFP: {
ConstantFPSDNode *CFP = cast<ConstantFPSDNode>(Node);
if (CFP->getValueType(0) == MVT::ppcf128) {
case ISD::ConstantFP: {
ConstantFPSDNode *CFP = cast<ConstantFPSDNode>(Node);
if (CFP->getValueType(0) == MVT::ppcf128) {
- APInt api = CFP->getValueAPF().convertToAPInt();
+ APInt api = CFP->getValueAPF().bitcastToAPInt();
Lo = DAG.getConstantFP(APFloat(APInt(64, 1, &api.getRawData()[1])),
MVT::f64);
Hi = DAG.getConstantFP(APFloat(APInt(64, 1, &api.getRawData()[0])),
Lo = DAG.getConstantFP(APFloat(APInt(64, 1, &api.getRawData()[1])),
MVT::f64);
Hi = DAG.getConstantFP(APFloat(APInt(64, 1, &api.getRawData()[0])),
}
SDValue DAGTypeLegalizer::SoftenFloatRes_ConstantFP(ConstantFPSDNode *N) {
}
SDValue DAGTypeLegalizer::SoftenFloatRes_ConstantFP(ConstantFPSDNode *N) {
- return DAG.getConstant(N->getValueAPF().convertToAPInt(),
+ return DAG.getConstant(N->getValueAPF().bitcastToAPInt(),
TLI.getTypeToTransformTo(N->getValueType(0)));
}
TLI.getTypeToTransformTo(N->getValueType(0)));
}
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
assert(NVT.getSizeInBits() == integerPartWidth &&
"Do not know how to expand this float constant!");
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
assert(NVT.getSizeInBits() == integerPartWidth &&
"Do not know how to expand this float constant!");
- APInt C = cast<ConstantFPSDNode>(N)->getValueAPF().convertToAPInt();
+ APInt C = cast<ConstantFPSDNode>(N)->getValueAPF().bitcastToAPInt();
Lo = DAG.getConstantFP(APFloat(APInt(integerPartWidth, 1,
&C.getRawData()[1])), NVT);
Hi = DAG.getConstantFP(APFloat(APInt(integerPartWidth, 1,
Lo = DAG.getConstantFP(APFloat(APInt(integerPartWidth, 1,
&C.getRawData()[1])), NVT);
Hi = DAG.getConstantFP(APFloat(APInt(integerPartWidth, 1,
(void)apf.convertFromAPInt(GV.IntVal,
false,
APFloat::rmNearestTiesToEven);
(void)apf.convertFromAPInt(GV.IntVal,
false,
APFloat::rmNearestTiesToEven);
- GV.IntVal = apf.convertToAPInt();
+ GV.IntVal = apf.bitcastToAPInt();
(void)apf.convertFromAPInt(GV.IntVal,
true,
APFloat::rmNearestTiesToEven);
(void)apf.convertFromAPInt(GV.IntVal,
true,
APFloat::rmNearestTiesToEven);
- GV.IntVal = apf.convertToAPInt();
+ GV.IntVal = apf.bitcastToAPInt();
default: assert(0 && "Invalid long double opcode"); abort();
case Instruction::Add:
apfLHS.add(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
default: assert(0 && "Invalid long double opcode"); abort();
case Instruction::Add:
apfLHS.add(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
- GV.IntVal = apfLHS.convertToAPInt();
+ GV.IntVal = apfLHS.bitcastToAPInt();
break;
case Instruction::Sub:
apfLHS.subtract(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
break;
case Instruction::Sub:
apfLHS.subtract(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
- GV.IntVal = apfLHS.convertToAPInt();
+ GV.IntVal = apfLHS.bitcastToAPInt();
break;
case Instruction::Mul:
apfLHS.multiply(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
break;
case Instruction::Mul:
apfLHS.multiply(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
- GV.IntVal = apfLHS.convertToAPInt();
+ GV.IntVal = apfLHS.bitcastToAPInt();
break;
case Instruction::FDiv:
apfLHS.divide(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
break;
case Instruction::FDiv:
apfLHS.divide(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
- GV.IntVal = apfLHS.convertToAPInt();
+ GV.IntVal = apfLHS.bitcastToAPInt();
break;
case Instruction::FRem:
apfLHS.mod(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
break;
case Instruction::FRem:
apfLHS.mod(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
- GV.IntVal = apfLHS.convertToAPInt();
+ GV.IntVal = apfLHS.bitcastToAPInt();
case Type::X86_FP80TyID:
case Type::FP128TyID:
case Type::PPC_FP128TyID:
case Type::X86_FP80TyID:
case Type::FP128TyID:
case Type::PPC_FP128TyID:
- Result.IntVal = cast <ConstantFP>(C)->getValueAPF().convertToAPInt();
+ Result.IntVal = cast <ConstantFP>(C)->getValueAPF().bitcastToAPInt();
break;
case Type::IntegerTyID:
Result.IntVal = cast<ConstantInt>(C)->getValue();
break;
case Type::IntegerTyID:
Result.IntVal = cast<ConstantInt>(C)->getValue();
// Profile - This method 'profiles' an APFloat for use with FoldingSet.
void APFloat::Profile(FoldingSetNodeID& ID) const {
// Profile - This method 'profiles' an APFloat for use with FoldingSet.
void APFloat::Profile(FoldingSetNodeID& ID) const {
- ID.Add(convertToAPInt());
+ ID.Add(bitcastToAPInt());
// and treating the result as a normal integer is unlikely to be useful.
APInt
// and treating the result as a normal integer is unlikely to be useful.
APInt
-APFloat::convertToAPInt() const
+APFloat::bitcastToAPInt() const
{
if (semantics == (const llvm::fltSemantics*)&IEEEsingle)
return convertFloatAPFloatToAPInt();
{
if (semantics == (const llvm::fltSemantics*)&IEEEsingle)
return convertFloatAPFloatToAPInt();
APFloat::convertToFloat() const
{
assert(semantics == (const llvm::fltSemantics*)&IEEEsingle);
APFloat::convertToFloat() const
{
assert(semantics == (const llvm::fltSemantics*)&IEEEsingle);
- APInt api = convertToAPInt();
+ APInt api = bitcastToAPInt();
return api.bitsToFloat();
}
return api.bitsToFloat();
}
APFloat::convertToDouble() const
{
assert(semantics == (const llvm::fltSemantics*)&IEEEdouble);
APFloat::convertToDouble() const
{
assert(semantics == (const llvm::fltSemantics*)&IEEEdouble);
- APInt api = convertToAPInt();
+ APInt api = bitcastToAPInt();
return api.bitsToDouble();
}
return api.bitsToDouble();
}
if (FPC->getType() == Type::DoubleTy) {
double Val = FPC->getValueAPF().convertToDouble();
if (FPC->getType() == Type::DoubleTy) {
double Val = FPC->getValueAPF().convertToDouble();
- uint64_t i = FPC->getValueAPF().convertToAPInt().getZExtValue();
+ uint64_t i = FPC->getValueAPF().bitcastToAPInt().getZExtValue();
Out << "static const ConstantDoubleTy FPConstant" << FPCounter++
<< " = 0x" << utohexstr(i)
<< "ULL; /* " << Val << " */\n";
} else if (FPC->getType() == Type::FloatTy) {
float Val = FPC->getValueAPF().convertToFloat();
Out << "static const ConstantDoubleTy FPConstant" << FPCounter++
<< " = 0x" << utohexstr(i)
<< "ULL; /* " << Val << " */\n";
} else if (FPC->getType() == Type::FloatTy) {
float Val = FPC->getValueAPF().convertToFloat();
- uint32_t i = (uint32_t)FPC->getValueAPF().convertToAPInt().
+ uint32_t i = (uint32_t)FPC->getValueAPF().bitcastToAPInt().
getZExtValue();
Out << "static const ConstantFloatTy FPConstant" << FPCounter++
<< " = 0x" << utohexstr(i)
<< "U; /* " << Val << " */\n";
} else if (FPC->getType() == Type::X86_FP80Ty) {
// api needed to prevent premature destruction
getZExtValue();
Out << "static const ConstantFloatTy FPConstant" << FPCounter++
<< " = 0x" << utohexstr(i)
<< "U; /* " << Val << " */\n";
} else if (FPC->getType() == Type::X86_FP80Ty) {
// api needed to prevent premature destruction
- APInt api = FPC->getValueAPF().convertToAPInt();
+ APInt api = FPC->getValueAPF().bitcastToAPInt();
const uint64_t *p = api.getRawData();
Out << "static const ConstantFP80Ty FPConstant" << FPCounter++
<< " = { 0x"
const uint64_t *p = api.getRawData();
Out << "static const ConstantFP80Ty FPConstant" << FPCounter++
<< " = { 0x"
<< "ULL, 0x" << utohexstr((uint16_t)(p[0] >> 48)) << ",{0,0,0}"
<< "}; /* Long double constant */\n";
} else if (FPC->getType() == Type::PPC_FP128Ty) {
<< "ULL, 0x" << utohexstr((uint16_t)(p[0] >> 48)) << ",{0,0,0}"
<< "}; /* Long double constant */\n";
} else if (FPC->getType() == Type::PPC_FP128Ty) {
- APInt api = FPC->getValueAPF().convertToAPInt();
+ APInt api = FPC->getValueAPF().bitcastToAPInt();
const uint64_t *p = api.getRawData();
Out << "static const ConstantFP128Ty FPConstant" << FPCounter++
<< " = { 0x"
const uint64_t *p = api.getRawData();
Out << "static const ConstantFP128Ty FPConstant" << FPCounter++
<< " = { 0x"
Out << StrVal << "f";
} else if (CFP->getType() == Type::DoubleTy)
Out << "BitsToDouble(0x"
Out << StrVal << "f";
} else if (CFP->getType() == Type::DoubleTy)
Out << "BitsToDouble(0x"
- << utohexstr(CFP->getValueAPF().convertToAPInt().getZExtValue())
+ << utohexstr(CFP->getValueAPF().bitcastToAPInt().getZExtValue())
<< "ULL) /* " << StrVal << " */";
else
Out << "BitsToFloat(0x"
<< "ULL) /* " << StrVal << " */";
else
Out << "BitsToFloat(0x"
- << utohexstr((uint32_t)CFP->getValueAPF().convertToAPInt().getZExtValue())
+ << utohexstr((uint32_t)CFP->getValueAPF().
+ bitcastToAPInt().getZExtValue())
<< "U) /* " << StrVal << " */";
Out << ")";
#if HAVE_PRINTF_A
<< "U) /* " << StrVal << " */";
Out << ")";
#if HAVE_PRINTF_A
uint64_t X;
unsigned Size;
if (FP->getType()->getTypeID()==Type::FloatTyID) {
uint64_t X;
unsigned Size;
if (FP->getType()->getTypeID()==Type::FloatTyID) {
- X = (uint32_t)FP->getValueAPF().convertToAPInt().getZExtValue();
+ X = (uint32_t)FP->getValueAPF().bitcastToAPInt().getZExtValue();
- X = FP->getValueAPF().convertToAPInt().getZExtValue();
+ X = FP->getValueAPF().bitcastToAPInt().getZExtValue();
Size = 8;
}
Out << "\tldc.r" << Size << "\t( " << utohexstr(X) << ')';
Size = 8;
}
Out << "\tldc.r" << Size << "\t( " << utohexstr(X) << ')';
const ConstantFP* FP = cast<ConstantFP>(C);
if (Ty->getTypeID() == Type::FloatTyID)
Out << "int32 (" <<
const ConstantFP* FP = cast<ConstantFP>(C);
if (Ty->getTypeID() == Type::FloatTyID)
Out << "int32 (" <<
- (uint32_t)FP->getValueAPF().convertToAPInt().getZExtValue() << ')';
+ (uint32_t)FP->getValueAPF().bitcastToAPInt().getZExtValue() << ')';
- FP->getValueAPF().convertToAPInt().getZExtValue() << ')';
+ FP->getValueAPF().bitcastToAPInt().getZExtValue() << ')';
break;
}
case Type::ArrayTyID:
break;
}
case Type::ArrayTyID:
else
assert(0 && "Unsupported floating point type");
// api needed to prevent premature destruction
else
assert(0 && "Unsupported floating point type");
// api needed to prevent premature destruction
- APInt api = CFP->getValueAPF().convertToAPInt();
+ APInt api = CFP->getValueAPF().bitcastToAPInt();
const uint64_t* p = api.getRawData();
uint64_t word = *p;
int shiftcount=60;
const uint64_t* p = api.getRawData();
uint64_t word = *p;
int shiftcount=60;
if (const ConstantFP *FP = dyn_cast<ConstantFP>(V)) {
// FP -> Integral.
if (DestTy == Type::Int32Ty) {
if (const ConstantFP *FP = dyn_cast<ConstantFP>(V)) {
// FP -> Integral.
if (DestTy == Type::Int32Ty) {
- return ConstantInt::get(FP->getValueAPF().convertToAPInt());
+ return ConstantInt::get(FP->getValueAPF().bitcastToAPInt());
} else {
assert(DestTy == Type::Int64Ty && "only support f32/f64 for now!");
} else {
assert(DestTy == Type::Int64Ty && "only support f32/f64 for now!");
- return ConstantInt::get(FP->getValueAPF().convertToAPInt());
+ return ConstantInt::get(FP->getValueAPF().bitcastToAPInt());