[PATCH] D77384: [WebAssembly] Support single-floating-point immediate value

Dan Gohman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 6 08:06:18 PDT 2020


sunfish added a comment.

Is looks possible that the test failure was due to an unrelated commit 210f40fe9a30212396311d265904b2d73859c53d <https://reviews.llvm.org/rG210f40fe9a30212396311d265904b2d73859c53d>. If so, it's possible it's fixed as of 74ab5d98d07f0b0226f45ccca8df6a450d52fb7b <https://reviews.llvm.org/rG74ab5d98d07f0b0226f45ccca8df6a450d52fb7b>.



================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp:282
       else if (Imm->getType()->isDoubleTy())
         MCOp = MCOperand::createFPImm(Imm->getValueAPF().convertToDouble());
       else
----------------
`MCOperand::createFPImm`, and the other functions which also hold the value in floating-point types can also implicitly convert NaN bits. To preserve it in all cases, there should be a way to construct an `MCOperand` from an integer holding the bits, so this code can do something like `Imm->getValueAPF()->bitcastToAPInt().getZExtValue()` and pass the value in.

Similar for `getFPImm` on the consuming side.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77384/new/

https://reviews.llvm.org/D77384





More information about the llvm-commits mailing list