logoalt Hacker News

tostiyesterday at 4:59 AM3 repliesview on HN

Regarding misaligned reads, IIRC only x86 hides non-aligned memory access. It's still slower than aligned reads. Other processors just fault, so it would make sense to do the same on riscv.

The problem is decades of software being written on a chip that from the outside appears not to care.


Replies

fredoraliveyesterday at 8:41 AM

ARM Cortex-A cores also allow unaligned access (MCU cores don't though, and older ARM is weird). There's perhaps a hint if the two most popular CPU architectures have ended up in the forgiving approach to unaligned access, rather than the penalising approach of raising an interrupt.

torginusyesterday at 9:22 AM

Yes, unaligned loads/stores are a niche feature that has huge implications in processor design - loads across cache-lines with different residency, pages that fault etc.

This is the classic conundrum of legacy system redesign - if customers keep demanding every feature of the old system be present, and work the exact same then the new system will take on the baggage it was designed to get rid of.

The new implementation will be slow and buggy by this standard and nobody will use it.

show 1 reply
pjmlpyesterday at 6:44 AM

On modern CPUs, it used not to be something to care about in the past across 8, 16, 32 bit generations, outside RISC.

show 1 reply