Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | [Fixed Point Arithmetic] Fixed Point Constant | Leonard Chan | 2018-08-06 | 1 | -1/+15 |
| | | | | | | | | | | This patch proposes an abstract type that represents fixed point numbers, similar to APInt or APSInt that was discussed in https://reviews.llvm.org/D48456#inline-425585. This type holds a value, scale, and saturation and is meant to perform intermediate calculations on constant fixed point values. Currently this class is used as a way for handling the conversions between fixed point numbers with different sizes and radixes. For example, if I'm casting from a signed _Accum to a saturated unsigned short _Accum, I will need to check the value of the signed _Accum to see if it fits into the short _Accum which involves getting and comparing against the max/min values of the short _Accum. The FixedPointNumber class currently handles the radix shifting and extension when converting to a signed _Accum. Differential Revision: https://reviews.llvm.org/D48661 llvm-svn: 339028 | ||||
* | Fixed test in prior build where FileCheck tried to match against | Leonard Chan | 2018-06-20 | 1 | -1/+1 |
| | | | | | | | `common` when declaring a global variable when we primarily care about the value assigned in the test. llvm-svn: 335159 | ||||
* | [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals | Leonard Chan | 2018-06-20 | 1 | -0/+113 |
This diff includes the logic for setting the precision bits for each primary fixed point type in the target info and logic for initializing a fixed point literal. Fixed point literals are declared using the suffixes ``` hr: short _Fract uhr: unsigned short _Fract r: _Fract ur: unsigned _Fract lr: long _Fract ulr: unsigned long _Fract hk: short _Accum uhk: unsigned short _Accum k: _Accum uk: unsigned _Accum ``` Errors are also thrown for illegal literal values ``` unsigned short _Accum u_short_accum = 256.0uhk; // expected-error{{the integral part of this literal is too large for this unsigned _Accum type}} ``` Differential Revision: https://reviews.llvm.org/D46915 llvm-svn: 335148 |