[PATCH] D101282: [SPE] Support constrained float operations on SPE
Qiu Chaofan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 26 03:08:34 PDT 2021
qiucf created this revision.
Herald added subscribers: kbarton, hiraditya, nemanjai.
qiucf requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This patch enables support on SPE for constrained fadd/fsub/fmul/fdiv/fma and compare operations. The motivation is https://bugs.llvm.org/show_bug.cgi?id=50070.
One thing I'm not pretty sure is the `fcmp` versus `fcmps`. On description of SPE float comparing instructions, I saw:
> If either operand contains a NaN, infinity, or a denorm and floating-point invalid exceptions are enabled in the SPEFSCR, the exception is taken. If the exception is not enabled, the comparison treats NaNs, infinities, and denorms as normalized numbers.
So I think `fcmps` should be the enabled one. (LangRef section <https://llvm.org/docs/LangRef.html#llvm-experimental-constrained-fcmp-and-llvm-experimental-constrained-fcmps-intrinsics>) But when I'm targeting SPE using clang, it generates IR with some `fcmp` and some other `fcmps`.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D101282
Files:
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/lib/Target/PowerPC/PPCInstrInfo.td
llvm/lib/Target/PowerPC/PPCInstrSPE.td
llvm/test/CodeGen/PowerPC/fp-strict-fcmp-spe.ll
llvm/test/CodeGen/PowerPC/fp-strict-round.ll
llvm/test/CodeGen/PowerPC/fp-strict.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101282.340468.patch
Type: text/x-patch
Size: 116626 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210426/7bf64946/attachment-0001.bin>
More information about the llvm-commits
mailing list