编译x64代码时,“ x86_amd64”和“ x86_amd64”之间有什么区别?和“ amd64”? [英] When compiling x64 code, what's the difference between "x86_amd64" and "amd64"?

查看:569
本文介绍了编译x64代码时,“ x86_amd64”和“ x86_amd64”之间有什么区别?和“ amd64”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用VC ++编译代码时, MSDN 使您可以选择使用x86_amd64工具集还是使用amd64工具集(在调用vcvarsall.bat时)。

When compiling code with VC++, MSDN gives you the option between using the x86_amd64 toolset or the amd64 toolset (when calling vcvarsall.bat).

在编译x64代码时如何在这两者之间进行选择?与交叉编译器相比,amd64选项会推出效率更高的x64机器代码吗?

How do I choose between those two when compile x64 code? Will the amd64 option churn out more efficient x64 machine code than the cross compiler?

推荐答案

与效率无关。本机和交叉编译器都将生成相同的机器代码。但是,通过在64位工作站上运行本机64位编译器进程(更大的寄存器,更大的内存空间等),您将获得一些好处。

It has nothing to do with efficiency. The native and cross-compiler will both generate the same machine code. You will however gain some benefits by running a native 64-bit compiler process on a 64-bit workstation (larger registers, larger memory space, etc...).

本机编译器只能在Windows的64位副本上运行,因此,如果您的工作站是32位,则该编译器甚至无法运行。

The native compiler will only run on an 64-bit copy of Windows, so if your workstation is 32-bit this compiler won't even run.

交叉编译器即使它可以通过WoW在Windows的64位副本上运行,也可以在x86机器上运行;但是,没有理由这样做。

The cross-compiler is meant to run on x86 machines even though it will run on a 64-bit copy of Windows via WoW; however, there is no reason to do this.

您链接的页面说得很好:

The page you link says it quite well:


x86上的x64(x64交叉编译器)

允许
创建x64的输出文件。
此版本的cl.exe作为
32位进程运行,在x86
机器上本机运行,在WOW64下在64位
Widows操作系统上运行。

x64 on x86 (x64 cross-compiler)
Allows you to create output files for x64. This version of cl.exe runs as a 32-bit process, native on an x86 machine and under WOW64 on a 64-bit Widows operating system.

x64上的x64

允许您为x64创建输出
文件。 cl.exe
的此版本在x64
机器上作为本机进程运行。

x64 on x64
Allows you to create output files for x64. This version of cl.exe runs as a native process on an x64 machine.

感谢 Brian R. Bondy 用于报价格式

Thanks to Brian R. Bondy for the quote formatting

这篇关于编译x64代码时,“ x86_amd64”和“ x86_amd64”之间有什么区别?和“ amd64”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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