[PATCH] D133495: [AArch64] Lower vector trunc using tbl.

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 15 02:57:11 PDT 2022


t.p.northover added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:13246-13247
+  Type *VecTy = FixedVectorType::get(Builder.getInt8Ty(), 16);
+  Parts.push_back(Builder.CreateBitCast(
+      Builder.CreateShuffleVector(TI->getOperand(0), {0, 1, 2, 3}), VecTy));
+  Parts.push_back(Builder.CreateBitCast(
----------------
Further to our big-endian discussion, I think this `bitcast` will put the least significant byte into elements 3, 7, 11, 15. So the for loop below should account for that.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:13324
     createTblShuffleForZExt(ZExt);
+    return true;
   }
----------------
Shouldn't this be part of the patch that adds the code above?


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:13327
+
+  // Convert 'trunc <(8|16) x i32> %x to <(8|16) x i32>' to a single tbl.4
+  // instruction selecting the lowest 8 bits per lane of the input interpreted
----------------
Destination type wrong.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133495



More information about the llvm-commits mailing list