@@ -107,7 +107,7 @@ def HasRCPC_IMMO : Predicate<"Subtarget->hasRCPC_IMMO()">,
107
107
108
108
def HasFPARMv8 : Predicate<"Subtarget->hasFPARMv8()">,
109
109
AssemblerPredicateWithAll<(all_of FeatureFPARMv8), "fp-armv8">;
110
- def HasNEON : Predicate<"Subtarget->hasNEON ()">,
110
+ def HasNEON : Predicate<"Subtarget->isNeonAvailable ()">,
111
111
AssemblerPredicateWithAll<(all_of FeatureNEON), "neon">;
112
112
def HasSM4 : Predicate<"Subtarget->hasSM4()">,
113
113
AssemblerPredicateWithAll<(all_of FeatureSM4), "sm4">;
@@ -235,11 +235,10 @@ def HasSMEF16F16orSMEF8F16
235
235
"sme-f16f16 or sme-f8f16">;
236
236
237
237
// A subset of NEON instructions are legal in Streaming SVE execution mode,
238
- // they should be enabled if either has been specified.
239
- def HasNEONorSME
240
- : Predicate<"Subtarget->hasNEON() || Subtarget->hasSME()">,
241
- AssemblerPredicateWithAll<(any_of FeatureNEON, FeatureSME),
242
- "neon or sme">;
238
+ // so don't need the additional check for 'isNeonAvailable'.
239
+ def HasNEONandIsStreamingSafe
240
+ : Predicate<"Subtarget->hasNEON()">,
241
+ AssemblerPredicateWithAll<(any_of FeatureNEON), "neon">;
243
242
def HasRCPC : Predicate<"Subtarget->hasRCPC()">,
244
243
AssemblerPredicateWithAll<(all_of FeatureRCPC), "rcpc">;
245
244
def HasAltNZCV : Predicate<"Subtarget->hasAlternativeNZCV()">,
@@ -323,8 +322,6 @@ def NoUseScalarIncVL : Predicate<"!Subtarget->useScalarIncVL()">;
323
322
324
323
def UseSVEFPLD1R : Predicate<"!Subtarget->noSVEFPLD1R()">;
325
324
326
- def IsNeonAvailable : Predicate<"Subtarget->isNeonAvailable()">;
327
-
328
325
def AArch64LocalRecover : SDNode<"ISD::LOCAL_RECOVER",
329
326
SDTypeProfile<1, 1, [SDTCisSameAs<0, 1>,
330
327
SDTCisInt<1>]>>;
@@ -1350,7 +1347,7 @@ def : Pat<(v2f32 (int_aarch64_neon_bfdot
1350
1347
VectorIndexS:$idx)>;
1351
1348
}
1352
1349
1353
- let Predicates = [HasNEONorSME , HasBF16] in {
1350
+ let Predicates = [HasNEONandIsStreamingSafe , HasBF16] in {
1354
1351
def BFCVT : BF16ToSinglePrecision<"bfcvt">;
1355
1352
// Round FP32 to BF16.
1356
1353
def : Pat<(bf16 (any_fpround (f32 FPR32:$Rn))), (BFCVT $Rn)>;
@@ -5789,9 +5786,9 @@ defm FACGT : SIMDThreeScalarFPCmp<1, 1, 0b101, "facgt",
5789
5786
defm FCMEQ : SIMDThreeScalarFPCmp<0, 0, 0b100, "fcmeq", AArch64fcmeq>;
5790
5787
defm FCMGE : SIMDThreeScalarFPCmp<1, 0, 0b100, "fcmge", AArch64fcmge>;
5791
5788
defm FCMGT : SIMDThreeScalarFPCmp<1, 1, 0b100, "fcmgt", AArch64fcmgt>;
5792
- defm FMULX : SIMDFPThreeScalar<0, 0, 0b011, "fmulx", int_aarch64_neon_fmulx, HasNEONorSME >;
5793
- defm FRECPS : SIMDFPThreeScalar<0, 0, 0b111, "frecps", int_aarch64_neon_frecps, HasNEONorSME >;
5794
- defm FRSQRTS : SIMDFPThreeScalar<0, 1, 0b111, "frsqrts", int_aarch64_neon_frsqrts, HasNEONorSME >;
5789
+ defm FMULX : SIMDFPThreeScalar<0, 0, 0b011, "fmulx", int_aarch64_neon_fmulx, HasNEONandIsStreamingSafe >;
5790
+ defm FRECPS : SIMDFPThreeScalar<0, 0, 0b111, "frecps", int_aarch64_neon_frecps, HasNEONandIsStreamingSafe >;
5791
+ defm FRSQRTS : SIMDFPThreeScalar<0, 1, 0b111, "frsqrts", int_aarch64_neon_frsqrts, HasNEONandIsStreamingSafe >;
5795
5792
defm SQADD : SIMDThreeScalarBHSD<0, 0b00001, "sqadd", int_aarch64_neon_sqadd>;
5796
5793
defm SQDMULH : SIMDThreeScalarHS< 0, 0b10110, "sqdmulh", int_aarch64_neon_sqdmulh>;
5797
5794
defm SQRDMULH : SIMDThreeScalarHS< 1, 0b10110, "sqrdmulh", int_aarch64_neon_sqrdmulh>;
@@ -5820,7 +5817,7 @@ let Predicates = [HasRDM] in {
5820
5817
5821
5818
defm : FMULScalarFromIndexedLane0Patterns<"FMULX", "16", "32", "64",
5822
5819
int_aarch64_neon_fmulx,
5823
- [HasNEONorSME ]>;
5820
+ [HasNEONandIsStreamingSafe ]>;
5824
5821
5825
5822
let Predicates = [HasNEON] in {
5826
5823
def : InstAlias<"cmls $dst, $src1, $src2",
@@ -5894,9 +5891,9 @@ defm FCVTPU : SIMDFPTwoScalar< 1, 1, 0b11010, "fcvtpu">;
5894
5891
def FCVTXNv1i64 : SIMDInexactCvtTwoScalar<0b10110, "fcvtxn">;
5895
5892
defm FCVTZS : SIMDFPTwoScalar< 0, 1, 0b11011, "fcvtzs">;
5896
5893
defm FCVTZU : SIMDFPTwoScalar< 1, 1, 0b11011, "fcvtzu">;
5897
- defm FRECPE : SIMDFPTwoScalar< 0, 1, 0b11101, "frecpe", HasNEONorSME >;
5898
- defm FRECPX : SIMDFPTwoScalar< 0, 1, 0b11111, "frecpx", HasNEONorSME >;
5899
- defm FRSQRTE : SIMDFPTwoScalar< 1, 1, 0b11101, "frsqrte", HasNEONorSME >;
5894
+ defm FRECPE : SIMDFPTwoScalar< 0, 1, 0b11101, "frecpe">;
5895
+ defm FRECPX : SIMDFPTwoScalar< 0, 1, 0b11111, "frecpx">;
5896
+ defm FRSQRTE : SIMDFPTwoScalar< 1, 1, 0b11101, "frsqrte">;
5900
5897
defm NEG : SIMDTwoScalarD< 1, 0b01011, "neg",
5901
5898
UnOpFrag<(sub immAllZerosV, node:$LHS)> >;
5902
5899
defm SCVTF : SIMDFPTwoScalarCVT< 0, 0, 0b11101, "scvtf", AArch64sitof>;
@@ -5915,7 +5912,7 @@ def : Pat<(v1i64 (AArch64vashr (v1i64 V64:$Rn), (i32 63))),
5915
5912
(CMLTv1i64rz V64:$Rn)>;
5916
5913
5917
5914
// Round FP64 to BF16.
5918
- let Predicates = [HasNEONorSME , HasBF16] in
5915
+ let Predicates = [HasNEONandIsStreamingSafe , HasBF16] in
5919
5916
def : Pat<(bf16 (any_fpround (f64 FPR64:$Rn))),
5920
5917
(BFCVT (FCVTXNv1i64 $Rn))>;
5921
5918
@@ -6016,7 +6013,7 @@ def : Pat<(v2f64 (AArch64frsqrts (v2f64 FPR128:$Rn), (v2f64 FPR128:$Rm))),
6016
6013
// Some float -> int -> float conversion patterns for which we want to keep the
6017
6014
// int values in FP registers using the corresponding NEON instructions to
6018
6015
// avoid more costly int <-> fp register transfers.
6019
- let Predicates = [HasNEON ] in {
6016
+ let Predicates = [HasNEONandIsStreamingSafe ] in {
6020
6017
def : Pat<(f64 (any_sint_to_fp (i64 (any_fp_to_sint f64:$Rn)))),
6021
6018
(SCVTFv1i64 (i64 (FCVTZSv1i64 f64:$Rn)))>;
6022
6019
def : Pat<(f32 (any_sint_to_fp (i32 (any_fp_to_sint f32:$Rn)))),
@@ -6026,7 +6023,7 @@ def : Pat<(f64 (any_uint_to_fp (i64 (any_fp_to_uint f64:$Rn)))),
6026
6023
def : Pat<(f32 (any_uint_to_fp (i32 (any_fp_to_uint f32:$Rn)))),
6027
6024
(UCVTFv1i32 (i32 (FCVTZUv1i32 f32:$Rn)))>;
6028
6025
6029
- let Predicates = [HasFullFP16] in {
6026
+ let Predicates = [HasNEONandIsStreamingSafe, HasFullFP16] in {
6030
6027
def : Pat<(f16 (any_sint_to_fp (i32 (any_fp_to_sint f16:$Rn)))),
6031
6028
(SCVTFv1i16 (f16 (FCVTZSv1f16 f16:$Rn)))>;
6032
6029
def : Pat<(f16 (any_uint_to_fp (i32 (any_fp_to_uint f16:$Rn)))),
@@ -6118,7 +6115,7 @@ def : Pat <(f64 (uint_to_fp (i32
6118
6115
(LDURSi GPR64sp:$Rn, simm9:$offset), ssub))>;
6119
6116
// 64-bits -> double are handled in target specific dag combine:
6120
6117
// performIntToFpCombine.
6121
- } // let Predicates = [HasNEON ]
6118
+ } // let Predicates = [HasNEONandIsStreamingSafe ]
6122
6119
6123
6120
//===----------------------------------------------------------------------===//
6124
6121
// Advanced SIMD three different-sized vector instructions.
@@ -8379,7 +8376,7 @@ def : Ld1Lane64IdxOpPat<extloadi8, VectorIndexH, v4i16, i32, LD1i8, VectorIndexH
8379
8376
8380
8377
// Same as above, but the first element is populated using
8381
8378
// scalar_to_vector + insert_subvector instead of insert_vector_elt.
8382
- let Predicates = [IsNeonAvailable ] in {
8379
+ let Predicates = [HasNEON ] in {
8383
8380
class Ld1Lane128FirstElm<ValueType ResultTy, ValueType VecTy,
8384
8381
SDPatternOperator ExtLoad, Instruction LD1>
8385
8382
: Pat<(ResultTy (scalar_to_vector (i32 (ExtLoad GPR64sp:$Rn)))),
0 commit comments