是使用32位的指针在x64位的cpu上跑程序。
这样既利用了x64的更多的寄存器,也因为32位指针的长度是64位的一半,从而更有效的利用cpu的缓存。
从而使程序跑得更快,性能更好。
内核从3.4起也加入了x32的支持。
google上有一个开源项目x32-abi,目前已经完成了binutils、gcc、gdb、glibc等工具的移植。
从测试的结果来看,性能会提高4%-40%。
- Test machines:
- Fedora 17/x86-64
- kernel-3.3.7-3.0
- glibc-2.15-37.0
- 181.mcf from SPEC CPU 2000 (memory bound):
- Intel Core i7
- ~40% faster than x86-64.
- ~2% slower than ia32.
- Intel Atom
- ~40% faster than x86-64.
- ~1% faster than ia32.
- 186.crafty from SPEC CPU 2000 (64bit integer):
- Intel Core i7
- ~3% faster than x86-64.
- ~40% faster than ia32.
- Intel Atom
- ~4% faster than x86-64.
- ~26% faster than ia32.
x32的优化比单纯的编译器优化要强得多了!