@@ -404,38 +404,28 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST)
404
404
typeIs (1 , s16)(Query));
405
405
});
406
406
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 );
407
+ getActionDefinitionsBuilder (G_FCMP)
408
+ .legalIf (all (typeIs (0 , sXLen ), typeIsScalarFPArith (1 , ST)))
409
+ .clampScalar (0 , sXLen , sXLen );
413
410
414
411
// TODO: Support vector version of G_IS_FPCLASS.
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});
412
+ getActionDefinitionsBuilder (G_IS_FPCLASS)
413
+ .customIf (all (typeIs (0 , s1), typeIsScalarFPArith (1 , ST)));
421
414
422
415
getActionDefinitionsBuilder (G_FCONSTANT)
423
416
.legalIf (typeIsScalarFPArith (0 , ST))
424
417
.lowerFor ({s32, s64});
425
418
426
- auto &FPToIActions =
427
- getActionDefinitionsBuilder ({G_FPTOSI, G_FPTOUI})
428
- .legalIf (all (typeInSet (0 , {s32, sXLen }), typeIsScalarFPArith (1 , ST)));
429
- if (ST.hasStdExtZfh ())
430
- FPToIActions.legalFor ({{s32, s16}, {sXLen , s16}});
431
- FPToIActions.widenScalarToNextPow2 (0 ).clampScalar (0 , s32, sXLen ).libcall ();
432
-
433
- auto &IToFPActions =
434
- getActionDefinitionsBuilder ({G_SITOFP, G_UITOFP})
435
- .legalIf (all (typeIsScalarFPArith (0 , ST), typeInSet (1 , {s32, sXLen })));
436
- if (ST.hasStdExtZfh ())
437
- IToFPActions.legalFor ({{s16, s32}, {s16, sXLen }});
438
- IToFPActions.widenScalarToNextPow2 (1 ).clampScalar (1 , s32, sXLen );
419
+ getActionDefinitionsBuilder ({G_FPTOSI, G_FPTOUI})
420
+ .legalIf (all (typeInSet (0 , {s32, sXLen }), typeIsScalarFPArith (1 , ST)))
421
+ .widenScalarToNextPow2 (0 )
422
+ .clampScalar (0 , s32, sXLen )
423
+ .libcall ();
424
+
425
+ getActionDefinitionsBuilder ({G_SITOFP, G_UITOFP})
426
+ .legalIf (all (typeIsScalarFPArith (0 , ST), typeInSet (1 , {s32, sXLen })))
427
+ .widenScalarToNextPow2 (1 )
428
+ .clampScalar (1 , s32, sXLen );
439
429
440
430
// FIXME: We can do custom inline expansion like SelectionDAG.
441
431
// FIXME: Legal with Zfa.
0 commit comments