3 ms·
> Depends on the platform. IIRC on ARM a bitfield access is masking and shifting, only done by the compiler instead of me. With optimized code I often have to l
by deaddodo 5y ago
> Depends on the platform. IIRC on ARM a bitfield access is masking and shifting, only done by the compiler instead of me. With optimized code I often have to look at the disassembly anyway if I want to know what's really going on.
ARM supports native bitfield loading[1], extraction[2] and clearing[3].
1 - https://developer.arm.com/documentation/ddi0602/2022-03/Base-Instructions/BFI--Bitfield-Insert--an-alias-of-BFM-?lang=en https://developer.arm.com/documentation/ddi0602/2022-03/Base...
2 - https://developer.arm.com/documentation/ddi0602/2022-03/Base-Instructions/UBFX--Unsigned-Bitfield-Extract--an-alias-of-UBFM-?lang=en https://developer.arm.com/documentation/ddi0602/2022-03/Base...
3 - https://developer.arm.com/documentation/ddi0602/2022-03/Base-Instructions/BFC--Bitfield-Clear--an-alias-of-BFM-?lang=en https://developer.arm.com/documentation/ddi0602/2022-03/Base...