[all-commits] [llvm/llvm-project] d7c97e: [RISCV] Support llvm.lround intrinsics with i32 re...

Craig Topper via All-commits all-commits at lists.llvm.org
Wed Apr 12 13:23:15 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d7c97e9129096048f08d4232e5a76ac5853ce74e
      https://github.com/llvm/llvm-project/commit/d7c97e9129096048f08d4232e5a76ac5853ce74e
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2023-04-12 (Wed, 12 Apr 2023)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/test/CodeGen/RISCV/double-intrinsics.ll
    M llvm/test/CodeGen/RISCV/float-intrinsics.ll
    M llvm/test/CodeGen/RISCV/zfh-half-intrinsics.ll

  Log Message:
  -----------
  [RISCV] Support llvm.lround intrinsics with i32 return type on RV64.

It seems that flang uses this for "nint" and expects this i32
to work. On the C side we think lround should only work for "long"
which is i64 on rv64.

It's easy for us to support i32 when we have native FP instructions.
I fell back to i64 and truncated the result otherwise. The
documentation for lround says it returns an unspecified value if
doesn't fit in the integer type. I have no idea what flang is
expecting. I really only did the libcall to avoid forking a test.

Reviewed By: asb

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




More information about the All-commits mailing list