abi(5)
ABI - Application Binary Interface
As shipped in IRIX 6.5.7. Unchanged since IRIX 6.5.
NAME ABI - Application Binary Interface TOPIC This man page is intended to be a quick reference for the three ABI's that are supported by IRIX. It is divided into 5 sections: General Information and Overview O32 Information N64 Information N32 Information Summary Table GENERAL INFORMATION AND OVERVIEW An ABI defines a system interface for executing compiled programs. It defines which instruction set architectures (ISA's) it supports as well as object file formats and calling conventions. IRIX supports three ABI's: O32 The old 32-bit ABI which was standard on IRIX 5 systems. N64 The 64-bit ABI which was introduced on IRIX 6.0 systems. N32 The new high performance 32-bit ABI which is introduced on IRIX 6.2. Each of these ABI's defines unique interfaces which make it impossible to link object files of one ABI with object files of another ABI. The MIPS ABI is a subset of the above mentioned O32 ABI and is designed to provide application portability across a variety of vendor's platforms. See the NOTES section, below, for reference information. Default ABI and ISA settings described in this man page can be overridden in a number of ways: if it exists, the file /etc/compiler.defaults contains the default settings on a given system; and the environment variable, SGI_ABI may be used to specify default ABI values. O32 Information The O32 ABI supports the mips2 (by default) and mips1 ISA's. The resulting program binary is in ELF32 format (COFF is no longer supported) whose symbol table is in .mdebug format. The O32 calling convention allows up to four registers ($a0..$a3) to be used to pass integer arguments. A full description of this ABI can be found in System V Application Binary Interface -- MIPS Processor Supplement When an O32 program executes, IRIX sets the FR bit in the status register of the MIPS microprocessor to 0. Under this setting, only 16 double precision floating point registers are enabled. C Language integer types (int), long integer types (long), and pointer types (char *) are all 32-bits wide in programs compiled for this ABI. A program will be compiled for the O32 ABI under the following circumstances: By default on systems that are not based on the R8000 (if the environment variable SGI_ABI is not set). i.e. %cc foo.c By using the -32 compilation flag (This overrides any SGI_ABI setting). i.e. %cc -32 foo.c By using the -mips2 or -mips1 compilation flags. i.e. %cc -mips2 foo.c By setting the SGI_ABI environment variable to -32 and doing a default compilation. i.e. %setenv SGI_ABI -32 %cc foo.c By setting the default ABI to -32 in the file /etc/compiler.defaults i.e. %cat /etc/compiler.defaults -DEFAULT:abi=o32 An O32 compilation will generate certain predefined variables whose values can be used by conditional compilation directives. The names of these variables and their values are as follows: _MIPS_FPSET = 16 _MIPS_ISA = 2 _ABIO32 = 1 _MIPS_SIM = _ABIO32 _MIPS_SZINT = 32 _MIPS_SZLONG = 32 _MIPS_SZPTR = 32 For more information about these predefined variables, please consult the <sgidefs.h> include file. N64 Information The N64 ABI supports the mips4 (by default) and mips3 ISA's. The resulting program binary is in ELF64 format whose symbol table is in DWARF format. The N64 calling convention is different from the O32 calling convention in that it allows up to eight registers ($a0..$a7) to be used to pass integer arguments. It also allows up to eight floating point registers to be used to pass floating point arguments. A full description of this calling convention can be found in MIPSpro 64-bit Porting and Transition Guide When an N64 program executes, IRIX sets the FR bit in the status register of the MIPS microprocessor to 1. Under this setting, all 32 double precision floating point registers are enabled. This improves performance, but old assembly code that accesses a double precision floating point register as a pair (one even and one odd) of single precision floating point registers will not work. C Language integer types (int) are 32 bits wide, while long integer types (long), and pointer types (char *) are both 64-bits wide in programs compiled for this ABI. A program will be compiled for the N64 ABI under the following circumstances: By default on systems that are based on the R8000 (if the environment variable SGI_ABI is not set). i.e. %cc foo.c By using the -64 compilation flag (This overrides any SGI_ABI setting). i.e. %cc -64 foo.c By using the -mips4 or -mips3 compilation flags. i.e. %cc -mips4 foo.c By setting the SGI_ABI environment variable to -64 and doing a default compilation. i.e. %setenv SGI_ABI -64 %cc foo.c By setting the default ABI to -64 in the file /etc/compiler.defaults i.e. %cat /etc/compiler.defaults -DEFAULT:abi=64 An N64 compilation will generate certain predefined variables whose values can be used by conditional compilation directives. The names of these variables and their values are as follows: _MIPS_FPSET = 32 _MIPS_ISA = 4 _ABI64 = 3 _MIPS_SIM = _ABI64 _MIPS_SZINT = 32 _MIPS_SZLONG = 64 _MIPS_SZPTR = 64 N32 Information The N32 ABI supports the mips3 (by default) and mips4 ISA's. The resulting program binary is in ELF32 format whose symbol table is in DWARF format. The N32 calling convention is the same as the N64 calling convention. A full description of this calling convention can be found in MIPSpro N32 ABI Guide When an N32 program executes, IRIX sets the FR bit in the status register of the MIPS microprocessor to 1, just like it does for an N64 program. Under this setting, all 32 double precision floating point registers are enabled. This has the same performance and compatibility implications as with N64. C Language integer types (int), long integer types (long), and pointer types (char *) are all 32-bits wide in programs compiled for this ABI. A program will be compiled for the N32 ABI under the following circumstances: By using the - n32 compilation flag (This overrides any SGI_ABI setting). i.e. %cc -n32 foo.c By setting the SGI_ABI environment variable to -n32 and doing a default compilation. i.e. %setenv SGI_ABI -n32 %cc foo.c By setting the default ABI to -n32 in the file /etc/compiler.defaults i.e. %cat /etc/compiler.defaults -DEFAULT:abi=n32 An N32 compilation will generate certain predefined variables whose values can be used by conditional compilation directives. The names of these variables and their values are as follows: _MIPS_FPSET = 32 _MIPS_ISA = 4 _ABI64 = 3 _MIPS_SIM = _NABI32 _MIPS_SZINT = 32 _MIPS_SZLONG = 32 _MIPS_SZPTR = 32 SUMMARY TABLE The table below summarizes the characteristics of the three ABI's. _____________________________________________________ ABI Summary Table _____________________________________________________ Category O32 N64 N32 _____________________________________________________ Command Line Switch -32 -64 -n32 _____________________________________________________ Supported ISA's mips1,2 mips 3,4 mips 3,4 _____________________________________________________ Default ISA mips2 mips4 mips3 _____________________________________________________ Object file format ELF32 ELF64 ELF32 _____________________________________________________ Symbol table format .mdebug DWARF DWARF _____________________________________________________ Number of double precision Floating Point Registers 16 32 32 _____________________________________________________ Calling Convention Old New New _____________________________________________________ sizeof(int) 32 32 32 _____________________________________________________ sizeof(long) 32 64 32 _____________________________________________________ sizeof(char *) 32 64 32 _____________________________________________________ | | | | | SEE ALSO Besides the other manpages mentioned below, System V Application Binary Interface and System V Application Binary Interface -- are both good sources of O32 ABI information. The MIPSpro N32 ABI Guide and the MIPSpro 64-bit Porting and Transition Guide provide information about the new calling convention as well as background on the new ABI's. Please check the web page http://www.mipsabi.org/ for more information about the MIPS ABI. mips2(5), mips3(5), mips4(5)