[PATCH] D145897: [RISCV] Merge getLoadFP*Imm into a single function.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 12 23:11:21 PDT 2023


craig.topper created this revision.
craig.topper added reviewers: reames, asb, luismarques, joshua-arch1.
Herald added subscribers: luke, VincentWu, vkmr, frasercrmck, evandro, 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.
craig.topper requested review of this revision.
Herald added subscribers: pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.

We currently have 3 functions and 3 lookup tables. This was the
most expediant and obvious way to fix several bugs.

This patch proposes to have a single function and single lookup
table. It uses APFloat::convert to convert from the half or double
to single precision. If the conversion doesn't have any errors or
lose any information we use the f32 table to finish the lookup.

This works correctly for all of the known buggy cases we've fixed
previously. I'll probably add a few more tests for nans and denormals
to be sure. Especially snans.

Posting for early feedback as to whether this makes sense to do.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D145897

Files:
  llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145897.504509.patch
Type: text/x-patch
Size: 13284 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230313/4be90767/attachment.bin>


More information about the llvm-commits mailing list