[all-commits] [llvm/llvm-project] c2bcb2: [RISCV] Print Zfa fli instruction FP values in a m...

Craig Topper via All-commits all-commits at lists.llvm.org
Fri Mar 10 07:58:27 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c2bcb21cc6be5dabaadd3bc2ecc5df98ab77b59e
      https://github.com/llvm/llvm-project/commit/c2bcb21cc6be5dabaadd3bc2ecc5df98ab77b59e
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.cpp
    M llvm/test/CodeGen/RISCV/double-zfa.ll
    M llvm/test/CodeGen/RISCV/float-zfa.ll
    M llvm/test/CodeGen/RISCV/half-zfa-fli.ll
    M llvm/test/MC/RISCV/zfa-valid.s

  Log Message:
  -----------
  [RISCV] Print Zfa fli instruction FP values in a more adaptive way.

Previously, we printed all constants in scientific notation with
6 digits of precision. This is not enough to accurately display
the smallest value, but increasing the precision would be too much
for other values.

This patch prints values with fractional bits using only as many digits as
needed. 1*2^-15 and 1*2^-16 will be printed in scientific notation while
the others are printed without scientific notation. The integer values
are printed with a single 0 after the decimal point.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D145645




More information about the All-commits mailing list