[PATCH] D148077: [RISCV][NFC] Add test case for accept hexadecimal floating-point for fli instructions

Kito Cheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 01:27:49 PDT 2023


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

Zfa provide fli instruction to load a floating point immediate value,
and some of those are not easy to write and read by human, so
hexadecimal floating-point format should be a good alternative way to write:

Consider this case: 1^-16 = 1.52587890625e-05 (decimal) vs 0x1p-16 (hexadecimal)

The hexadecimal format is easier to write for human.

Fortunately hexadecimal floating-point constants already supported in
C99, so actually we don't need to add any extra code to support that.

This patch added test case for demonstrate we support that and also make
sure this will be supported in future.

I also gonna to talk with ISA folks to adding hexadecimal floating-point
to the ISA spec, so that user will know fli accept value in this format.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D148077

Files:
  llvm/test/MC/RISCV/zfa-valid.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148077.512686.patch
Type: text/x-patch
Size: 19103 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230412/51df6f47/attachment.bin>


More information about the llvm-commits mailing list