[PATCH] D138696: [PowerPC] Exploit test data class instruction for isinf/iszero

Qiu Chaofan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 26 18:24:13 PST 2022


qiucf added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:14291
+      else if (APF.isNegZero())
+        Flag = fcNegZero;
+      if (Flag)
----------------
shchenz wrote:
> I have same concern as previous patch: any reason for the nan and negdenormal/posdenormal are excluded here?
`isnan` uses cond code `SETUO` against arbitary non-nan number, whose codegen is also a single `fcmpu`.

C std or LLVM intrinsics don't have `issubnormal/isdenormal`. For `isnormal`, the pattern is `(abs(x) uge CONSTANT1) and (abs(x) olt CONSTANT2)`. Optimizing it in backend may be profitable, but (1) is out of scope of this patch; (2) clang will directly generate `is_fpclass` call in the future


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138696/new/

https://reviews.llvm.org/D138696



More information about the llvm-commits mailing list