32位指针与X86-64赛:为什么不呢? [英] 32-bit pointers with the x86-64 ISA: why not?

查看:223
本文介绍了32位指针与X86-64赛:为什么不呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在X86-64指令集增加了更多的寄存器和其他方面的改进,以帮助简化执行code。然而,在许多应用中增加的指针的大小是一种负担。在每一个指针额外的,未使用的字节阻塞缓存,甚至可能溢出内存。 GCC,例如,建立与 -m32 标记,而我认为这是什么原因。

The x86-64 instruction set adds more registers and other improvements to help streamline executable code. However, in many applications the increased pointer size is a burden. The extra, unused bytes in every pointer clog up the cache and might even overflow RAM. GCC, for example, builds with the -m32 flag, and I assume this is the reason.

这是可能加载一个32位的值,并把它作为一个指针。这并不需要额外的指令,只需加载/计算的32位,从结果地址加载。诀窍将无法移植,但是,作为平台有不同的内存映射。在Mac OS X中,地址空间的整个低4吉布被保留。然而,对于一个程序我写的,hackishly加入 0x100000000L 32位的地址之前使用经过改进的性能大大超过真正的64位地址,或编译 -m32

It's possible to load a 32-bit value and treat it as a pointer. This doesn't necessitate extra instructions, just load/compute the 32 bits and load from the resulting address. The trick won't be portable, though, as platforms have different memory maps. On Mac OS X, the entire low 4 GiB of address space is reserved. Still, for one program I wrote, hackishly adding 0x100000000L to 32-bit "addresses" before use improved performance greatly over true 64-bit addresses, or compiling with -m32.

有没有什么根本性的障碍,有32位,X86-64平台?我想,支持这种幻想会增加复杂性,任何操作系统,任何人想要去年20%应该只是让它工作™,但它似乎仍然认为这将是各种计算密集型程序的最佳选择。

Is there any fundamental impediment to having a 32-bit, x86-64 platform? I suppose that supporting such a chimera would add complexity to any operating system, and anyone wanting that last 20% should just Make it Work™, but it still seems that this would be the best fit for a variety of computationally intensive programs.

推荐答案

有一个ABI称为X32为Linux的发展。这是和x86_64 IA32类似之间的搭配,你的描述 - 在使用完整的64位寄存器组32位的地址空间。它需要一个定制的内核,binutils的和GCC。

There is an ABI called "x32" for linux in development. It's a mix between x86_64 and ia32 similar to what you describe - 32 bit address space while using the full 64 bit register set. It needs a custom kernel, binutils and gcc.

有些SPEC运行表明约30%,在一些基准测试一个服务表现的改善。参见更多信息在 https://sites.google.com/site/x32abi/

Some SPEC runs indicate a performace improvement of about 30% in some benchmarks. See further information at https://sites.google.com/site/x32abi/

这篇关于32位指针与X86-64赛:为什么不呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆