[PATCH] D88591: [WebAssembly] Emulate v128.const efficiently

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 13:52:44 PDT 2020


aheejin accepted this revision.
aheejin added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp:1601
+        auto *Const = cast<ConstantSDNode>(Lane.getNode());
+        uint64_t Val = byte_swap(Const->getLimitedValue(), little);
+        uint8_t *ValPtr = reinterpret_cast<uint8_t *>(&Val);
----------------
tlively wrote:
> aheejin wrote:
> > What does `getLimitedValue` do and why is it necessary?
> It gets the constant value, capping it so that it fits in a `uint64_t`. It's similar to `getZExtValue`, but doesn't assert if the value happens to be too large to fit in a uint64_t for some reason.
Given that our biggest lane is 64 bits, do we need this then? (I'm not against using this as a safe measure or anything; I'm just trying to understand what this function does)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88591



More information about the llvm-commits mailing list