@@ -9571,13 +9571,17 @@ SDValue AArch64TargetLowering::LowerCTPOP_PARITY(SDValue Op,
9571
9571
Attribute::NoImplicitFloat))
9572
9572
return SDValue();
9573
9573
9574
- if (!Subtarget->hasNEON())
9574
+ EVT VT = Op.getValueType();
9575
+ if (VT.isScalableVector() ||
9576
+ useSVEForFixedLengthVectorVT(VT, !Subtarget->isNeonAvailable()))
9577
+ return LowerToPredicatedOp(Op, DAG, AArch64ISD::CTPOP_MERGE_PASSTHRU);
9578
+
9579
+ if (!Subtarget->isNeonAvailable())
9575
9580
return SDValue();
9576
9581
9577
9582
bool IsParity = Op.getOpcode() == ISD::PARITY;
9578
9583
SDValue Val = Op.getOperand(0);
9579
9584
SDLoc DL(Op);
9580
- EVT VT = Op.getValueType();
9581
9585
9582
9586
// for i32, general parity function using EORs is more efficient compared to
9583
9587
// using floating point
@@ -9626,10 +9630,6 @@ SDValue AArch64TargetLowering::LowerCTPOP_PARITY(SDValue Op,
9626
9630
9627
9631
assert(!IsParity && "ISD::PARITY of vector types not supported");
9628
9632
9629
- if (VT.isScalableVector() ||
9630
- useSVEForFixedLengthVectorVT(VT, !Subtarget->isNeonAvailable()))
9631
- return LowerToPredicatedOp(Op, DAG, AArch64ISD::CTPOP_MERGE_PASSTHRU);
9632
-
9633
9633
assert((VT == MVT::v1i64 || VT == MVT::v2i64 || VT == MVT::v2i32 ||
9634
9634
VT == MVT::v4i32 || VT == MVT::v4i16 || VT == MVT::v8i16) &&
9635
9635
"Unexpected type for custom ctpop lowering");
0 commit comments