[all-commits] [llvm/llvm-project] 828cab: [RISCV] Adjust how -1.0 is handled in RISCVLoadFPI...

Craig Topper via All-commits all-commits at lists.llvm.org
Fri Mar 10 20:26:33 PST 2023


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

  Changed paths:
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h

  Log Message:
  -----------
  [RISCV] Adjust how -1.0 is handled in RISCVLoadFPImm. NFC

Instead of hardcoding the -1.0 exponent and mantissa separately from the
table, reuse the table entry for 1.0.

When searching the table we can change index 16 to index 0 if the sign
is negative. Or when indexing we can change index 0 to index 16 and remember
that we need to flip the sign.

I'm going to make another patch that has a f16 and f64 table and
this makes the code for those more similar.




More information about the All-commits mailing list