<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/74560>74560</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Support for fixed point arithmetic in libc
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
petrhosek
</td>
</tr>
</table>
<pre>
[Clang supports fixed point arithmetic](https://groups.google.com/g/llvm-dev/c/PKiQ0szeT8g) which was proposed in [ISO/IEC JTC1 SC22 WG14 N1169](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf). This document also proposes the `stdfix.h` header which introduces:
- [ ] Integer types used for the bits conversion functions
- [ ] Precision macros
- [ ] The `FX_FULL_PRECISION` pragma
- [ ] The fixed-point overflow pragmas
- [ ] Fixed-point arithmetic
- [ ] The fixed-point arithmetic operation support functions
- [ ] The fixed-point absolute value functions
- [ ] The fixed-point rounding functions
- [ ] The fixed-point `countls` functions
- [ ] The bitwise fixed-point to integer conversion functions
- [ ] The bitwise integer to fixed-point conversion functions
- [ ] Type-generic fixed-point functions
- [ ] Numeric conversion functions
- [ ] The `fprintf` function conversion specifiers for fixed-point type arguments
- [ ] The `fscanf` function conversion specifiers for fixed-point type arguments
To improve the usability of fixed point arithmetic in Clang, LLVM libc should provide the `stdfix.h` header and implement all the functions declared there.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVcty2zYU_RpwgxEHhEjKWnDRyGFHreu4tfrYZUDgkkQKAhg8pKhf3wEtNbZjufFMNlwQ5xzcF85l3stBAzSoeoeq64zFMBrXWAhuNB7-zjojjulwo5gesI_WGhc87uVnENgaqQNmToZxgiA5qq4RvRpDsB4tf0C0RbQdnInW54Mxg4Kcmyn9Q7RVaj8tBOwRbTmi7d3P8lfi_4Hd1YDoGh9GyUd8YB5bZ6zxILDUGFXvtvcfEG237zf4p92mwPcbSvGfPxYlvi2Kev1SAIfDITcW9MIHkRuX7v4UeIFo6zmlCTAU5QMO0VYY7hFtdVLLregRXed4N0qPheFxgpSv8uYclsdhBIxq4oPo5ed8RDXBIzAB7pSD1MEZETnMEZFrRE7fRUoHo-oab3WAARwORwsex5Rsb9ys3MngMTd6D85Lo3EfNQ_SaP9c484BlzNkYtyZr853D2G2f31sf7-5-Xj32_vN9n774TbFax0bJvYSY27z4qHNZg-uV-Zwgn91Q_sI-2gkZhTGl3W_YLGx4FhK7zxoz_N9VafzRsUAeM9UhLcwnYlaSD28hYNqwk3UQflUwf8hdjIcpH8qEEwajbnvl_t7SejMDOaJ5jcKHS0sBtDgJH9Cf4VzG6cZ_i2jeBq13jqpQ_-4PI_p3gKXvQTn52F_UpqjBczcMD-3i_KeM_291B--O4PlZJ3Zw_z2omedVDIcsekvGF4ypdkZEd3gm5s_fsFKdhz70UQlkkfspYBXLIJpka5UcDIWNWP_qywWwBVzINJvB3kmmqVYL9csg6ZYkeJquaZFkY0Nr8uakRLWdVmvunq5ho4I6KHqxVJUlGSyoYQuC0pqUpG6KvJiVdekBg71VV9WbIVKAhOTKk--nGwyk95HaFZlVZNMsQ6Un5cEpSlFRGlaF66ZbbyLg0clUdIH_0UgyKCguT-_5HMbXixi0syiU82z5SHDGLvT1kjC58VhnfkEPCDazmEmy54j_TcAAP__drU5gw">