diff --git a/clang/include/clang/Basic/arm_mve.td b/clang/include/clang/Basic/arm_mve.td --- a/clang/include/clang/Basic/arm_mve.td +++ b/clang/include/clang/Basic/arm_mve.td @@ -79,10 +79,6 @@ (IRInt<"vmulh", [Vector]> $a, $b)>; def vrmulhq: Intrinsic $a, $b)>; -def vqdmulhq: Intrinsic $a, $b)>; -def vqrdmulhq: Intrinsic $a, $b)>; def vmullbq_int: Intrinsic $a, $b, 0)>; @@ -90,6 +86,12 @@ (IRInt<"vmull", [DblVector, Vector]> $a, $b, 1)>; } +let params = T.Signed in { +def vqdmulhq: Intrinsic $a, $b)>; +def vqrdmulhq: Intrinsic $a, $b)>; +} let params = T.Poly, overrideKindLetter = "p" in { def vmullbq_poly: Intrinsic $a, $b)>; } -multiclass VectorVectorArithmetic { +multiclass VectorVectorArithmetic { defm "" : IntrinsicMX $a, $b, - $pred, $inactive)>; + $pred, $inactive), + wantXVariant>; } multiclass VectorVectorArithmeticBitcast { @@ -179,16 +182,18 @@ defm vmaxq : VectorVectorArithmetic<"max_predicated">; defm vmulhq : VectorVectorArithmetic<"mulh_predicated">; defm vrmulhq : VectorVectorArithmetic<"rmulh_predicated">; - defm vqdmulhq : VectorVectorArithmetic<"qdmulh_predicated">; - defm vqrdmulhq : VectorVectorArithmetic<"qrdmulh_predicated">; - defm vqaddq : VectorVectorArithmetic<"qadd_predicated">; + defm vqaddq : VectorVectorArithmetic<"qadd_predicated", 0>; defm vhaddq : VectorVectorArithmetic<"hadd_predicated">; defm vrhaddq : VectorVectorArithmetic<"rhadd_predicated">; - defm vqsubq : VectorVectorArithmetic<"qsub_predicated">; + defm vqsubq : VectorVectorArithmetic<"qsub_predicated", 0>; defm vhsubq : VectorVectorArithmetic<"hsub_predicated">; defm vmullbq_int : DblVectorVectorArithmetic<"mull_int_predicated", (u32 0)>; defm vmulltq_int : DblVectorVectorArithmetic<"mull_int_predicated", (u32 1)>; } +let params = T.Signed in { + defm vqdmulhq : VectorVectorArithmetic<"qdmulh_predicated", 0>; + defm vqrdmulhq : VectorVectorArithmetic<"qrdmulh_predicated", 0>; +} let params = T.Poly, overrideKindLetter = "p" in { defm vmullbq_poly : DblVectorVectorArithmetic<"mull_poly_predicated", (u32 0)>; @@ -594,7 +599,7 @@ defm vshlq: IntrinsicMX - $v, $sh, $pred, $inactive), "_n">; + $v, $sh, $pred, $inactive), 1, "_n">; let pnt = PNT_NType in { def vshrq_n: Intrinsic - $v, $sh, (unsignedflag Scalar), $pred, $inactive), "_n">; + $v, $sh, (unsignedflag Scalar), $pred, $inactive), 1, "_n">; } } diff --git a/clang/include/clang/Basic/arm_mve_defs.td b/clang/include/clang/Basic/arm_mve_defs.td --- a/clang/include/clang/Basic/arm_mve_defs.td +++ b/clang/include/clang/Basic/arm_mve_defs.td @@ -440,6 +440,7 @@ // A wrapper to define both _m and _x versions of a predicated // intrinsic. multiclass IntrinsicMX { // The _m variant takes an initial parameter called $inactive, which @@ -449,15 +450,17 @@ def "_m" # nameSuffix: Intrinsic; - // The _x variant leaves off that parameter, and simply uses an - // undef value of the same type. - def "_x" # nameSuffix: - Intrinsic { - // Allow overriding of the polymorphic name type, because - // sometimes the _m and _x variants polymorph differently - // (typically because the type of the inactive parameter can be - // used as a disambiguator if it's present). - let pnt = pnt_x; + foreach unusedVar = !if(!eq(wantXVariant, 1), [1], []) in { + // The _x variant leaves off that parameter, and simply uses an + // undef value of the same type. + def "_x" # nameSuffix: + Intrinsic { + // Allow overriding of the polymorphic name type, because + // sometimes the _m and _x variants polymorph differently + // (typically because the type of the inactive parameter can be + // used as a disambiguator if it's present). + let pnt = pnt_x; + } } }