| ▲ | titzer 2 hours ago | |
You might want to have a look at the unboxing and packing annotations that are proposed for Virgil. The unboxing mechanism is implemented and there was a prototype of the packing mechanism implemented by Bradley for his thesis. I am working on making a more robust implementation that I can land. https://arxiv.org/abs/2410.11094 I'm not sure I understand your example; if I am looking at it right, it has overlapping bitfields. But supposing you didn't want overlapping fields, you could write:
And the compiler would smash the bits together (highest order bits first).If you wanted more control, you can specify where every bit of every field goes using a bit pattern:
Where each of T, b, z, and r represent a bit of each respective field. | ||