This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Add isel for bitcasting between bfloat and half types.
ClosedPublic

Authored by paulwalker-arm on Jan 27 2022, 4:39 PM.

Diff Detail

Event Timeline

paulwalker-arm created this revision.Jan 27 2022, 4:39 PM
paulwalker-arm requested review of this revision.Jan 27 2022, 4:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 27 2022, 4:39 PM
mgabka added inline comments.Jan 28 2022, 12:43 AM
llvm/lib/Target/AArch64/AArch64InstrInfo.td
7549

shouldn't it be guarded by HasBF16 ?

paulwalker-arm added inline comments.Jan 28 2022, 2:40 AM
llvm/lib/Target/AArch64/AArch64InstrInfo.td
7549

No, generally only instructions need to be guarded by feature flags. This mirrors how we handle bf16 patterns for SVE for things like bitcasts, loads, stores and shuffles because for each of those cases, how the bits are interpreted is not significant.

If it turns out that for some reason the bf16 type is not legal then these patterns will just get ignored.

mgabka accepted this revision.Jan 28 2022, 3:12 AM

LGTM

This revision is now accepted and ready to land.Jan 28 2022, 3:12 AM
This revision was landed with ongoing or failed builds.Jan 29 2022, 3:29 AM
This revision was automatically updated to reflect the committed changes.