Timm Baeder
abc27039be
[clang][bytecode] Pass __builtin_memcpy size along ( #118649 )
...
To DoBitCastPtr, so we know how many bytes we want to read.
2024-12-05 06:55:18 +01:00
Timm Baeder
7aec6dc477
[clang][bytecode] Initialize bases when bitcasting ( #117179 )
...
Base pointers do not get passed to the callback, so initialize them when iterating bases.
2024-12-04 16:49:03 +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
476b208e01
[clang][bytecode] Fix ToType/FromType diagnostic ordering ( #116988 )
...
We need to check the ToType first, then the FromType. Additionally,
remove qualifiers from the parent type of the field we're emitting a
note for.
2024-11-21 07:54:38 +01:00
Kazu Hirata
dec6324cb0
[AST] Remove unused includes (NFC) ( #116549 )
...
Identified with misc-include-cleaner.
2024-11-17 09:36:48 -08:00
Timm Baeder
1b3da362c5
[clang][bytecode] Fix bitcasting packed bool vectors ( #114937 )
...
This is a special case we need to handle. We don't do bitcasting _into_
such vectors yet though.
2024-11-05 11:43:09 +01:00
Timm Baeder
2f13fbfcd1
[clang][bytecode] Support bitcasting into float fields ( #114825 )
2024-11-05 05:52:03 +01:00
Timm Baeder
1f55d77189
[clang][bytecode][NFC] Remove unused parameter from pushData() ( #114801 )
2024-11-04 17:14:05 +01:00
Timm Baeder
3268d51a5c
[clang][bytecode][NFC] Fix a possible build warning ( #114800 )
...
InterpBuiltinBitCast.cpp:95:3: warning: non-void function does not
return a value in all control paths [-Wreturn-type]
95 | }
| ^
1 warning generated.
2024-11-04 16:58:44 +01:00
Timm Baeder
2588b8be56
[clang][bytecode] Implement bitcasts to composite types ( #114776 )
...
Only fixed-size, non-bitfield integral fields for now.
2024-11-04 15:10:10 +01:00
Timm Baeder
fb30208d1e
[clang][bytecode][NFC] Make Floating::bitcastToMemory const ( #114777 )
...
The other functions like this are also const.
2024-11-04 14:00:24 +01:00
Timm Baeder
5b32c5954b
[clang][bytecode] Implement bitcasts to floating-point values ( #114485 ) ( #114712 )
...
This time I tested on big-endian hosts.
2024-11-03 19:42:26 +01:00
Timm Baeder
88823d08ab
[clang][bytecode][NFC] Switch BitcastBuffer to SmallVector ( #114677 )
...
This is a little easier to work with since we are guaranteed that the
item type of the vector is byte sized and not something else.
2024-11-03 11:16:59 +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