Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There is also a middle ground of requiring to pad 16/48-bit sequences with 16-bit NOP to align them to 32 bits. I agree that at this time it's not clear whether the C extension is a good idea or not (same with the V extension).


The C extension authors did consider requiring alignment/padding to prevent the misaligned 32-bit instruction issues, but they specifically mention rejecting it since it ate up all the code size savings.


Did they specifically analyze doing alignment on a cache line basis?


This would require specifying a cache line size in the ABI, which is a somewhat odd uarch detail to bubble up. While 64-bytes is conventional for large application processors and has been for a long time, I wouldn't want to make it a requirement.


It's definitely worth analyzing though.

See how big of a block you need to get 90% of the compression benefit, etc.


that seems really tough for compilers.


Not really. Most modern x86 compilers already align jump targets to cache line boundaries since this helps x86 a lot. So it is doable. If you compile each function into a section (common), then the linker can be told to align them to 64 or 128 bytes easily. Code size would grow (but tetris can be played to reduce this by packing functions)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: