[PATCH] D46536: [Power9]Legalize and emit code for W vector extract and convert to Quad-Precision

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 14 05:37:44 PDT 2018


nemanjai added inline comments.


================
Comment at: lib/Target/PowerPC/PPCInstrVSX.td:3167
+    // (Un)Signed Word vector extract -> QP
+    def : Pat<(f128 (sint_to_fp (i32 (extractelt v4i32:$src, 0)))),
+              (f128 (XSCVSDQP (EXTRACT_SUBREG (VEXTSW2D $src), sub_64)))>;
----------------
It is actually word 1 that doesn't need the splat. Word 0 does need a splat.


================
Comment at: lib/Target/PowerPC/PPCInstrVSX.td:3196
+    // (Un)Signed Word vector extract -> QP
+    foreach Idx = [[0,3],[1,2],[2,1]] in {
+      def : Pat<(f128 (sint_to_fp (i32 (extractelt v4i32:$src, !head(Idx))))),
----------------
This should actually be `foreach Idx = [[0,3],[1,2],[3,0]]` shouldn't it? For LE word element 2, `VEXTSW2D` will sign extend it into LE doubleword element 1 which is where `XSCVSDQP` needs it to be - so a splat is not needed. LE word element 3 on the other hand **will** need a splat since the input is in the left half of LE doubleword 1 and it needs to be in the right half.


https://reviews.llvm.org/D46536





More information about the llvm-commits mailing list