@@ -404,13 +404,20 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST)
404
404
typeIs (1 , s16)(Query));
405
405
});
406
406
407
- getActionDefinitionsBuilder (G_FCMP)
408
- .legalIf (all (typeIs (0 , sXLen ), typeIsScalarFPArith (1 , ST)))
409
- .clampScalar (0 , sXLen , sXLen );
407
+ auto &FCmpActions = getActionDefinitionsBuilder (G_FCMP).legalIf (
408
+ all (typeIs (0 , sXLen ), typeIsScalarFPArith (1 , ST)));
409
+ // TODO: Fold this into typeIsScalarFPArith.
410
+ if (ST.hasStdExtZfh ())
411
+ FCmpActions.legalFor ({sXLen , s16});
412
+ FCmpActions.clampScalar (0 , sXLen , sXLen );
410
413
411
414
// TODO: Support vector version of G_IS_FPCLASS.
412
- getActionDefinitionsBuilder (G_IS_FPCLASS)
413
- .customIf (all (typeIs (0 , s1), typeIsScalarFPArith (1 , ST)));
415
+ auto &FClassActions =
416
+ getActionDefinitionsBuilder (G_IS_FPCLASS)
417
+ .customIf (all (typeIs (0 , s1), typeIsScalarFPArith (1 , ST)));
418
+ // TODO: Fold this into typeIsScalarFPArith.
419
+ if (ST.hasStdExtZfh ())
420
+ FClassActions.customFor ({s1, s16});
414
421
415
422
getActionDefinitionsBuilder (G_FCONSTANT)
416
423
.legalIf (typeIsScalarFPArith (0 , ST))
0 commit comments