Commit Graph

6 Commits

Author SHA1 Message Date
Bevin Hansson 808ac54645 [Fixed Point] Use FixedPointBuilder to codegen fixed-point IR.
This changes the methods in CGExprScalar to use
FixedPointBuilder to generate IR for fixed-point
conversions and operations.

Since FixedPointBuilder emits padded operations slightly
differently than the original code, some tests change.

Reviewed By: leonardchan

Differential Revision: https://reviews.llvm.org/D86282
2020-08-24 14:37:07 +02:00
Bevin Hansson 2bac004c90 Add triples to fixed-point tests which lacked them.
This caused failures on clang-x390x-linux.
2020-08-20 15:36:15 +02:00
Bevin Hansson 44ebc2c8eb Refactor most of the fixed-point tests.
The tests were not written with update_cc_test_checks
in mind, which make them difficult to update. Fix this.

Also, some of the consteval tests were outright broken,
since the CHECK lines were wrong.

Other than this, the semantics of the tests are preserved.
2020-08-20 10:30:05 +02:00
Bevin Hansson fefa34faf5 [CodeGen] Use the common semantic for fixed-point codegen, not the result semantic.
Summary:
Using the result semantic is wrong in some cases, such as
unsigned fixed-point + signed integer. In this case, the
result semantic is unsigned and the common semantic is
signed.

Reviewers: leonardchan

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D82662
2020-06-29 16:22:29 +02:00
Bevin Hansson eccf7fc7b3 [AST] Add fixed-point subtraction constant evaluation.
Reviewers: rjmccall, leonardchan

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73185
2020-06-26 13:38:11 +02:00
Leonard Chan 837da5d3ec [Fixed Point Arithmetic] Fixed Point Subtraction
This patch covers subtraction between fixed point types and other fixed point
types or integers, using the conversion rules described in 4.1.4 of N1169.

Differential Revision: https://reviews.llvm.org/D55844

llvm-svn: 351371
2019-01-16 19:53:50 +00:00