[PATCH] D141062: LangRef: Clarify behavior of llvm.is.fpclass with "denormal-fp-math"

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 5 07:36:05 PST 2023


arsenm created this revision.
arsenm added reviewers: sepavloff, scanon, kpn, andrew.w.kaylor, jcranmer-intel.
Herald added subscribers: kosarev, kristof.beyls, tpr.
Herald added a project: All.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

This does not read canonicalized values, which matches the behavior of
the basic DAG expansion using integer operations. There is a buggy
expansion using FP-operations if legal which needs to be adjusted to
account for this. We need to be aware of the denormal mode to switch
between is.fpclass calls and fcmp.

      

There's no real spec for denormal handling anywhere, but I believe
this is the most harmonious way to deal with the question considering
the requirement to not quiet input signaling nans.

      

This matches the behavior of MSVC's _fpclass and AMDGPU's
v_cmp_class_f32. fpclassify currently does not use this, and has
inconsistent behavior for denormals under DAZ on different platforms
(i.e. clang and gcc report FP_ZERO return FP_ZERO for a denormal under
DAZ, MSVC reports FP_SUBNORMAL).


https://reviews.llvm.org/D141062

Files:
  llvm/test/tools/llvm-reduce/Inputs/sleep.py
  llvm/test/tools/llvm-reduce/parallel-workitem-kill.ll
  llvm/tools/llvm-reduce/ReducerWorkItem.h
  llvm/tools/llvm-reduce/TestRunner.cpp
  llvm/tools/llvm-reduce/TestRunner.h
  llvm/tools/llvm-reduce/deltas/Delta.cpp
  llvm/tools/llvm-reduce/llvm-reduce.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141062.486574.patch
Type: text/x-patch
Size: 12096 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230105/50c90a17/attachment.bin>


More information about the llvm-commits mailing list