Welcome to the N32 ABI Handbook. This book describes the N32 High Performance 32-bit Application Binary Interface (ABI) for the MIPS architecture.
As you continue reading this guide, you'll learn about N32. Topics include:
Chapter 1 (this chapter), “N32 ABI Overview”
This document uses the following terminology:
The current 32-bit ABI generated by the ucode compiler (32-bit compilers prior to IRIX 6.1 operating system).
The new 32-bit ABI generated by the MIPSpro 64-bit compiler.
The new 64-bit ABI generated by the MIPSpro 64-bit compiler.
N32 is a minor variation on the high performance 64-bit ABI. All the performance of the hardware is available to the program and existing 32-bit ABI programs are easily ported. Table 1-1 compares the various ABIs.
Number of FP Registers
Number of Argument Registers
64 (UX=1) *
* UX=1 implies 64-bit registers and also indicates that MIPS3 and MIPS4 instructions are legal. N32 uses 64-bit registers but restricts addresses to 32 bits.
The Application Binary Interface, or ABI, is the set of rules that all binaries must follow in order to run on an Silicon Graphics system. This includes, for example, object file format, instruction set, data layout, subroutine calling convention, and system call numbers. The ABI is one part of the mechanism that maintains binary compatibility across all Silicon Graphics platforms.
Until IRIX operating system version 6.1, Silicon Graphics supported two ABIs: a 32-bit ABI and a 64-bit ABI. IRIX 6.1 supports a new ABI, n32.
The following sections outline limitations of the old 32-bit ABI and the 64-bit ABI. These issues form the motivation for the new N32 ABI. Specifically, the topics covered include the following:
16 of the 32 floating point registers cannot be used.
64-bit arithmetic instructions cannot be used.
64-bit data movement instructions cannot be used.
MIPS4/R8000 instructions cannot be used.
Because of this, the performance available from the chip is lost. Floating point intensive programs are especially hurt by these limitations; indeed some are 50%-100% slower!
Porting code from the 32-bit ABI to the 64-bit ABI typically requires some recoding.
When ported from the 32-bit ABI to the 64-bit ABI, some C programs get significantly larger.
A compiler that supports n32. (The 6.1 and later versions of MIPSpro compilers support n32).
A kernel that supports n32. (IRIX 6.1 and later versions supports n32).
N32 versions of each library.
Install n32 OS, compiler, and all n32 libraries.
Rewrite Assembly code to conform to n32 guidelines.
Prototype C functions that use varargs and floating point.
Recompile all the code with the compiler that supports n32 (use –n32 on the command line). Makefile changes are needed only if explicit library paths are used.