The one caller bitcasted the uint32_t to float anyway.
}
namespace RISCVLoadFPImm {
-inline static uint32_t getFPImm(unsigned Imm) {
+inline static float getFPImm(unsigned Imm) {
assert(Imm != 1 && Imm != 30 && Imm != 31 && "Unsupported immediate");
uint8_t Sign;
uint8_t Exp;
Mantissa = LoadFPImmArr[Imm - 1].second;
}
- return Sign << 31 | Exp << 23 | Mantissa << 20;
+ uint32_t I = Sign << 31 | Exp << 23 | Mantissa << 20;
+ return bit_cast<float>(I);
}
/// getLoadFP32Imm - Return a 5-bit binary encoding of the 32-bit
else if (MO.getImm() == 31)
O << "nan";
else
- O << bit_cast<float>(RISCVLoadFPImm::getFPImm(MO.getImm()));
+ O << RISCVLoadFPImm::getFPImm(MO.getImm());
}
void RISCVInstPrinter::printZeroOffsetMemOp(const MCInst *MI, unsigned OpNo,