8 Commits

Author SHA1 Message Date
Tyker
adf2972610 Revert "Remove sign comparaison warning in APFixedPointTest.cpp"
has already been fixed

This reverts commit 1a60a35769bcb2554a4527048b13cf75ad4022d6.
2022-10-14 13:40:12 -07:00
Tyker
1a60a35769 Remove sign comparaison warning in APFixedPointTest.cpp 2022-10-14 13:39:18 -07:00
Nico Weber
34bbe6548d Fix a -Wsign-compare warning 2022-10-14 15:19:30 -04:00
Tyker
2c7b7eca85 [ADT] Fix Incorrect rounding for APFixedPoint::getIntPart 2022-10-14 11:01:20 -07:00
Tyker
1654b22ac0 [ADT] Add support for more formats in APFixedPoint
Prior to this patch FixedPointSemantics and APFixedPoint only support semantics where
the Scale larger or equal to zero and the Width is larger or equal to the Scale.
This patch removes both those requirements while staying API compatible.
2022-10-06 17:55:31 +02:00
Antonio Frighetto
b652815236 [Fixed Point] Fix C++20 compilation error
Due to how operator== changed after operator<=> landing in C++20
(error: use of overloaded operator '==' is ambiguous (with operand
types 'const llvm::APSInt' and 'const unsigned long')),
CheckIntPartMin/CheckIntPartMax interfaces are now leveraging
APSInt::compareValues.

Differential Revision: https://reviews.llvm.org/D129567
2022-07-13 08:36:04 -04:00
Bevin Hansson
dd3014f3dc [Fixed Point] Add floating point methods to APFixedPoint.
This adds methods to APFixedPoint for converting to and from
floating point values.

Differential Revision: https://reviews.llvm.org/D85961
2020-10-09 10:27:42 +02:00
Bevin Hansson
1a995a0af3 [ADT] Move FixedPoint.h from Clang to LLVM.
This patch moves FixedPointSemantics and APFixedPoint
from Clang to LLVM ADT.

This will make it easier to use the fixed-point
classes in LLVM for constructing an IR builder for
fixed-point and for reusing the APFixedPoint class
for constant evaluation purposes.

RFC: http://lists.llvm.org/pipermail/llvm-dev/2020-August/144025.html

Reviewed By: leonardchan, rjmccall

Differential Revision: https://reviews.llvm.org/D85312
2020-08-20 10:29:45 +02:00