1 |
On 09/11/2011 17:47, Michał Górny wrote: |
2 |
|
3 |
> Looks like n32 is less '32' than o32 so a little weird classification |
4 |
> but I guess historical reasons. |
5 |
|
6 |
|
7 |
In a way, yeah. The gory details are in the N32 ABI guide here, if your |
8 |
curiosity is morbid enough: |
9 |
ftp://ftp.linux-mips.org/pub/linux/mips/doc/ABI2/MIPS-N32-ABI-Handbook.pdf |
10 |
|
11 |
To quote a small excerpt from that: |
12 |
|
13 |
------------- |
14 |
Limitations of the 32-bit ABI |
15 |
|
16 |
The 32-bit ABI was designed essentially for the R3000. It cannot be extended |
17 |
to use new performance-related features and instructions of the R4400 and |
18 |
beyond. For example: |
19 |
|
20 |
* 16 of the 32 floating point registers cannot be used. |
21 |
* 64-bit arithmetic instructions cannot be used. |
22 |
* 64-bit data movement instructions cannot be used. |
23 |
* MIPS4/R8000 instructions cannot be used. |
24 |
|
25 |
Because of this, the performance available from the chip is lost. Floating |
26 |
point intensive programs are especially hurt by these limitations; indeed |
27 |
some are 50%-100% slower! |
28 |
|
29 |
|
30 |
Limitations of the 64-bit ABI |
31 |
|
32 |
Although the 64-bit ABI exploits many performance-related features of the |
33 |
MIPS architecture, it also has problems. These include the following: |
34 |
* Porting code from the 32-bit ABI to the 64-bit ABI typically |
35 |
requires some recoding. |
36 |
* When ported from the 32-bit ABI to the 64-bit ABI, some C programs |
37 |
get significantly larger. |
38 |
|
39 |
|
40 |
Motivation for the N32 ABI |
41 |
|
42 |
Many ISVs and customers are finding it difficult to port to the 64-bit ABI. |
43 |
An ABI was needed with all of the performance advantages of the 64-bit ABI, |
44 |
but with the same data type sizes as the 32-bit ABI to allow ease of porting. |
45 |
------------- |
46 |
|
47 |
And to add to that, "N32 uses 64-bit registers but restricts addresses to 32 |
48 |
bits." |
49 |
|
50 |
So we sometimes refer to it as a hybrid ABI, because it's in between the |
51 |
32-bit and 64-bit worlds. It actually requires a 64-bit compiler (either an |
52 |
n32 mips64[el]-* OR n64mips64[el]-* toolchain) to even generate the code. |
53 |
|
54 |
And it drove the glibc developers, especially Ulrich, absolutely insane. |
55 |
One of the bigger reasons why non-x86 glibc code was spun off into -ports |
56 |
several years ago, so they could speed up the glibc release cycle. |
57 |
|
58 |
|
59 |
To give you an idea of the age of the n32 and o32 ABIs, IRIX 5.x (and IRIX |
60 |
6.0) was the latest IRIX release to use o32. All releases under IRIX 6.1 |
61 |
and up were n32. And IRIX 6.1 came out some time after 1994, probably in |
62 |
1995 (IRIX 6.5, the last branch, didn't start until 1998). So Linux support |
63 |
for n32 has been literal eons in the making. It is seriously old school |
64 |
stuff here. I was just starting middle school when n32 became standard. |
65 |
|
66 |
-- |
67 |
Joshua Kinard |
68 |
Gentoo/MIPS |
69 |
kumba@g.o |
70 |
4096R/D25D95E3 2011-03-28 |
71 |
|
72 |
"The past tempts us, the present confuses us, the future frightens us. And |
73 |
our lives slip away, moment by moment, lost in that vast, terrible in-between." |
74 |
|
75 |
--Emperor Turhan, Centauri Republic |