[PATCH] D82911: [PowerPC][Power10] Exploit the xxspltiw and xxspltidp instructions.

Anil Mahmud via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 1 12:27:06 PDT 2020


anil9 added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:9343
+  // turned into a 4-byte splat of 0xABABABAB.
+  if (Subtarget.hasPrefixInstrs() && SplatSize == 2)
+    return getCanonicalConstSplat((SplatBits |= SplatBits << 16), SplatSize * 2,
----------------
lei wrote:
> NeHuang wrote:
> > Is it better to combine these two conditions? Seems only the first argument of `getCanonicalConstSplat` depends on `SplatSize`.
> > 
> > ```
> > if (Subtarget.hasPrefixInstrs() && (SplatSize == 2 || SplatSize == 4))
> >   return getCanonicalConstSplat ((SplatSize == 2) ? (SplatBits |= SplatBits << 16) : SplatBits, 4, Op.getValueType(), DAG, dl)
> > ```
> I can do that, don't feel strongly about it either way.
The current code is more readable than the suggested one, and was decided on after a discussion. I prefer the way it is now.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82911





More information about the llvm-commits mailing list