[PATCH] D87220: [PowerPC] Fix STRICT_FRINT/STRICT_FNEARBYINT lowering

Qiu Chaofan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 6 21:54:21 PDT 2020


qiucf created this revision.
qiucf added reviewers: hfinkel, nemanjai, jsji, kbarton, uweigand, kpn, steven.zhang, PowerPC.
Herald added subscribers: llvm-commits, shchenz, hiraditya.
Herald added a project: LLVM.
qiucf requested review of this revision.

In standard C library, both `rint` and `nearbyint` returns rounding result in current rounding mode. But `nearbyint` never raises //inexact exception//. On PowerPC, `x(v|s)r(d|s)pic` may modify FPSCR XX, raising inexact exception. So we can't select constrained `fnearbyint` into `xvrdpic`.

One exception here is `xsrqpi`, which will not raise inexact exception, so `fnearbyint f128` is okay here.


https://reviews.llvm.org/D87220

Files:
  llvm/lib/Target/PowerPC/PPCISelLowering.cpp
  llvm/lib/Target/PowerPC/PPCInstrVSX.td
  llvm/test/CodeGen/PowerPC/fp-strict-round.ll
  llvm/test/CodeGen/PowerPC/vector-constrained-fp-intrinsics.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87220.290177.patch
Type: text/x-patch
Size: 21441 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200907/97459a24/attachment.bin>


More information about the llvm-commits mailing list