[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

Bevin Hansson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 31 00:21:55 PDT 2018


ebevhan added inline comments.


================
Comment at: lib/Basic/TargetInfo.cpp:45
+  AccumWidth = AccumAlign = 32;
+  LongAccumWidth = LongAccumAlign = 64;
   SuitableAlign = 64;
----------------
rsmith wrote:
> jfb wrote:
> > This seems weird because Targets which don't have these values for the non-Accum versions will have .e.g. `sizeof(short) != sizeof(short _Accum)`. Is there a point in ever having `_Accum` differ in size, width, and alignment from the underlying type? If not, can you set these values after the sub-target has specified its preferences?
> I'm uncomfortable about opting all targets into this behavior with these default values; this will result in an ABI break if later a target updates these to the correct values. A per-target `AccumSupported` flag would help substantially. But this is OK for the short term while you're still working on the feature.
> 
> We'll also need the target to inform us of the number of integer and fractional bits for each such type.
> We'll also need the target to inform us of the number of integer and fractional bits for each such type.

I believe the only one that is needed is for the number of fractional bits; the number of integer bits is implied by the difference between the type width and fractional bits. I think I mention this in one of the other patches.




Repository:
  rC Clang

https://reviews.llvm.org/D46084





More information about the cfe-commits mailing list