[PATCH] D154933: [PowerPC] Implement llvm.set.rounding intrinsic

Qiu Chaofan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 11 02:22:09 PDT 2023


qiucf created this revision.
qiucf added reviewers: nemanjai, shchenz, PowerPC, sepavloff.
Herald added subscribers: steven.zhang, kbarton, hiraditya.
Herald added a project: All.
qiucf requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

According to LangRef, `llvm.set.rounding` sets rounding mode by integer argument:

> 0  - toward zero
> 1  - to nearest, ties to even
> 2  - toward positive infinity
> 3  - toward negative infinity
> 4  - to nearest, ties away from zero

While PowerPC ISA says:

> 0 - to nearest
> 1 - toward zero
> 2 - toward positive infinity
> 3 - toward negative infinity

This patch maps the argument and write into last two bits of FPSCR (rounding mode).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154933

Files:
  llvm/lib/Target/PowerPC/PPCISelLowering.cpp
  llvm/lib/Target/PowerPC/PPCISelLowering.h
  llvm/test/CodeGen/PowerPC/frounds.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154933.538974.patch
Type: text/x-patch
Size: 13543 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230711/8cd0c3db/attachment.bin>


More information about the llvm-commits mailing list