mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
_REALLY_ fix the float constant problem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4609 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -778,11 +778,12 @@ void CWriter::printFunction(Function *F) {
|
|||||||
Out << " const ConstantDoubleTy FloatConstant" << FPCounter++
|
Out << " const ConstantDoubleTy FloatConstant" << FPCounter++
|
||||||
<< " = 0x" << std::hex << *(unsigned long long*)&Val << std::dec
|
<< " = 0x" << std::hex << *(unsigned long long*)&Val << std::dec
|
||||||
<< "; /* " << Val << " */\n";
|
<< "; /* " << Val << " */\n";
|
||||||
else if (FPC->getType() == Type::FloatTy)
|
else if (FPC->getType() == Type::FloatTy) {
|
||||||
|
float fVal = Val;
|
||||||
Out << " const ConstantFloatTy FloatConstant" << FPCounter++
|
Out << " const ConstantFloatTy FloatConstant" << FPCounter++
|
||||||
<< " = 0x" << std::hex << *(unsigned*)&Val << std::dec
|
<< " = 0x" << std::hex << *(unsigned*)&fVal << std::dec
|
||||||
<< "; /* " << Val << " */\n";
|
<< "; /* " << Val << " */\n";
|
||||||
else
|
} else
|
||||||
assert(0 && "Unknown float type!");
|
assert(0 && "Unknown float type!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -778,11 +778,12 @@ void CWriter::printFunction(Function *F) {
|
|||||||
Out << " const ConstantDoubleTy FloatConstant" << FPCounter++
|
Out << " const ConstantDoubleTy FloatConstant" << FPCounter++
|
||||||
<< " = 0x" << std::hex << *(unsigned long long*)&Val << std::dec
|
<< " = 0x" << std::hex << *(unsigned long long*)&Val << std::dec
|
||||||
<< "; /* " << Val << " */\n";
|
<< "; /* " << Val << " */\n";
|
||||||
else if (FPC->getType() == Type::FloatTy)
|
else if (FPC->getType() == Type::FloatTy) {
|
||||||
|
float fVal = Val;
|
||||||
Out << " const ConstantFloatTy FloatConstant" << FPCounter++
|
Out << " const ConstantFloatTy FloatConstant" << FPCounter++
|
||||||
<< " = 0x" << std::hex << *(unsigned*)&Val << std::dec
|
<< " = 0x" << std::hex << *(unsigned*)&fVal << std::dec
|
||||||
<< "; /* " << Val << " */\n";
|
<< "; /* " << Val << " */\n";
|
||||||
else
|
} else
|
||||||
assert(0 && "Unknown float type!");
|
assert(0 && "Unknown float type!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user