From b3cfc2b77ce72c8de31f87f3374911aaf96cf99e Mon Sep 17 00:00:00 2001 From: Dale Johannesen Date: Tue, 2 Feb 2010 23:54:23 +0000 Subject: Accept floating point immediates in DEBUG_VALUE. llvm-svn: 95159 --- llvm/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Target/X86') diff --git a/llvm/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp b/llvm/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp index 350b1fa422e..40b1f7bd0de 100644 --- a/llvm/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp +++ b/llvm/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp @@ -430,12 +430,22 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) { if (NOps==3) { // Register or immediate value. Register 0 means undef. assert(MI->getOperand(0).getType()==MachineOperand::MO_Register || - MI->getOperand(0).getType()==MachineOperand::MO_Immediate); + MI->getOperand(0).getType()==MachineOperand::MO_Immediate || + MI->getOperand(0).getType()==MachineOperand::MO_FPImmediate); if (MI->getOperand(0).getType()==MachineOperand::MO_Register && MI->getOperand(0).getReg()==0) { // Suppress offset in this case, it is not meaningful. O << "undef"; return; + } 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 Str(20); + APFloat APF = MI->getOperand(0).getFPImm()->getValueAPF(); + APF.toString(Str, 0, 0); + for (unsigned i=0; i