mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-01 15:24:04 +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. llvm-svn: 153346
This commit is contained in:
parent
d848fb8bf9
commit
a4f7b91e89
@ -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