[PATCH] D156649: [AArch64] Add some basic handling for bf16 constants.

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 00:12:01 PDT 2023


dmgreen created this revision.
dmgreen added reviewers: stuij, efriedma, SjoerdMeijer.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
dmgreen requested review of this revision.
Herald added a project: LLVM.

This adds some basic handling for bf16 constants, attempting to treat them a lot like fp16 constants where it can. Zero immediates get lowered to FMOVH0, others either get lowered to FMOVWHr(MOVi32imm) or use FMOVHi if they can. Without fp16 they get expanded. This may not always be optimal, but fixes a gap in our lowering. See https://github.com/llvm/llvm-project/blob/main/llvm/test/CodeGen/AArch64/f16-imm.ll for the equivalent fp16 test.


https://reviews.llvm.org/D156649

Files:
  llvm/lib/CodeGen/TargetLoweringBase.cpp
  llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
  llvm/lib/Target/AArch64/AArch64InstrFormats.td
  llvm/lib/Target/AArch64/AArch64InstrInfo.td
  llvm/test/CodeGen/AArch64/bf16-imm.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156649.545512.patch
Type: text/x-patch
Size: 7231 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230731/55de981c/attachment.bin>


More information about the llvm-commits mailing list