[PATCH] D134725: [ADT] Add support for more formats in APFixedPoint

Leonard Chan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 10:52:13 PDT 2022


leonardchan accepted this revision.
leonardchan added a comment.
This revision is now accepted and ready to land.

LGTM. Maybe give it a day before committing to see if Bevin has any comments.



================
Comment at: llvm/include/llvm/ADT/APFixedPoint.h:41-44
   FixedPointSemantics(unsigned Width, unsigned Scale, bool IsSigned,
                       bool IsSaturated, bool HasUnsignedPadding)
-      : Width(Width), Scale(Scale), IsSigned(IsSigned),
+      : FixedPointSemantics(Width, Lsb{-static_cast<int>(Scale)}, IsSigned,
+                            IsSaturated, HasUnsignedPadding) {}
----------------
Tyker wrote:
> leonardchan wrote:
> > I *think* it should be ok to just have one constructor that takes an int for the LsbWeight.
> C++ would not complain. but it would break the old API, and be hard to use correctly. whereas this change doesn't break the old API. but the syntax to build a FixedPointSemantics with an LsbWeight is heavier.
I see. SG


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

https://reviews.llvm.org/D134725



More information about the llvm-commits mailing list