Add support for PPC 128bit doubledouble type.

On a PowerPC target the datatype real is mapped to PPC 128bit doubledouble type.
Please note that this yet does not work if you cross compile from a different
architecture.
This commit is contained in:
kai
2012-12-30 17:18:36 +01:00
parent ce47e5a083
commit 2898e5cac3
4 changed files with 20 additions and 2 deletions
+5
View File
@@ -676,6 +676,11 @@ LLConstant* DtoConstFP(Type* t, longdouble value)
bits[0] = *reinterpret_cast<uint64_t*>(&value);
bits[1] = *reinterpret_cast<uint16_t*>(reinterpret_cast<uint64_t*>(&value) + 1);
return LLConstantFP::get(gIR->context(), APFloat(APInt(80, 2, bits)));
} else if(llty == LLType::getPPC_FP128Ty(gIR->context())) {
uint64_t bits[] = {0, 0};
bits[0] = *reinterpret_cast<uint64_t*>(&value);
bits[1] = *reinterpret_cast<uint16_t*>(reinterpret_cast<uint64_t*>(&value) + 1);
return LLConstantFP::get(gIR->context(), APFloat(APInt(128, 2, bits)));
} else {
assert(0 && "Unknown floating point type encountered");
}