[PATCH] D151663: [RISCV] Implement support for bf16 truncate/extend on hard FP targets

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 29 13:38:13 PDT 2023


asb created this revision.
asb added reviewers: craig.topper, reames.
Herald added subscribers: jobnoorman, luke, wingo, pmatos, VincentWu, vkmr, frasercrmck, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya, arichardson.
Herald added a project: All.
asb requested review of this revision.
Herald added subscribers: pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.

For the same reasons as D151284 <https://reviews.llvm.org/D151284>, this requires custom lowering of the truncate libcall on hard float ABIs (the normal libcall code path is used on soft ABIs).

The extend operation is implemented by a shift just as in the standard legalisation, but needs to be custom lowered because i32 isn't a legal type on RV64.

This patch aims to make the minimal changes that result in correct codegen for the bfloat.ll tests.


https://reviews.llvm.org/D151663

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/test/CodeGen/RISCV/bfloat.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151663.526477.patch
Type: text/x-patch
Size: 24714 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230529/8f4a3069/attachment.bin>


More information about the llvm-commits mailing list