i386 与 AMD64 ABI 差异
在哪里可以找到 i386 和 i386 之间数据类型的所有差异。 AMD64 应用程序二进制接口 (ABI) ?
我知道 i386 ABI 中的 long 类型是 32 位的AMD64 中的 64 位。这是正确的吗?
Where can I find all the differences in data types between the i386 & AMD64 Application Binary Interface(ABI)s ?
I know that the long type is 32-bit in i386 ABI & 64-bit in AMD64. Is this correct?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议您下载Agner Fog 博士的优化手册。他有一本专门关于 ABI 及其差异的手册。
对于32位模式和64位模式之间指令集的差异,Intel和AMD的指令手册都应该在介绍卷或指令卷之后的卷中对此进行介绍(2a 和 2b 用于英特尔指令集参考,或 2 和 3 适用于 AMD。)
另请参阅 x86 标签 wiki。
I suggest you download Dr Agner Fog's optimization manuals. He has a manual specifically about ABIs and their differences.
For differences in the instruction set between 32-bit mode and 64-bit mode, both Intel and AMD's instruction manuals should cover this in the introductory volume or the volumes after the instruction volumes(2a and 2b for Intel's instruction set reference, or 2 and 3 for AMD.)
See also other links in the x86 tag wiki.
如果您需要所有 ABI 详细信息:子例程调用约定、哪些寄存器获取传入的内容、哪些寄存器必须在返回时恢复、异常处理——这是完全不同的,您可以从 Microsoft 下载 Windows ABI 的文档。
另一方面,如果您只对数据类型感兴趣,则只需几分钟即可编写一个程序来执行以下操作:
编辑 2011 年 4 月 7 日回复:
此链接 http://msdn.microsoft.com/en-us/library/7kcdt6fy.aspx 目前有效。不保证 MSFT 明天不会移动它!或者 Google“应用程序二进制接口站点:microsoft.com”
除 Windows 之外的所有 x86-64 操作系统都使用 x86-64 System V psABI。请参阅X86-64 ABI 记录在哪里?
ABI 已定义由操作系统和编译器而不是硬件架构师负责。例如,由编译器编写者决定 C/C++ int 是否为 32 位,
long int
是否为 64 位(x86-64 System V)——或者两者都是 32 位( x64 Windows),甚至 int 是 64,long int 也是 64(正如某些 Fortran 编译器所做的那样)——甚至 int 是 64,long int 是 128 或您可以想象的任何其他组合。英特尔和 AMD 可以提出建议,但编译器编写者和操作系统供应商拥有控制权。If you need all of the ABI details: subroutine calling conventions, which registers get what passed in them, which registers must be restored on return, exception handling -- which is completely different, there is a document you can download from Microsoft for the Windows ABI.
On the other hand, if you're just interested in data types, it only takes a couple of minutes to write a program that does:
EDIT 4/7/11 to respond:
This link http://msdn.microsoft.com/en-us/library/7kcdt6fy.aspx works currently. No promises that MSFT won't move it tomorrow! Or Google "application binary interface site:microsoft.com"
All x86-64 OSes other than Windows use the x86-64 System V psABI. See Where is the X86-64 ABI documented?
The ABIs are defined by the operating systems and the compilers, not the hardware architects. For example, it's up to the compiler writers to decided whether a C/C++ int is 32 bits and a
long int
is 64 (x86-64 System V) -- or if both are 32-bit (x64 Windows), or even an int is 64 and a long int is 64, too (as some Fortran compilers do) -- or even int is 64 and long int is 128 or any other combination you can imagine. Intel and AMD can make recommendations, but the compiler writers and OS vendors are in control.