diff options
author | Leonard Chan <leonardchan@google.com> | 2018-08-06 16:42:37 +0000 |
---|---|---|
committer | Leonard Chan <leonardchan@google.com> | 2018-08-06 16:42:37 +0000 |
commit | a677942d8a958576f56cacc41b1ec11744e626f3 (patch) | |
tree | e4a6d5f2173efd5813d3b8a682b18ab2cc69ceb6 /clang/unittests/Basic/VirtualFileSystemTest.cpp | |
parent | a489d1115887067370e23a3b5d4af7a42c81aa0c (diff) | |
download | llvm-a677942d8a958576f56cacc41b1ec11744e626f3.zip llvm-a677942d8a958576f56cacc41b1ec11744e626f3.tar.gz llvm-a677942d8a958576f56cacc41b1ec11744e626f3.tar.bz2 |
[Fixed Point Arithmetic] Fixed Point Constant
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
Diffstat (limited to 'clang/unittests/Basic/VirtualFileSystemTest.cpp')
0 files changed, 0 insertions, 0 deletions