diff --git a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyInstPrinter.cpp b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyInstPrinter.cpp --- a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyInstPrinter.cpp +++ b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyInstPrinter.cpp @@ -287,9 +287,9 @@ } else if (Op.isImm()) { O << Op.getImm(); } else if (Op.isSFPImm()) { - O << ::toString(APFloat(bit_cast(Op.getSFPImm()))); + O << ::toString(APFloat(APFloat::IEEEsingle(), APInt(32, Op.getSFPImm()))); } else if (Op.isDFPImm()) { - O << ::toString(APFloat(bit_cast(Op.getDFPImm()))); + O << ::toString(APFloat(APFloat::IEEEdouble(), APInt(64, Op.getDFPImm()))); } else { assert(Op.isExpr() && "unknown operand kind in printOperand"); // call_indirect instructions have a TYPEINDEX operand that we print