X32 ABI
   HOME

TheInfoList



OR:

The x32 ABI is an
application binary interface In computer software, an application binary interface (ABI) is an interface between two binary program modules. Often, one of these modules is a library or operating system facility, and the other is a program that is being run by a user. An ...
(ABI) and one of the
interfaces of the Linux kernel Interface or interfacing may refer to: Academic journals * ''Interface'' (journal), by the Electrochemical Society * '' Interface, Journal of Applied Linguistics'', now merged with ''ITL International Journal of Applied Linguistics'' * '' Int ...
. The x32 ABI provides 32-bit integers, long and pointers (ILP32) on Intel and AMD 64-bit hardware. The ABI allows programs to take advantage of the benefits of
x86-64 x86-64 (also known as x64, x86_64, AMD64, and Intel 64) is a 64-bit version of the x86 instruction set, first released in 1999. It introduced two new modes of operation, 64-bit mode and compatibility mode, along with a new 4-level paging ...
instruction set (larger number of
CPU register A processor register is a quickly accessible location available to a computer's processor. Registers usually consist of a small amount of fast storage, although some registers have specific hardware functions, and may be read-only or write-only. ...
s, better floating-point performance, faster
position-independent code In computing, position-independent code (PIC) or position-independent executable (PIE) is a body of machine code that, being placed somewhere in the primary memory, executes properly regardless of its absolute address. PIC is commonly used fo ...
,
shared libraries In computer science, a library is a collection of non-volatile resources used by computer programs, often for software development. These may include configuration data, documentation, help data, message templates, pre-written code and su ...
, function parameters passed via registers, faster
syscall In computing, a system call (commonly abbreviated to syscall) is the programmatic way in which a computer program requests a service from the operating system on which it is executed. This may include hardware-related services (for example, acc ...
instruction) while using 32-bit
pointers Pointer may refer to: Places * Pointer, Kentucky * Pointers, New Jersey * Pointers Airport, Wasco County, Oregon, United States * The Pointers, a pair of rocks off Antarctica People with the name * Pointer (surname), a surname (including a lis ...
and thus avoiding the overhead of 64-bit pointers.


Details

Though the x32 ABI limits the program to a
virtual address space In computing, a virtual address space (VAS) or address space is the set of ranges of virtual addresses that an operating system makes available to a process. The range of virtual addresses usually starts at a low address and can extend to the hig ...
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 Cache, caching, or caché may refer to: Places United States * Cache, Idaho, an unincorporated community * Cache, Illinois, an unincorporated community * Cache, Oklahoma, a city in Comanche County * Cache, Utah, Cache County, Utah * Cache County ...
. The best results during testing were with the 181.mcf
SPEC Spec may refer to: *Specification (technical standard), an explicit set of requirements to be satisfied by a material, product, or service **datasheet, or "spec sheet" People * Spec Harkness (1887-1952), American professional baseball pitcher ...
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 SPARC (Scalable Processor Architecture) is a reduced instruction set computer (RISC) instruction set architecture originally developed by Sun Microsystems. Its design was strongly influenced by the experimental Berkeley RISC system develope ...
and x86-64. On the
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, w ...
side, Debian also ships an ILP32 userspace. The underlying reason is the somewhat "more expensive" nature of
LP64 In computer architecture, 64-bit integers, memory addresses, or other data units are those that are 64 bits wide. Also, 64-bit CPUs and ALUs are those that are based on processor registers, address buses, or data buses of that size. A comput ...
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 Donald Ervin Knuth ( ; born January 10, 1938) is an American computer scientist, mathematician, and professor emeritus at Stanford University. He is the 1974 recipient of the ACM Turing Award, informally considered the Nobel Prize of computer sc ...
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 The Linux kernel mailing list (LKML) is the main electronic mailing list for Linux kernel development, where the majority of the announcements, discussions, debates, and flame wars over the kernel take place. Many other mailing lists exist to di ...
that he and H. J. Lu had been working on the x32 ABI. That same day,
Linus Torvalds Linus Benedict Torvalds ( , ; born 28 December 1969) is a Finnish software engineer who is the creator and, historically, the lead developer of the Linux kernel, used by Linux distributions and other operating systems such as Android. He also ...
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 The GNU C Library, commonly known as glibc, is the GNU Project's implementation of the C standard library. Despite its name, it now also directly supports C++ (and, indirectly, other programming languages). It was started in the 1980s by ...
in version 2.16. In December 2018 there was discussion as to whether to deprecate the x32 ABI, which has not happened as of November 2020.


Adoption


References


External links


x32 ABI Development Website

x32 ABI Presentation Slides from the Linux Plumbers Conference
{{Linux kernel Interfaces of the Linux kernel X86 architecture