This is an archive of the discontinued LLVM Phabricator instance.

[Fixed Point Arithmetic] Checks for Precision Macros
AbandonedPublic

Authored by leonardchan on May 17 2018, 1:04 PM.

Details

Summary

This patch includes checks that the precision macros used for the fixed point fractional and integral bits meet the requirements for clause 6.2.6.3 in http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf.

Checks for any disagreements with the recommendations will throw warnings.

I also added my own warning that recommends the integral and fractional bits for _Accum types take up the width of the whole underlying integer to prevent having to mask out the padding bits when performing comparisons.

Diff Detail

Repository
rC Clang