llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.11k stars 12.01k forks source link

Implement ISO/IEC JTC1 SC22 WG14 N1169 fixed-point types and arithmetic #43241

Open bevin-hansson opened 5 years ago

bevin-hansson commented 5 years ago
Bugzilla Link 43896
Version trunk
OS All
CC @bevin-hansson,@bjope,@PiJoules,@zygoloid

Extended Description

This is a ticket to track the remaining work required for supporting the ISO/IEC JTC1 SC22 WG14 N1169 fixed-point types and arithmetic.

Although this ticket is filed under Clang Frontend, the remaining work also includes patches to LLVM and other parts of Clang.

The currently estimated work that remains is:

LLVM:

Clang:

bjope commented 3 years ago

Looking at the earlier "remaining work" list several things should have been implemented by now.

I sent out a status report to cfe-dev/llvm-dev on March 15, 2021:

Status regarding support for fixed point numbers (and Embedded-C) in Clang/LLVM

During the years there have been a number of questions on cfe-dev and llvm-dev about support for fixed point arithmetic in LLVM.

In 2018 Leonard Chan wrote a proposal for adding fixed point number support in clang [1], accompanied by discussions about how to support the types in LLVM [2]. Since then a number of patches has been submitted and nowadays Clang/LLVM has lots of support for fixed point arithmetic, based on the Embedded-C draft [3].

A major part of chapter 4 in [3] should have been implemented by now. Here is a list of features implemented:

Future improvements:

References:

[1] - https://lists.llvm.org/pipermail/cfe-dev/2018-April/057756.html [2] - https://lists.llvm.org/pipermail/llvm-dev/2018-August/125433.html [3] - http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf [4] - https://gcc.gnu.org/wiki/FixedPointArithmetic [5] - https://github.com/itanium-cxx-abi/cxx-abi/issues/56