This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Add a basic pattern for FACGE and FACGT
ClosedPublic

Authored by dmgreen on Apr 10 2023, 8:31 AM.

Details

Summary

These instructions take the absolute of two values and perform a FCMGE/FCMGT between them. This patch adds some basic patterns for them.

Diff Detail

Event Timeline

dmgreen created this revision.Apr 10 2023, 8:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 10 2023, 8:31 AM
dmgreen requested review of this revision.Apr 10 2023, 8:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 10 2023, 8:31 AM

LGTM for the Vector Change.
Should this also be handled for the scalar equivalent as below

%abs1.i = tail call float @llvm.fabs.f32(float %a)
%abs1.i2 = tail call float @llvm.fabs.f32(float %b)
%cmp = fcmp oge float %abs1.i, %abs1.i2
%sext = sext i1 %cmp to i32
ret i32 %sext

Yeah I had seen the scalar instruction. Scalar usually uses fcmp instructions that set flags though, they don't set lanes to all-ones like vector instructions. We could use the scalar vacgt/vacge for the pattern you describe (so long as the result is moved from the vpr to a gpr), but I'm not sure that would come up a lot and should probably at least be handled as a separate patch.

bipmis accepted this revision.Apr 13 2023, 12:49 AM

LGTM

This revision is now accepted and ready to land.Apr 13 2023, 12:49 AM
This revision was landed with ongoing or failed builds.Apr 17 2023, 8:01 AM
This revision was automatically updated to reflect the committed changes.