diff --git a/lib/Target/X86/Printer.cpp b/lib/Target/X86/Printer.cpp index be1f34d3bbe..d71715aa616 100644 --- a/lib/Target/X86/Printer.cpp +++ b/lib/Target/X86/Printer.cpp @@ -144,7 +144,10 @@ void Printer::emitConstantValueOnly(const Constant *CV) { assert(CB == ConstantBool::True); O << "1"; } else if (const ConstantSInt *CI = dyn_cast(CV)) - O << CI->getValue(); + if (((CI->getValue() << 32) >> 32) == CI->getValue()) + O << CI->getValue(); + else + O << (unsigned long long)CI->getValue(); else if (const ConstantUInt *CI = dyn_cast(CV)) O << CI->getValue(); else if (const ConstantPointerRef *CPR = dyn_cast(CV)) diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp index be1f34d3bbe..d71715aa616 100644 --- a/lib/Target/X86/X86AsmPrinter.cpp +++ b/lib/Target/X86/X86AsmPrinter.cpp @@ -144,7 +144,10 @@ void Printer::emitConstantValueOnly(const Constant *CV) { assert(CB == ConstantBool::True); O << "1"; } else if (const ConstantSInt *CI = dyn_cast(CV)) - O << CI->getValue(); + if (((CI->getValue() << 32) >> 32) == CI->getValue()) + O << CI->getValue(); + else + O << (unsigned long long)CI->getValue(); else if (const ConstantUInt *CI = dyn_cast(CV)) O << CI->getValue(); else if (const ConstantPointerRef *CPR = dyn_cast(CV))