summaryrefslogtreecommitdiffstats
path: root/struct.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-05-19 04:13:35 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-05-19 04:13:35 -0700
commitc8d0b0cd48275e0e0182c0a3f6af1e020f5c7c29 (patch)
tree143f0a416326fe569dce3267a2a753d953dafc2c /struct.c
parent973762ad20b91227ca36a3f2375fc79faa454d50 (diff)
downloadtxr-c8d0b0cd48275e0e0182c0a3f6af1e020f5c7c29.tar.gz
txr-c8d0b0cd48275e0e0182c0a3f6af1e020f5c7c29.tar.bz2
txr-c8d0b0cd48275e0e0182c0a3f6af1e020f5c7c29.zip
ffi: support 64 bit bitfields.
* ffi.c (struct txr_ffi_type): Replace unsigned mask member with a union m which holds unsigned mask and 64-bit fmask (fat mask). (ffi_sbit_put, ffi_sbit_get, ffi_ubit_put, ffi_ubit_get): Refer to m.mask. (ffi_fat_sbit_put, ffi_fat_sbit_get, ffi_fat_ubit_put, ffi_fat_ubit_get): New static functions. (ffi_generic_fat_sbit_put, ffi_generic_fat_sbit_get, ffi_generic_fat_ubit_put, ffi_generic_fat_ubit_get): Likewise. (make_ffi_type_struct, make_ffi_type_union): Set up fat mask for bitfields that are wider than int. (ffi_type_compile): Refer to m.mask for the int and unsigned int based bitfields declared with sbit and ubit that don't mention a type. The bit operator now allows int64 and uint64 to be valid types for a bitfield. In this case, the "fat" get and put functions are selected which use 64 bit operations. Thus there is no efficiency impact on non-fat bitfields which continue to use code with 32 bit operands. (ffi_offsetof): Use the bitfield flag in the member's type structure to detect bitfields, rather than the mask.
Diffstat (limited to 'struct.c')
0 files changed, 0 insertions, 0 deletions