9 Commits

Author SHA1 Message Date
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