This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Add a tablegen pattern for SQXTN2.
ClosedPublic

Authored by labrinea on Dec 21 2021, 5:58 AM.

Details

Summary

Converts concat_vectors(Vd, trunc(smin(smax Vm, -2^n), 2^n-1) to sqxtn2(Vd, Vm). Deliberately not handling v2i64->v2i32 as the min/max nodes are not legal (same as https://reviews.llvm.org/D103263).

Diff Detail

Event Timeline

labrinea created this revision.Dec 21 2021, 5:58 AM
labrinea requested review of this revision.Dec 21 2021, 5:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 21 2021, 5:58 AM
labrinea added inline comments.Dec 21 2021, 7:45 AM
llvm/test/CodeGen/AArch64/sqxtn2.ll
4 ↗(On Diff #395659)

Will rename the file to arm64-sqxtn2-combine.ll for consistency with the other patches.

SjoerdMeijer accepted this revision.Dec 23 2021, 5:57 AM

LGTM

llvm/lib/Target/AArch64/AArch64InstrInfo.td
4382

Please add a comment describing the pattern that we are matching would be good, like the patterns above (it would help with reading "magic constants" VImm7F etc.)

This revision is now accepted and ready to land.Dec 23 2021, 5:57 AM
This revision was landed with ongoing or failed builds.Dec 23 2021, 7:39 AM
This revision was automatically updated to reflect the committed changes.