It seems to me that LLVM has taken the path of creating a reliable compiler platform;
doing things like ensuring that a typed register container cannot contain a value that
the same typed memory container can contain.
Thus, it seems to me that if someone creates a struct such as::
struct { uint64_t a:3,
b:5,
c:9,
d:17,
e:28; } henry;
And in the code we find::
d = a*b+c;
That one should expect something like::
LDD Rcontiner,[henry]
EXT Ra,Rcontainer,<3:0>
EXT Rb,Rcontainer,<5:3>
EXT Rc,Rcontainer,<9:8>
MUL Rtemp,Ra,Rb
ADD Rd,Rtemp,Rc
INS Rcontainer,Rcontianer,Rd,<17:17>
STD Rcontainer,[henry]
Where EXT and INS may expand as the ISA in question supports bit-fields.
Furthermore: If the value in Rd is used, that value may have to be stripped of significance
beyond its 17 bits–although this example was constructed such that Rd contains no sig-
nificance beyond bit 16:: but I’m pretty sure value tracking is not up to the task of bit-sized
values
Thus, it seems to me that since LLVM has chosen to preserve container size value space
on a per container basis, that bit fields should be no different, in principle.
I take no position on bit-field sizes outside of structures, you may expand these to any
suitable sized memory-referenceable container that is suitable.