llvm.org GIT mirror llvm / f8db447
Revert r169638 because it broke Mesa llvmpipe tests. Fix PR15239. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175985 91177308-0d34-0410-b5e6-96231b3b80d8 Nadav Rotem 7 years ago
3 changed file(s) with 3 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
1624716247
1624816248 DebugLoc DL = N->getDebugLoc();
1624916249
16250 // We are going to replace the AND, OR, NAND with either BLEND
16251 // or PSIGN, which only look at the MSB. The VSRAI instruction
16252 // does not affect the highest bit, so we can get rid of it.
16253 Mask = Mask.getOperand(0);
16254
1625516250 // Now we know we at least have a plendvb with the mask val. See if
1625616251 // we can form a psignb/w/d.
1625716252 // psign = x.type == y.type == mask.type && y = sub(0, x);
1626016255 X.getValueType() == MaskVT && Y.getValueType() == MaskVT) {
1626116256 assert((EltBits == 8 || EltBits == 16 || EltBits == 32) &&
1626216257 "Unsupported VT for PSIGN");
16263 Mask = DAG.getNode(X86ISD::PSIGN, DL, MaskVT, X, Mask);
16258 Mask = DAG.getNode(X86ISD::PSIGN, DL, MaskVT, X, Mask.getOperand(0));
1626416259 return DAG.getNode(ISD::BITCAST, DL, VT, Mask);
1626516260 }
1626616261 // PBLENDVB only available on SSE 4.1
44
55 ; CHECK: @foo8
66 ; CHECK: psll
7 ; CHECK-NOT: psraw
7 ; CHECK: psraw
88 ; CHECK: pblendvb
99 ; CHECK: ret
1010 define void @foo8(float* nocapture %RET) nounwind {
2929 ; reduce the mask in this case.
3030 ;CHECK: vsel_8xi16
3131 ;CHECK: psllw
32 ;CHECK-NOT: psraw
32 ;CHECK: psraw
3333 ;CHECK: pblendvb
3434 ;CHECK: ret
3535 define <8 x i16> @vsel_8xi16(<8 x i16> %v1, <8 x i16> %v2) {