[llvm-commits] [llvm] r95171 - /llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
Dale Johannesen
dalej at apple.com
Tue Feb 2 16:36:41 PST 2010
Author: johannes
Date: Tue Feb 2 18:36:40 2010
New Revision: 95171
URL: http://llvm.org/viewvc/llvm-project?rev=95171&view=rev
Log:
Print FPImm a less kludgy way; APFloat.toString seems
to have some problems anyway.
Modified:
llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp?rev=95171&r1=95170&r2=95171&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Tue Feb 2 18:36:40 2010
@@ -440,12 +440,9 @@
} else if (MI->getOperand(0).getType()==MachineOperand::MO_FPImmediate) {
// This is more naturally done in printOperand, but since the only use
// of such an operand is in this comment and that is temporary, we
- // prefer to keep this mess localized.
- SmallVectorImpl<char> Str(20);
- APFloat APF = MI->getOperand(0).getFPImm()->getValueAPF();
- APF.toString(Str, 0, 0);
- for (unsigned i=0; i<Str.size()-1; i++)
- O << Str[i];
+ // prefer to keep this localized.
+ O << '$';
+ MI->getOperand(0).print(O, &TM);
} else
printOperand(MI, 0);
} else {
More information about the llvm-commits
mailing list