@@ -89,13 +89,6 @@ AArch64LegalizerInfo::AArch64LegalizerInfo(const AArch64Subtarget &ST)
89
89
const bool HasFP16 = ST.hasFullFP16 ();
90
90
const LLT &MinFPScalar = HasFP16 ? s16 : s32;
91
91
92
- // A legality predicate that returns true if the subtarget has FP16 support.
93
- // To be used in combination with other predicates, e.g:
94
- // .legalIf(all(hasFP16(), typeInSet(0, {v8s16, v4s16})))
95
- const auto hasFP16 = [=]() -> LegalityPredicate {
96
- return [=](const LegalityQuery &) { return HasFP16; };
97
- };
98
-
99
92
const bool HasCSSC = ST.hasCSSC ();
100
93
const bool HasRCPC3 = ST.hasRCPC3 ();
101
94
@@ -267,10 +260,10 @@ AArch64LegalizerInfo::AArch64LegalizerInfo(const AArch64Subtarget &ST)
267
260
268
261
getActionDefinitionsBuilder (G_FABS)
269
262
.legalFor ({MinFPScalar, s32, s64, v2s32, v4s32, v2s64})
270
- .legalIf (all ( hasFP16 (), typeInSet ( 0 , {v8s16, v4s16})))
271
- // TODO: Lower supports 128-bit types but G_AND generated by Lower does
272
- // not yet.
273
- // When it does, we can remove scalarizeIf.
263
+ .legalIf ([=]( const LegalityQuery &Query) {
264
+ const auto &Ty = Query. Types [ 0 ];
265
+ return (Ty == v8s16 || Ty == v4s16) && HasFP16;
266
+ })
274
267
.scalarizeIf (scalarOrEltWiderThan (0 , 64 ), 0 )
275
268
.lowerIf (scalarOrEltWiderThan (0 , 64 ))
276
269
.minScalarOrElt (0 , MinFPScalar)
0 commit comments