@@ -968,28 +968,6 @@ static SDValue checkIntrinsicImmArg(SDValue Op, unsigned ImmOp,
968
968
return SDValue ();
969
969
}
970
970
971
- static SDValue checkAndModifyXVPERMI_QIntrinsicImmArg (SDValue Op,
972
- SelectionDAG &DAG) {
973
- SDValue Op3 = Op->getOperand (3 );
974
- uint64_t Imm = Op3->getAsZExtVal ();
975
- // Check the range of ImmArg.
976
- if (!isUInt<8 >(Imm)) {
977
- DAG.getContext ()->emitError (Op->getOperationName (0 ) +
978
- " : argument out of range." );
979
- return DAG.getNode (ISD::UNDEF, SDLoc (Op), Op.getValueType ());
980
- }
981
-
982
- // For instruction xvpermi.q, only [1:0] and [5:4] bits of operands[3]
983
- // are used. The unused bits in operands[3] need to be set to 0 to avoid
984
- // causing undefined behavior on LA464.
985
- if ((Imm & 0x33 ) != Imm) {
986
- Op3 = DAG.getTargetConstant (Imm & 0x33 , SDLoc (Op), Op3.getValueType ());
987
- DAG.UpdateNodeOperands (Op.getNode (), Op->getOperand (0 ), Op->getOperand (1 ),
988
- Op->getOperand (2 ), Op3);
989
- }
990
- return SDValue ();
991
- }
992
-
993
971
SDValue
994
972
LoongArchTargetLowering::lowerINTRINSIC_WO_CHAIN (SDValue Op,
995
973
SelectionDAG &DAG) const {
@@ -1247,14 +1225,13 @@ LoongArchTargetLowering::lowerINTRINSIC_WO_CHAIN(SDValue Op,
1247
1225
case Intrinsic::loongarch_lsx_vextrins_d:
1248
1226
case Intrinsic::loongarch_lasx_xvshuf4i_d:
1249
1227
case Intrinsic::loongarch_lasx_xvpermi_w:
1228
+ case Intrinsic::loongarch_lasx_xvpermi_q:
1250
1229
case Intrinsic::loongarch_lasx_xvbitseli_b:
1251
1230
case Intrinsic::loongarch_lasx_xvextrins_b:
1252
1231
case Intrinsic::loongarch_lasx_xvextrins_h:
1253
1232
case Intrinsic::loongarch_lasx_xvextrins_w:
1254
1233
case Intrinsic::loongarch_lasx_xvextrins_d:
1255
1234
return checkIntrinsicImmArg<8 >(Op, 3 , DAG);
1256
- case Intrinsic::loongarch_lasx_xvpermi_q:
1257
- return checkAndModifyXVPERMI_QIntrinsicImmArg (Op, DAG);
1258
1235
case Intrinsic::loongarch_lsx_vrepli_b:
1259
1236
case Intrinsic::loongarch_lsx_vrepli_h:
1260
1237
case Intrinsic::loongarch_lsx_vrepli_w:
0 commit comments