summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-10-11 18:07:22 +0000
committerDale Johannesen <dalej@apple.com>2007-10-11 18:07:22 +0000
commit007aa378adced52180f37936f3938bbcaaf6d176 (patch)
treede453b6cc3a1ef38ec69e231e353ee2a52044557 /llvm/lib/Bitcode
parent899cc5661266483323eed68195cbe25dcef31159 (diff)
downloadbcm5719-llvm-007aa378adced52180f37936f3938bbcaaf6d176.tar.gz
bcm5719-llvm-007aa378adced52180f37936f3938bbcaaf6d176.zip
Next PPC long double bits. First cut at constants.
No compile-time support for constant operations yet, just format transformations. Make readers and writers work. Split constants into 2 doubles in Legalize. llvm-svn: 42865
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp4
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp4
2 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 9e4a3dee60f..72785579967 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -632,9 +632,9 @@ bool BitcodeReader::ParseConstants() {
else if (CurTy == Type::X86_FP80Ty)
V = ConstantFP::get(CurTy, APFloat(APInt(80, 2, &Record[0])));
else if (CurTy == Type::FP128Ty)
- V = ConstantFP::get(CurTy, APFloat(APInt(128, 2, &Record[0])));
+ V = ConstantFP::get(CurTy, APFloat(APInt(128, 2, &Record[0]), true));
else if (CurTy == Type::PPC_FP128Ty)
- assert(0 && "PowerPC long double constants not handled yet.");
+ V = ConstantFP::get(CurTy, APFloat(APInt(128, 2, &Record[0])));
else
V = UndefValue::get(CurTy);
break;
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 7999907c185..6bf27123c96 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -534,13 +534,11 @@ static void WriteConstants(unsigned FirstVal, unsigned LastVal,
const uint64_t *p = api.getRawData();
Record.push_back(p[0]);
Record.push_back((uint16_t)p[1]);
- } else if (Ty == Type::FP128Ty) {
+ } else if (Ty == Type::FP128Ty || Ty == Type::PPC_FP128Ty) {
APInt api = CFP->getValueAPF().convertToAPInt();
const uint64_t *p = api.getRawData();
Record.push_back(p[0]);
Record.push_back(p[1]);
- } else if (Ty == Type::PPC_FP128Ty) {
- assert(0 && "PowerPC long double constants not handled yet.");
} else {
assert (0 && "Unknown FP type!");
}
OpenPOWER on IntegriCloud