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

查看:32
本文介绍了编译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...).

本机编译器只能在 64 位 Windows 副本上运行,因此如果您的工作站是 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.

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

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:

x64 on x86(x64 交叉编译器)
允许您为 x64 创建输出文件.此版本的 cl.exe 作为32 位进程,在 x86 上原生机器和在 64 位上的 WOW64寡妇操作系统.

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 的报价格式

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

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