(IRInt<"vmulh", [Vector]> $a, $b)>;
def vrmulhq: Intrinsic<Vector, (args Vector:$a, Vector:$b),
(IRInt<"vrmulh", [Vector]> $a, $b)>;
-def vqdmulhq: Intrinsic<Vector, (args Vector:$a, Vector:$b),
- (IRInt<"vqdmulh", [Vector]> $a, $b)>;
-def vqrdmulhq: Intrinsic<Vector, (args Vector:$a, Vector:$b),
- (IRInt<"vqrdmulh", [Vector]> $a, $b)>;
def vmullbq_int: Intrinsic<DblVector, (args Vector:$a, Vector:$b),
(IRInt<"vmull", [DblVector, Vector]>
$a, $b, 0)>;
(IRInt<"vmull", [DblVector, Vector]>
$a, $b, 1)>;
}
+let params = T.Signed in {
+def vqdmulhq: Intrinsic<Vector, (args Vector:$a, Vector:$b),
+ (IRInt<"vqdmulh", [Vector]> $a, $b)>;
+def vqrdmulhq: Intrinsic<Vector, (args Vector:$a, Vector:$b),
+ (IRInt<"vqrdmulh", [Vector]> $a, $b)>;
+}
let params = T.Poly, overrideKindLetter = "p" in {
def vmullbq_poly: Intrinsic<DblVector, (args Vector:$a, Vector:$b),
(IRInt<"vabd", [Vector]> $a, $b)>;
}
-multiclass VectorVectorArithmetic<string operation> {
+multiclass VectorVectorArithmetic<string operation, int wantXVariant = 1> {
defm "" : IntrinsicMX<Vector, (args Vector:$a, Vector:$b,
Predicate:$pred),
(IRInt<operation, [Vector, Predicate]> $a, $b,
- $pred, $inactive)>;
+ $pred, $inactive),
+ wantXVariant>;
}
multiclass VectorVectorArithmeticBitcast<string operation> {
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)>;
defm vshlq: IntrinsicMX<Vector, (args Vector:$v, imm_0toNm1:$sh,
Predicate:$pred),
(IRInt<"shl_imm_predicated", [Vector, Predicate]>
- $v, $sh, $pred, $inactive), "_n">;
+ $v, $sh, $pred, $inactive), 1, "_n">;
let pnt = PNT_NType in {
def vshrq_n: Intrinsic<Vector, (args Vector:$v, imm_1toN:$sh),
defm vshrq: IntrinsicMX<Vector, (args Vector:$v, imm_1toN:$sh,
Predicate:$pred),
(IRInt<"shr_imm_predicated", [Vector, Predicate]>
- $v, $sh, (unsignedflag Scalar), $pred, $inactive), "_n">;
+ $v, $sh, (unsignedflag Scalar), $pred, $inactive), 1, "_n">;
}
}
defm vrshrq: IntrinsicMX<Vector, (args Vector:$v, imm_1toN:$sh,
Predicate:$pred),
(IRInt<"vrshr_imm_predicated", [Vector, Predicate]>
- $v, $sh, (unsignedflag Scalar), $pred, $inactive), "_n">;
+ $v, $sh, (unsignedflag Scalar), $pred, $inactive), 1, "_n">;
}
}
defm "": IntrinsicMX<DblVector, (args Vector:$v, imm_1toN:$sh,
Predicate:$pred),
(IRInt<"vshll_imm_predicated", [DblVector, Vector, Predicate]>
- $v, $sh, (unsignedflag Scalar), top, $pred, $inactive), "_n">;
+ $v, $sh, (unsignedflag Scalar), top, $pred, $inactive), 1, "_n">;
}
}
defm vshllbq : vshll_imm<0>;
// A wrapper to define both _m and _x versions of a predicated
// intrinsic.
multiclass IntrinsicMX<Type rettype, dag arguments, dag cg,
+ int wantXVariant = 1,
string nameSuffix = "",
PolymorphicNameType pnt_x = PNT_Type> {
// The _m variant takes an initial parameter called $inactive, which
def "_m" # nameSuffix:
Intrinsic<rettype, !con((args rettype:$inactive), arguments), cg>;
- // The _x variant leaves off that parameter, and simply uses an
- // undef value of the same type.
- def "_x" # nameSuffix:
- Intrinsic<rettype, arguments, (seq (undef rettype):$inactive, cg)> {
- // 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], []<int>) in {
+ // The _x variant leaves off that parameter, and simply uses an
+ // undef value of the same type.
+ def "_x" # nameSuffix:
+ Intrinsic<rettype, arguments, (seq (undef rettype):$inactive, cg)> {
+ // 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;
+ }
}
}