10 Commits

Author SHA1 Message Date
Timm Bäder
2503a66596 Reapply "[clang][bytecode] Fix some shift edge cases (#119895)"
This reverts commit a6636ce4d124176856c3913d4bf6c3ceff1f5a1f.

This original commit failed on hosts with signed wchar_t. Care for
this in the test.
2024-12-16 10:01:46 +01:00
Timm Bäder
a6636ce4d1 Revert "[clang][bytecode] Fix some shift edge cases (#119895)"
This reverts commit 49c2207f21c0922aedb6c70471f8ea068977eb30.

This breaks on big-endian, again:
https://lab.llvm.org/buildbot/#/builders/154/builds/9018
2024-12-14 06:28:12 +01:00
Timm Baeder
49c2207f21
[clang][bytecode] Fix some shift edge cases (#119895)
Around shifting negative values.
2024-12-14 06:15:56 +01:00
Timm Bäder
12ca72ba7f Reapply "[clang][bytecode] Handle bitcasts involving bitfields (#116843)"
This reverts commit 54db16221c92eb52efbea90ad5b5d2a1d00cda3e.

Check for existence of __SIZOEF_INT128__ so we don't run those
tests on targets that don't have int128.
2024-12-04 11:53:37 +01:00
Timm Bäder
54db16221c Revert "[clang][bytecode] Handle bitcasts involving bitfields (#116843)"
This reverts commit 4b5e7fa4de54e00df007ae5e2675393fd046aa59.

This breaks builders:
https://lab.llvm.org/buildbot/#/builders/154/builds/8464

I guess some more testing on 32 bit hosts is needed.
2024-12-04 11:43:43 +01:00
Timm Baeder
4b5e7fa4de
[clang][bytecode] Handle bitcasts involving bitfields (#116843)
Copy the data one bit at a time, leaving optimizations for future work.
Adds a BitcastBuffer that takes care of pushing the bits in the right
order.
2024-12-04 11:25:04 +01:00
Timm Baeder
c1dcf75a7c
[clang][bytecode] Implement __builtin_reduce_mul (#118287) 2024-12-02 14:03:53 +01:00
Timm Baeder
ef2a104c94
[clang][bytecode] Start implementing __builtin_bit_cast (#112126)
This is a subset of #68288, with hopefully narrower scope. It does not
support bitcasting to non-integral types yet.
Bitfields are supported, but only if they result in a full byte-sized
final buffer. It does not support casting from null-pointers yet or
casting from indeterminate bits.


The tests are from #68288 and partially from #74775.

The `BitcastBuffer` struct is currently always working in single bits,
but I plan to (try to) optimize this for the common full-byte case.
2024-10-31 18:09:40 +01:00
Timm Baeder
5b4071c755
[clang][bytecode] Explicitly truncate in IntegralAP::from() (#112683)
Add Integral::toAPInt(), which truncates to the given BitWidth, similar
to the toAPSInt() we already have.
2024-10-17 12:26:44 +02:00
Timm Baeder
a07aba5d44
[clang] Rename all AST/Interp stuff to AST/ByteCode (#104552)
"Interp" clashes with the clang interpreter and people often confuse
this.
2024-08-16 17:13:12 +02:00