7 Commits

Author SHA1 Message Date
Timm Baeder
1f2d934525
[clang][bytecode] Support pointers in __builtin_mem{move,cpy} (#120560)
Unfortunately, that means we can't use the __builtin_bit_cast
implementation for this.
2024-12-19 16:38:58 +01:00
Timm Baeder
30cbd09f4b
[clang][bytecode] Fix memcmp/bcmp failures on big-endian hosts (#119851)
See the discussion in

https://github.com/llvm/llvm-project/pull/119678#issuecomment-2539680746
and
https://github.com/llvm/llvm-project/pull/119544#issuecomment-2539678561
2024-12-13 12:19:27 +01:00
Timm Baeder
8713914d76
[clang][bytecode] Handle __builtin_memcmp (#119544) 2024-12-12 08:59:35 +01:00
Timm Baeder
1fbbf4c418
[clang][bytecode] Pass (float) BitWidth to DoBitCast (#119119)
In certain cases (i.e. long double on x86), the bit with we get from the
floating point semantics is different than the type size we compute for
the BitCast instruction. Pass this along to DoBitCast, so in there we
can check only the relevant bits for being initialized.

This also fixes a weirdness we still had in DoBitCast.
2024-12-08 18:54:08 +01:00
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
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
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