Hacker News new | ask | show | jobs
by joosters 3848 days ago
Does ARM Linux offer a 64 bit mode with 32 bit pointers?

On x86-64, Linux supports a 'x32' mode which gives all of the advantages of the 64 bit ISA, but with a 32 bit memory model, meaning that programs using lots of pointers will take up far less memory (but still get to use the extra registers & instructions), leading to faster code. You can run x32 binaries inside a 64 bit kernel (ubuntu offers several packages, for example)

OTOH I don't know if the ARM64 ISA offers many other improvements to make a similar 32-in-64 kind of mode worthwhile.

3 comments

These 64 bit Allwinner SOCs only have a 32 bit* memory bus anyway (presumably to reduce board cost), so an x32 mode could double performance for pointer-heavy code.

* Anyone remember the 8088?

Theoretically it's possible. Just keep all memory in the first 4GB. Load all pointers from 32bit locations and do 32bit arithmetic on them, they should get 0-extended for loads and stores. With the correct linker scripts this could be done in user space (modulo calling dynamically linked libraries).
> to make a similar 32-in-64 kind of mode worthwhile

Yeah, I kinda doubt AARCH64 is that much better.