mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-26 17:43:14 +01:00
Simplify fp80 handling in DtoConstFP
This commit is contained in:
@@ -535,13 +535,7 @@ llvm::ConstantFP* DtoConstFP(Type* t, long double value)
|
||||
else if(llty == LLType::X86_FP80Ty) {
|
||||
uint64_t bits[] = {0, 0};
|
||||
bits[1] = *(uint16_t*)&value;
|
||||
bits[0] = *((uint16_t*)&value + 4);
|
||||
bits[0] <<= 16;
|
||||
bits[0] += *((uint16_t*)&value + 3);
|
||||
bits[0] <<= 16;
|
||||
bits[0] += *((uint16_t*)&value + 2);
|
||||
bits[0] <<= 16;
|
||||
bits[0] += *((uint16_t*)&value + 1);
|
||||
bits[0] = *(uint64_t*)((uint16_t*)&value + 1);
|
||||
return LLConstantFP::get(APFloat(APInt(80, 2, bits)));
|
||||
} else {
|
||||
assert(0 && "Unknown floating point type encountered");
|
||||
|
||||
Reference in New Issue
Block a user