Is it easy/possible to run code with 32 bit pointers on a modern 64 bit OS?

Fred Wright fw at fwright.net
Mon Mar 27 01:22:34 UTC 2017


On Sun, 26 Mar 2017, Hal Murray wrote:
> aac at comcast.net said:
> > Did you check out Linux' "X32 ABI" support?
> > https://sites.google.com/site/x32abi/
>
> Thanks.  That seems to be what I was looking for.
>
> It's not in the Fedora kernels but is in Debian.  I'll poke around more.
>
>
> I guess I'm slightly surprised that there isn't more interest in that area.
> Aside from memory usage, it also uses cache space which turns into general
> performance.  So any program with a lot of pointers would probably speed up.
> I guess there aren't many programs that both fit in 32 bits and are
> performance critical and use a lot of pointers.

The 32-bit x86 architecture is so register-crippled that C code typically
runs about 15% faster when compiled for X86_64 than when compiled for
i386, in spite of the poorer cache locality caused by the larger pointers.

It is, however, useful to make 32-on-64-bit builds work for testing 32-bit
issues.  This is often more complicated than just adding "-m32" to the
flags.

Fred Wright


More information about the devel mailing list