diff options
author | Daniel Sanders <daniel.sanders@imgtec.com> | 2013-11-15 16:02:04 +0000 |
---|---|---|
committer | Daniel Sanders <daniel.sanders@imgtec.com> | 2013-11-15 16:02:04 +0000 |
commit | cb85ded9980644fc6a3ff7d8e4dc56351adcc114 (patch) | |
tree | 89e03020529c17667b7cde11454e8e03ba708864 /lib | |
parent | 421556176882360e6854c77fc658bc4e8de75b58 (diff) | |
download | external_llvm-cb85ded9980644fc6a3ff7d8e4dc56351adcc114.zip external_llvm-cb85ded9980644fc6a3ff7d8e4dc56351adcc114.tar.gz external_llvm-cb85ded9980644fc6a3ff7d8e4dc56351adcc114.tar.bz2 |
[mips][msa] lowerMSABitClear() should use SelectionDAG::getNOT() instead of using a long-winded equivalent.
Now that getConstant(-1, MVT::v2i64) works correctly on MIPS32 we can use
SelectionDAG::getNOT() to produce the bitmask.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194819 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/Mips/MipsSEISelLowering.cpp | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/lib/Target/Mips/MipsSEISelLowering.cpp b/lib/Target/Mips/MipsSEISelLowering.cpp index e2ea629..eb9656a 100644 --- a/lib/Target/Mips/MipsSEISelLowering.cpp +++ b/lib/Target/Mips/MipsSEISelLowering.cpp @@ -1368,24 +1368,12 @@ static SDValue lowerMSABinaryBitImmIntr(SDValue Op, SelectionDAG &DAG, static SDValue lowerMSABitClear(SDValue Op, SelectionDAG &DAG) { EVT ResTy = Op->getValueType(0); - EVT ViaVecTy = ResTy == MVT::v2i64 ? MVT::v4i32 : ResTy; SDLoc DL(Op); SDValue One = DAG.getConstant(1, ResTy); SDValue Bit = DAG.getNode(ISD::SHL, DL, ResTy, One, Op->getOperand(2)); - SDValue AllOnes = DAG.getConstant(-1, MVT::i32); - SDValue AllOnesOperands[16] = { AllOnes, AllOnes, AllOnes, AllOnes, - AllOnes, AllOnes, AllOnes, AllOnes, - AllOnes, AllOnes, AllOnes, AllOnes, - AllOnes, AllOnes, AllOnes, AllOnes }; - AllOnes = DAG.getNode(ISD::BUILD_VECTOR, DL, ViaVecTy, AllOnesOperands, - ViaVecTy.getVectorNumElements()); - if (ResTy != ViaVecTy) - AllOnes = DAG.getNode(ISD::BITCAST, DL, ResTy, AllOnes); - - Bit = DAG.getNode(ISD::XOR, DL, ResTy, Bit, AllOnes); - - return DAG.getNode(ISD::AND, DL, ResTy, Op->getOperand(1), Bit); + return DAG.getNode(ISD::AND, DL, ResTy, Op->getOperand(1), + DAG.getNOT(DL, Bit, ResTy)); } static SDValue lowerMSABitClearImm(SDValue Op, SelectionDAG &DAG) { |