7 Commits

Author SHA1 Message Date
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
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
95ce78b742
[clang][bytecode] Implement fixed-point-to-int casts (#110417)
And some cleanups around overflow handling.
2024-09-29 13:31:44 +02:00
Timm Bäder
d082f1f37d [clang][bytecode] Only booleans can be inverted
No need to have the Inv() function be templated.
2024-08-18 16:02:32 +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