[llvm-commits] AVX1 Code Generation - VSHUFP extension
Demikhovsky, Elena
elena.demikhovsky at intel.com
Tue Nov 8 04:08:41 PST 2011
Eli,
Thank you for the review.
I fixed the code. The input mask remains unchanged now.
Please take a look.
- Elena
-----Original Message-----
From: Eli Friedman [mailto:eli.friedman at gmail.com]
Sent: Monday, November 07, 2011 23:47
To: Demikhovsky, Elena
Cc: llvm-commits at cs.uiuc.edu
Subject: Re: [llvm-commits] AVX1 Code Generation - VSHUFP extension
On Mon, Nov 7, 2011 at 12:08 AM, Demikhovsky, Elena
<elena.demikhovsky at intel.com> wrote:
> Hello,
>
> I added several lines in X86 code generator that allow to choose VSHUFPS/VSHUFPD
> instructions while lowering VECTOR_SHUFFLE node. I check a commuted VSHUFP mask.
>
> I extended the existing lit test.
>
> Please review.
+static bool isCommutedVSHUFPSY(SmallVectorImpl<int> &Mask, EVT VT,
+ const X86Subtarget *Subtarget) {
+
+ if ((VT.getSizeInBits() != 256) || (VT.getVectorNumElements() != 8))
+ return false;
+
+ CommuteVectorShuffleMask(Mask, VT);
+ return isVSHUFPSYMask(Mask, VT, Subtarget);
+}
It looks like this mutates the input Mask; I don't think you really
want to do that.
+ // Try to swap operands in the node to match x86 shuffle ops
+ if (!V2IsUndef && isCommutedVSHUFPSY(M, VT, Subtarget)) {
+ // Now we need to commute operands.
+ SVOp = cast<ShuffleVectorSDNode>(CommuteVectorShuffle(SVOp, DAG));
This isn't consistent with the way other code in this function uses
CommuteVectorShuffle.
-Eli
---------------------------------------------------------------------
Intel Israel (74) Limited
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vshufp1.diff
Type: application/octet-stream
Size: 3849 bytes
Desc: vshufp1.diff
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111108/b9773a41/attachment.obj>
More information about the llvm-commits
mailing list