This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] Legalize scalar G_FMINNUM + G_FMAXNUM
ClosedPublic

Authored by paquette on Aug 17 2021, 5:33 PM.

Details

Summary

For subtargets with full FP16, this is legal for s16, s32, and s64. Without full FP16, it's legal for s32 and s64.

For s128, this is a libcall.

We also support some vector types, but for now, let's just support scalars.

Diff Detail

Event Timeline

paquette created this revision.Aug 17 2021, 5:33 PM
paquette requested review of this revision.Aug 17 2021, 5:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 17 2021, 5:33 PM
aemerson accepted this revision.Aug 17 2021, 11:10 PM
aemerson added inline comments.
llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
734–735

Is this actually needed? We don't support any non-pow-2 FP types right?

This revision is now accepted and ready to land.Aug 17 2021, 11:10 PM
aemerson requested changes to this revision.Aug 17 2021, 11:10 PM
This revision now requires changes to proceed.Aug 17 2021, 11:10 PM
paquette added inline comments.Aug 18 2021, 10:32 AM
llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
734–735

Yeah actually I think all we need to do is widen from s16 if full 16-bit FP support isn't available.

https://godbolt.org/z/3n4WoMaWd

paquette updated this revision to Diff 367268.Aug 18 2021, 11:19 AM

Replace pow-2 widening stuff with minScalar(0, MinFPScalar).

aemerson accepted this revision.Aug 18 2021, 12:03 PM
This revision is now accepted and ready to land.Aug 18 2021, 12:03 PM