[cfe-dev] Fixed Point Arithmetic Proposal

via cfe-dev cfe-dev at lists.llvm.org
Wed Apr 25 09:33:50 PDT 2018


> The C extensions to support embedded processors defined in chapter 4 of
> ISO/IEC TR 18037 [1] defines support for fixed-point arithmetic and fixed
> point data types in C.

Just curious, do you know the state of fixed-point arithmetic in C++?  I
recall a talk at CPPcon some while ago, but I don't know that it has made
any headway.

> All changes will also be made to Clang only. Expanding this into LLVM will
> be considered down the road.

"Expanding this into LLVM [later]" implies two things to me.  Might mean
more things to somebody else.

First, in the short term the front-end will emit all the scaling operations
explicitly.  Does "expanding this into LLVM" include making LLVM understand 
scaled types natively?  That sounds like a big project.

Second, in the short term the front-end will describe everything in terms of
the same-size same-signedness integer types.  I assume you will eventually
teach the debug-info metadata to describe scaled types?  DWARF has supported
scaled types since v3, I don't know whether CodeView does also.  Adding this
to LLVM should be relatively straightforward.

Thanks,
--paulr



More information about the cfe-dev mailing list