[cfp-interest 3526] Proposal: Fixed point TS revisit
LNT
lntue.h at gmail.com
Tue Jun 10 22:00:56 PDT 2025
Hello everyone,
As Jim mentioned in last month's CFP meeting, I would like to propose to
revisit and modernize the fixed point types as a C extension.
To provide context on why we are interested in this effort: several years
ago, several embedded system teams in Google expressed their interest in
using the fixed point types as a replacement for soft floats in their
projects. After some initial investigation, we found the ISO/IEC TR
18037:2008 - Programming languages - C - Extensions to support embedded
processors <https://www.iso.org/standard/51126.html> (or N1169
<https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf>), and we set
ourselves to provide an implementation of the TR in Clang/LLVM (cfe-dev
<https://lists.llvm.org/pipermail/cfe-dev/2018-April/057756.html>, llvm-dev
<https://groups.google.com/g/llvm-dev/c/Yym8b13qLvQ?e=48417069>). This
feature is now available in clang 19 or after, under the `-ffixed-point`
flag. And the library part of the standard is available in LLVM libc
<https://libc.llvm.org/headers/stdfix.html> (built with clang-19 or after).
This has been used successfully to replace soft float usages and improved
both code size and performance by several embedded projects in Google. I
have attached slides by my colleague, Leonard Chan, demonstrating its
improvement over soft floats when applied properly.
As we implement and extend the fixed point TR more, its datedness and
complexity are more and more apparent. And we think that it would be much
better to revisit and modernize the TR, making it more in line with the
modern C23 and C2y styles.
Thanks,
Tue Ly
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20250611/483c3632/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Fixed Point Arithmetic + Hearables (Public).pdf
Type: application/pdf
Size: 437182 bytes
Desc: not available
URL: <http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20250611/483c3632/attachment-0001.pdf>
More information about the cfp-interest
mailing list