summaryrefslogtreecommitdiffstats
path: root/clang/test/Frontend/fixed_point_conversions.c
Commit message (Collapse)AuthorAgeFilesLines
* [Fixed Point Arithmetic] Fixed Point and Integer ConversionsLeonard Chan2019-03-061-185/+355
| | | | | | | | | This patch includes the necessary code for converting between a fixed point type and integer. This also includes constant expression evaluation for conversions with these types. Differential Revision: https://reviews.llvm.org/D56900 llvm-svn: 355462
* [Fixed Point Arithmetic] Fixed Point Addition Constant Expression EvaluationLeonard Chan2019-01-181-2/+36
| | | | | | | | This patch includes logic for constant expression evaluation of fixed point additions. Differential Revision: https://reviews.llvm.org/D55868 llvm-svn: 351593
* [Fixed Point Arithmetic] Fixed Point AdditionLeonard Chan2019-01-161-12/+10
| | | | | | | | | | | | | | | | | | This patch covers addition between fixed point types and other fixed point types or integers, using the conversion rules described in 4.1.4 of N1169. Usual arithmetic rules do not apply to binary operations when one of the operands is a fixed point type, and the result of the operation must be calculated with the full precision of the operands, so we should not perform any casting to a common type. This patch does not include constant expression evaluation for addition of fixed point types. That will be addressed in another patch since I think this one is already big enough. Differential Revision: https://reviews.llvm.org/D53738 llvm-svn: 351364
* [Fixed Point Arithmetic] Refactor fixed point castsBjorn Pettersson2018-10-261-127/+127
| | | | | | | | | | | | | | | | | | | | Summary: - Added names for some emitted values (such as "tobool" for the result of a cast to boolean). - Replaced explicit IRBuilder request for doing sext/zext/trunc by using CreateIntCast instead. - Simplify code for emitting satuation into one if-statement for clamping to max, and one if-statement for clamping to min. Reviewers: leonardchan, ebevhan Reviewed By: leonardchan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53707 llvm-svn: 345398
* [Fixed Point Arithmetic] FixedPointCastLeonard Chan2018-10-151-0/+283
This patch is a part of https://reviews.llvm.org/D48456 in an attempt to split them up. This contains the code for casting between fixed point types and other fixed point types. The method for converting between fixed point types is based off the convert() method in APFixedPoint. Differential Revision: https://reviews.llvm.org/D50616 llvm-svn: 344530
OpenPOWER on IntegriCloud