Timm Baeder
64a849a52e
[clang][Interp] Support arbitrary precision constants ( #79747 )
...
Add (de)serialization support for them, like we do for Floating values.
2024-01-31 10:00:42 +01:00
Timm Baeder
c3ced6ac62
[clang][Interp] Implement IntegralAP::{div, rem} ( #72614 )
2024-01-15 09:36:19 +01:00
Timm Baeder
e3f4fa9834
[clang][Interp] Implement inc/dec for IntegralAP ( #69597 )
...
Implement `++` and `--` for arbitrary-bitwidth values.
2023-12-12 10:44:43 +01:00
Timm Baeder
4cf996d6a2
[clang][Interp] Implement IntegralAP::mul() ( #72491 )
2023-11-16 15:06:11 +01:00
Timm Baeder
aa4e34bd81
[clang][Interp] Implement bitwise operations for IntegralAP ( #71807 )
2023-11-16 09:31:24 +01:00
Timm Baeder
6416b2d0a8
[clang][Interp] Implement IntegralAP subtraction ( #71648 )
2023-11-16 06:18:17 +01:00
Timm Baeder
8feb0830cb
[clang][Interp] Consider bit width in IntegralAP::toAPSInt() ( #71646 )
...
In `Interp.h`, when a add/sub/mul fails, we call this code and expect to
get an `APSInt` back that can handle more than the current bitwidth of
the type.
2023-11-09 07:46:55 +01:00
Timm Baeder
e6a94dca38
[clang][Interp] Fix creating APSInt from IntegralAP ( #71410 )
...
The boolean argument in the APSInt constructor is IsUnsigned, not
IsSigned.
2023-11-08 10:48:07 +01:00
Timm Baeder
feedb7c0db
[clang][Interp] Fix IntAP(s) to IntAP(s) casts ( #69915 )
...
This was still assert(false)'ed out, it's for casts between two IntAP/IntAPS expressions.
We can't just short-circuit for FromT == ToT because we need to consider the bitwidth when doing the cast.
2023-11-06 15:13:43 +01:00
Timm Baeder
a9af8f8882
[clang][Interp] Implement IntegralAP::truncate() ( #69912 )
2023-11-05 08:26:29 +01:00
Timm Baeder
56dab2cb07
[clang][Interp] Fix truncateCast() ( #69911 )
...
The added test case used to fail because we converted the LHS to `-1`.
2023-10-30 16:27:47 +01:00
Timm Baeder
59d2dc239b
[clang][Interp] IntegralAP zero-initializers ( #68081 )
2023-10-19 08:20:53 +02:00
Timm Bäder
66c99154a1
[clang][Interp][NFC] Remove from(Boolean) overload
...
This code is unused now that we have special casts from/to IntAP(S).
2023-10-18 14:23:29 +02:00
Timm Baeder
3efa4794ec
[clang][Interp] Support AddOffset with 128bit offsets ( #68679 )
...
We do a similar thing a few lines above for `Index`:
```c++
// Get a version of the index comparable to the type.
T Index = T::from(Ptr.getIndex(), Offset.bitWidth());
```
2023-10-13 14:47:46 +02:00
Timm Bäder
4803ba9ecb
[clang][Interp] Remove expected-no-directives lines
...
We now always have expected output.
2023-10-11 10:54:04 +02:00
Timm Bäder
c3f67b3ba9
[clang][Interp] Limit MaxBitInt to 128 bits
...
Looks like larger bitints aren't supported everywhere.
2023-10-11 09:48:28 +02:00
Timm Baeder
26d9f851cf
[clang][Interp] Add basic support for _BitInt ( #68069 )
...
Make sure we pass the expected bitwidth around when casting to
IntAP/IntAPS.
This makes it easier to test the `IntegralAP` code for different bit
widths than 128.
2023-10-11 08:53:21 +02:00
Timm Bäder
ce9077fe7f
[clang][Interp] Fix intap tests if int128 is not supported
...
This test doesn't do anything in that case.
This broke some builders, e.g.:
https://lab.llvm.org/buildbot/#/builders/245/builds/15150
2023-10-10 10:38:05 +02:00
Timm Bäder
3542dd8f91
[clang][Interp][NFC] Move int128 tests to their own file
2023-10-10 09:54:08 +02:00