aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorXiao Zeng <zengxiao@eswincomputing.com>2024-05-15 16:23:16 +0800
committerXiao Zeng <zengxiao@eswincomputing.com>2024-05-18 11:18:16 +0800
commit7422e050f33dd9ee7dcd5a72c80b4e11d61995ce (patch)
tree6b809c97f00422627e8978fdafc39fc838ba8103 /gcc/ada
parent6da1d6efde2282e6582c00d1631e7457975ad998 (diff)
downloadgcc-7422e050f33dd9ee7dcd5a72c80b4e11d61995ce.zip
gcc-7422e050f33dd9ee7dcd5a72c80b4e11d61995ce.tar.gz
gcc-7422e050f33dd9ee7dcd5a72c80b4e11d61995ce.tar.bz2
RISC-V: Fix "Nan-box the result of movbf on soft-bf16"
1 According to unpriv-isa spec: <https://github.com/riscv/riscv-isa-manual/releases/download/riscv-isa-release-221bd85-2024-05-14/unpriv-isa-asciidoc.pdf> 1.1 "FMV.H.X moves the half-precision value encoded in IEEE 754-2008 standard encoding from the lower 16 bits of integer register rs1 to the floating-point register rd, NaN-boxing the result." 1.2 "FMV.W.X moves the single-precision value encoded in IEEE 754-2008 standard encoding from the lower 32 bits of integer register rs1 to the floating-point register rd. The bits are not modified in the transfer, and in particular, the payloads of non-canonical NaNs are preserved." 2 When (!TARGET_ZFHMIN == true && TARGET_HARD_FLOAT == true), instruction needs to be added to complete the Nan-box, as done in "RISC-V: Nan-box the result of movhf on soft-fp16": <https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=057dc349021660c40699fb5c98fd9cac8e168653> 3 Consider the "RISC-V: Nan-box the result of movbf on soft-bf16" in: <https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=ce51e6727c9d69bbab0e766c449e60fd41f5f2f9> It ignores that both hf16 and bf16 are 16bits floating-point. 4 zfbfmin -> zfhmin in: <https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=35224ead63732a3550ba4b1332c06e9dc7999c31> gcc/ChangeLog: * config/riscv/riscv.cc (riscv_legitimize_move): Optimize movbf with Nan-boxing value. * config/riscv/riscv.md (*movhf_softfloat_boxing): Expand movbf with Nan-boxing value. (*mov<HFBF:mode>_softfloat_boxing): Ditto. with Nan-boxing value. (*movbf_softfloat_boxing): Delete abandon pattern.
Diffstat (limited to 'gcc/ada')
0 files changed, 0 insertions, 0 deletions