[PATCH] D139120: APFloat: Add isSmallestNormalized predicate function

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 1 08:25:11 PST 2022


arsenm created this revision.
arsenm added reviewers: jcranmer-intel, power-llvm-team, PowerPC, scanon, sepavloff, andrew.w.kaylor, cameron.mcinally, kpn.
Herald added a subscriber: hiraditya.
Herald added a project: All.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

It was annoying to write the check for this in the one case I added,
and I'm planning on adding another, so add a convenient PatternMatch
like for other special case values.

      

I have no idea what is going on in the DoubleAPFloat case, I reversed
this from the makeSmallestNormalized test. Also could implement this
as *this == getSmallestNormalized() for less code, but this avoids the
construction of a temporary APFloat copy and follows the style of the
other functions.


https://reviews.llvm.org/D139120

Files:
  llvm/include/llvm/ADT/APFloat.h
  llvm/include/llvm/IR/PatternMatch.h
  llvm/lib/Support/APFloat.cpp
  llvm/unittests/ADT/APFloatTest.cpp
  llvm/unittests/IR/PatternMatch.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139120.479305.patch
Type: text/x-patch
Size: 7480 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221201/56e2f461/attachment.bin>


More information about the llvm-commits mailing list