mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
Add APInt interfaces to APFloat (allows directly
access to bits). Use them in place of float and double interfaces where appropriate. First bits of x86 long double constants handling (untested, probably does not work). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41858 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -622,23 +622,24 @@ bool BitcodeReader::ParseConstants() {
|
||||
NumWords, &Words[0]));
|
||||
break;
|
||||
}
|
||||
case bitc::CST_CODE_FLOAT: // FLOAT: [fpval]
|
||||
case bitc::CST_CODE_FLOAT: { // FLOAT: [fpval]
|
||||
if (Record.empty())
|
||||
return Error("Invalid FLOAT record");
|
||||
if (CurTy == Type::FloatTy)
|
||||
V = ConstantFP::get(CurTy, APFloat(BitsToFloat(Record[0])));
|
||||
V = ConstantFP::get(CurTy, APFloat(APInt(32, (uint32_t)Record[0])));
|
||||
else if (CurTy == Type::DoubleTy)
|
||||
V = ConstantFP::get(CurTy, APFloat(BitsToDouble(Record[0])));
|
||||
V = ConstantFP::get(CurTy, APFloat(APInt(64, Record[0])));
|
||||
// FIXME: Make long double constants work. BitsToDouble does not make it.
|
||||
else if (CurTy == Type::X86_FP80Ty)
|
||||
V = ConstantFP::get(CurTy, APFloat(BitsToDouble(Record[0])));
|
||||
V = ConstantFP::get(CurTy, APFloat(APInt(80, 2, &Record[0])));
|
||||
else if (CurTy == Type::FP128Ty)
|
||||
V = ConstantFP::get(CurTy, APFloat(BitsToDouble(Record[0])));
|
||||
V = ConstantFP::get(CurTy, APFloat(APInt(128, 2, &Record[0])));
|
||||
else if (CurTy == Type::PPC_FP128Ty)
|
||||
assert(0 && "PowerPC long double constants not handled yet.");
|
||||
else
|
||||
V = UndefValue::get(CurTy);
|
||||
break;
|
||||
}
|
||||
|
||||
case bitc::CST_CODE_AGGREGATE: {// AGGREGATE: [n x value number]
|
||||
if (Record.empty())
|
||||
|
Reference in New Issue
Block a user