mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-03 14:31:10 +00:00
Pretty-printing comments for literal floating point in .s files.
Dump the hex representation to the comment stream as well as the float value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153346 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
00ca888ccc
commit
7c0bc008f1
@ -1764,7 +1764,9 @@ static void EmitGlobalConstantFP(const ConstantFP *CFP, unsigned AddrSpace,
|
||||
if (CFP->getType()->isFloatTy()) {
|
||||
if (AP.isVerbose()) {
|
||||
float Val = CFP->getValueAPF().convertToFloat();
|
||||
AP.OutStreamer.GetCommentOS() << "float " << Val << '\n';
|
||||
uint64_t IntVal = CFP->getValueAPF().bitcastToAPInt().getZExtValue();
|
||||
AP.OutStreamer.GetCommentOS() << "float " << Val << '\n'
|
||||
<< " (" << format("0x%x", IntVal) << ")\n";
|
||||
}
|
||||
uint64_t Val = CFP->getValueAPF().bitcastToAPInt().getZExtValue();
|
||||
AP.OutStreamer.EmitIntValue(Val, 4, AddrSpace);
|
||||
@ -1776,7 +1778,9 @@ static void EmitGlobalConstantFP(const ConstantFP *CFP, unsigned AddrSpace,
|
||||
if (CFP->getType()->isDoubleTy()) {
|
||||
if (AP.isVerbose()) {
|
||||
double Val = CFP->getValueAPF().convertToDouble();
|
||||
AP.OutStreamer.GetCommentOS() << "double " << Val << '\n';
|
||||
uint64_t IntVal = CFP->getValueAPF().bitcastToAPInt().getZExtValue();
|
||||
AP.OutStreamer.GetCommentOS() << "double " << Val << '\n'
|
||||
<< " (" << format("0x%lx", IntVal) << ")\n";
|
||||
}
|
||||
|
||||
uint64_t Val = CFP->getValueAPF().bitcastToAPInt().getZExtValue();
|
||||
|
Loading…
x
Reference in New Issue
Block a user