[PATCH] [X86][SSE] Vectorized i8 and i16 shift operators
Andrea Di Biagio
Andrea_DiBiagio at sn.scee.net
Tue Jun 9 08:47:24 PDT 2015
Hi Simon,
Thanks for the patch and sorry it took a long time for me to review this patch.
The change looks good to me.
Thanks!
Andrea
REPOSITORY
rL LLVM
================
Comment at: lib/Target/X86/X86ISelLowering.cpp:16980
@@ -16979,12 +16979,3 @@
- if (VT == MVT::v16i8 && Op->getOpcode() == ISD::SHL) {
- // Turn 'a' into a mask suitable for VSELECT: a = a << 5;
- Op = DAG.getNode(ISD::SHL, dl, VT, Amt, DAG.getConstant(5, dl, VT));
-
- SDValue VSelM = DAG.getConstant(0x80, dl, VT);
- SDValue OpVSel = DAG.getNode(ISD::AND, dl, VT, VSelM, Op);
- OpVSel = DAG.getNode(X86ISD::PCMPEQ, dl, VT, OpVSel, VSelM);
-
- // r = VSELECT(r, shl(r, 4), a);
- SDValue M = DAG.getNode(ISD::SHL, dl, VT, R, DAG.getConstant(4, dl, VT));
- R = DAG.getNode(ISD::VSELECT, dl, VT, OpVSel, M, R);
+ if (VT == MVT::v16i8 || (VT == MVT::v32i8 && Subtarget->hasInt256())) {
+ MVT ExtVT = MVT::getVectorVT(MVT::i16, VT.getVectorNumElements() / 2);
----------------
Okay, this is because VPBLENDVB on v32i8 is only available on AVX2.
http://reviews.llvm.org/D9474
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list