[all-commits] [llvm/llvm-project] 61ae2a: [RISCV] Store fli min/nan/inf in index form in RIS...

Craig Topper via All-commits all-commits at lists.llvm.org
Wed Mar 8 09:25:16 PST 2023


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

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

  Log Message:
  -----------
  [RISCV] Store fli min/nan/inf in index form in RISCVOperand.

Instead of converting to FP value, store them as Index using an
immediate operand.

Do the same for the explicit index form.

This avoids using the FP32 version of these special values as the
representation for fli.h and fli.d. inf/nan aren't so bad, but
"min" is problematic as the current implementation allows fli.d and
fli.h to accept the decimal version of the fp32 minimum value. I
will submit another patch to fix that.

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


  Commit: 73516b355c623baa7cd9c5be8ce672b3621e0652
      https://github.com/llvm/llvm-project/commit/73516b355c623baa7cd9c5be8ce672b3621e0652
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2023-03-08 (Wed, 08 Mar 2023)

  Changed paths:
    M llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h
    M llvm/test/CodeGen/RISCV/float-zfa.ll
    M llvm/test/MC/RISCV/zfa-invalid.s
    M llvm/test/MC/RISCV/zfa-valid.s

  Log Message:
  -----------
  [RISCV] Don't parse the decimal minimum value for fli.s/fli.d/fli.h.

There are a couple bugs in the current support for this:
-We do all the parsing in single precision so any value less than or
 equal to the minimum fp32 is accepted as the minimum value for f64.
-To support fp16 minimum value, getLoadFP32Imm has a special case, but
 that causes a miscompile in CodeGen.

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


Compare: https://github.com/llvm/llvm-project/compare/d23b9fa61d19...73516b355c62


More information about the All-commits mailing list