third draft: add bitfields to D

claptrap clap at trap.com
Mon Jul 22 21:23:04 UTC 2024


On Sunday, 21 July 2024 at 16:19:04 UTC, IchorDev wrote:
> On Sunday, 21 July 2024 at 10:25:29 UTC, Dom DiSc wrote:
>> bytes are just a 8bit alignment, they shouldn't be fundamental 
>> - but as long as these 3 lines are missing, we need a 
>> workaround like in the 68000er times
>
> Multi-bit alignment (e.g. 8-bit) is a means of simplifying and 
> therefore speeding up the CPU architecture. Having 3 lines for 
> individual bits would be a huge waste of electricity. As it is, 
> I think being able to address individual bytes is a bit 
> antiquated, especially with new CPUs heavily favouring 
> pointer-size alignment.

x86 CPUs favour type alignment not pointer size alignment, bytes 
1 align, shorts 2 align and so on.

It's mostly to avoid buggering up the store to load forwarding 
IIRC. Which is basically a way of making recent writes faster to 
retrieve when they are loaded again.

And as far as I know ARM is the same.




More information about the dip.development mailing list