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 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 33bae9c265 [AST] Fix handling of some edge cases in fixed-point division.
Division by zero was not being handled, and division of
-EPSILON / MAX did not perform rounding correctly.
2020-06-30 13:47:12 +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 94e8ec631d [AST] Add fixed-point division constant evaluation.
Reviewers: rjmccall, leonardchan, bjope

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73187
2020-06-26 13:38:11 +02:00
Bevin Hansson 0b9922e67a [CodeGen] Emit IR for fixed-point multiplication and division.
Reviewers: rjmccall, leonardchan

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73182
2020-04-08 14:33:04 +02:00