X32 ABI


The x32 ABI is an application binary interface and one of the interfaces of the Linux kernel. It allows programs to take advantage of the benefits of x86-64 instruction set while using 32-bit pointers and thus avoiding the overhead of 64-bit pointers.

Details

Though the x32 ABI limits the program to a virtual address space of 4 GiB, it also decreases the memory footprint of the program by making pointers smaller. This can allow it to run faster by fitting more code and more data into cache. The best results during testing were with the 181.mcf SPEC CPU 2000 benchmark, in which the x32 ABI version was 40% faster than the x86-64 version. On average, x32 is 5–8% faster on the SPEC CPU integer benchmarks compared to x86-64. There is no speed advantage over x86-64 in the SPEC CPU floating-point benchmarks.

History

Running a userspace that consists mostly of programs compiled in ILP32 mode and which also have principal access to 64-bit CPU instructions has not been uncommon, especially in the field of "classic RISC" chips. For example, the Solaris operating system does so for both SPARC and x86-64. On the Linux side, Debian also ships an ILP32 userspace. The underlying reason is the somewhat "more expensive" nature of LP64 code, just like it has been shown for x86-64. In that regard, the x32 ABI extends the ILP32-on-64bit concept to the x86-64 platform.
Several people had discussed the benefits of an x86-64 ABI with 32-bit pointers in the years since the Athlon 64's release in 2003, notably Donald Knuth in 2008. There was little publicly visible progress towards implementing such a mode until August 27, 2011, when Hans Peter Anvin announced to the Linux kernel mailing list that he and H. J. Lu had been working on the x32 ABI.
That same day, Linus Torvalds replied with a concern that the use of 32-bit time values in the x32 ABI could cause problems in the future. This is because the use of 32-bit time values would cause the time values to overflow in the year 2038. Following this request, the developers of the x32 ABI changed the time values to 64-bit.
A presentation at the Linux Plumbers Conference on September 7, 2011, covered the x32 ABI.
The x32 ABI was merged into the Linux kernel for the 3.4 release with support being added to the GNU C Library in version 2.16.
In December 2018 it was considered to deprecate the x32 ABI, which has not happened as of September 2019.