}
// Detect mmx extraction of all bits as a i64. It works better as a bitcast.
- if (InputVector.getOpcode() == ISD::BITCAST && InputVector.hasOneUse() &&
- VT == MVT::i64 && SrcVT == MVT::v1i64 && isNullConstant(EltIdx)) {
- SDValue MMXSrc = InputVector.getOperand(0);
-
- // The bitcast source is a direct mmx result.
- if (MMXSrc.getValueType() == MVT::x86mmx)
- return DAG.getBitcast(VT, InputVector);
- }
+ if (VT == MVT::i64 && SrcVT == MVT::v1i64 &&
+ InputVector.getOpcode() == ISD::BITCAST &&
+ InputVector.getOperand(0).getValueType() == MVT::x86mmx &&
+ isNullConstant(EltIdx) && InputVector.hasOneUse())
+ return DAG.getBitcast(VT, InputVector);
// Detect mmx to i32 conversion through a v2i32 elt extract.
- if (InputVector.getOpcode() == ISD::BITCAST && InputVector.hasOneUse() &&
- VT == MVT::i32 && SrcVT == MVT::v2i32 && isNullConstant(EltIdx)) {
- SDValue MMXSrc = InputVector.getOperand(0);
-
- // The bitcast source is a direct mmx result.
- if (MMXSrc.getValueType() == MVT::x86mmx)
- return DAG.getNode(X86ISD::MMX_MOVD2W, dl, MVT::i32, MMXSrc);
- }
+ if (VT == MVT::i32 && SrcVT == MVT::v2i32 &&
+ InputVector.getOpcode() == ISD::BITCAST &&
+ InputVector.getOperand(0).getValueType() == MVT::x86mmx &&
+ isNullConstant(EltIdx) && InputVector.hasOneUse())
+ return DAG.getNode(X86ISD::MMX_MOVD2W, dl, MVT::i32,
+ InputVector.getOperand(0));
// Check whether this extract is the root of a sum of absolute differences
// pattern. This has to be done here because we really want it to happen