diff options
| author | Nate Begeman <natebegeman@mac.com> | 2008-07-25 19:05:58 +0000 |
|---|---|---|
| committer | Nate Begeman <natebegeman@mac.com> | 2008-07-25 19:05:58 +0000 |
| commit | 283b2da27a7aafa2f298461cad9306d4486e4060 (patch) | |
| tree | 6a5fe1bd1d0fef783b615c8d03517c9990fbdb54 /llvm/lib | |
| parent | f9c49e5d27a3e8377a862296ad68982a811f3aed (diff) | |
| download | bcm5719-llvm-283b2da27a7aafa2f298461cad9306d4486e4060.tar.gz bcm5719-llvm-283b2da27a7aafa2f298461cad9306d4486e4060.zip | |
Disable mov{L, LP, HP, HLP, *DUP} shuffles for mmx
mmx needs its own fancy shuffle logic based on unpack; for now we get correct but awful code.
Also commit Mon Ping's VSETCC patch
llvm-svn: 54039
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index e8e1b2e7ea0..00c8eeade5b 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -3881,14 +3881,15 @@ X86TargetLowering::LowerVECTOR_SHUFFLE(SDOperand Op, SelectionDAG &DAG) { return V2; if (ISD::isBuildVectorAllZeros(V1.Val)) return getVZextMovL(VT, VT, V2, DAG, Subtarget); - return Op; + if (!isMMX) + return Op; } - if (X86::isMOVSHDUPMask(PermMask.Val) || - X86::isMOVSLDUPMask(PermMask.Val) || - X86::isMOVHLPSMask(PermMask.Val) || - X86::isMOVHPMask(PermMask.Val) || - X86::isMOVLPMask(PermMask.Val)) + if (!isMMX && (X86::isMOVSHDUPMask(PermMask.Val) || + X86::isMOVSLDUPMask(PermMask.Val) || + X86::isMOVHLPSMask(PermMask.Val) || + X86::isMOVHPMask(PermMask.Val) || + X86::isMOVLPMask(PermMask.Val))) return Op; if (ShouldXformToMOVHLPS(PermMask.Val) || @@ -4772,6 +4773,7 @@ SDOperand X86TargetLowering::LowerVSETCC(SDOperand Op, SelectionDAG &DAG) { switch (SetCCOpcode) { default: break; + case ISD::SETOEQ: case ISD::SETEQ: SSECC = 0; break; case ISD::SETOGT: case ISD::SETGT: Swap = true; // Fallthrough @@ -4782,7 +4784,7 @@ SDOperand X86TargetLowering::LowerVSETCC(SDOperand Op, SelectionDAG &DAG) { case ISD::SETLE: case ISD::SETOLE: SSECC = 2; break; case ISD::SETUO: SSECC = 3; break; - case ISD::SETONE: + case ISD::SETUNE: case ISD::SETNE: SSECC = 4; break; case ISD::SETULE: Swap = true; case ISD::SETUGE: SSECC = 5; break; @@ -4793,15 +4795,21 @@ SDOperand X86TargetLowering::LowerVSETCC(SDOperand Op, SelectionDAG &DAG) { if (Swap) std::swap(Op0, Op1); - // In the one special case we can't handle, emit two comparisons. + // In the two special cases we can't handle, emit two comparisons. if (SSECC == 8) { - SDOperand UNORD, EQ; - - assert(SetCCOpcode == ISD::SETUEQ && "Illegal FP comparison"); - - UNORD = DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(3, MVT::i8)); - EQ = DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(0, MVT::i8)); - return DAG.getNode(ISD::OR, VT, UNORD, EQ); + if (SetCCOpcode == ISD::SETUEQ) { + SDOperand UNORD, EQ; + UNORD = DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(3, MVT::i8)); + EQ = DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(0, MVT::i8)); + return DAG.getNode(ISD::OR, VT, UNORD, EQ); + } + else if (SetCCOpcode == ISD::SETONE) { + SDOperand ORD, NEQ; + ORD = DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(7, MVT::i8)); + NEQ = DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(4, MVT::i8)); + return DAG.getNode(ISD::AND, VT, ORD, NEQ); + } + assert(0 && "Illegal FP comparison"); } // Handle all other FP comparisons here. return DAG.getNode(Opc, VT, Op0, Op1, DAG.getConstant(SSECC, MVT::i8)); |

