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

Dan Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 17:38:48 PDT 2020


dweber added inline comments.


================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp:1595
+    size_t ByteStep = VecT.getScalarSizeInBits() / 8;
+    for (const SDValue &Lane : Op->op_values()) {
+      if (IsConstant(Lane)) {
----------------
hubert.reinterpretcast wrote:
> More comments of assertions about the expected number of loop iterations and the relationship to ByteStep could be helpful.
@tlively @hubert.reinterpretcast the byte step exists to simplify the branching logic that would exist if we had to do masking for each integer type. It takes advantage of little endian to always capture the least significant bits relevant to the typed integer in question.


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