[PATCH] D147195: [RISCV] Support llvm.lround intrinsics with i32 return type on RV64.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 19:12:07 PDT 2023


craig.topper created this revision.
craig.topper added reviewers: reames, asb, kito-cheng.
Herald added subscribers: jobnoorman, luke, VincentWu, vkmr, frasercrmck, evandro, luismarques, apazos, sameer.abuasal, pengfei, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya, arichardson.
Herald added a reviewer: sscalpone.
Herald added a project: All.
craig.topper requested review of this revision.
Herald added subscribers: pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.

It seems that flang expects this to work. Even though long isn't
i32 on RV64 or most X86-64 platforms.

It's easy for us to support 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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147195

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147195.509532.patch
Type: text/x-patch
Size: 6583 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230330/9d8b22fa/attachment.bin>


More information about the llvm-commits mailing list