Some basic concepts of x86/x86_64

Source: Internet
Author: User

I am building boost, from "Start Menu", "Programs", "Visual Studio", "Visual Studio Tools", "Windows Desktop Command prompts ":
VS2015 x64 ARM cross Tools Command Prompt.lnk
VS2015 x64 Native Tools Command Prompt.lnk
VS2015 x64 x86 cross Tools Command Prompt.lnk
VS2015 x86 ARM Cross Tools Command Prompt.lnk
VS2015 x86 Native Tools Command Prompt.lnk
VS2015 x86 x64 Cross Tools Command Prompt.lnk
began to depressed
VS2015 x64 Native Tools Command Prompt.lnk
VS2015 x64 x86 cross Tools Command Prompt.lnk
The difference between the two.

The difference is here.
%comspec%/k "" C:\Program Files (x86) \microsoft Visual Studio 14.0\vc\vcvarsall.bat "" AMD64
%comspec%/k "" C:\Program Files (x86) \microsoft Visual Studio 14.0\vc\vcvarsall.bat "" Amd64_x86

And the Vcvarsall.bat content is as follows

     @echo  off    if  "%1"  ==  " goto x86     if  "%2"  ==  " goto check_platform    if  not  "%2"  ==  "store"  goto usage    :check_platform     if /i %1 == x86       goto x86     if /i %1 == amd64     goto amd64     if /i %1 == x64       goto  amd64    if /i %1 == arm        goto arm    if /i %1 == x86_arm   goto  x86_arm    if /i %1 == x86_amd64 goto x86_amd64     if /i %1&nbSp;== amd64_x86 goto amd64_x86    if /i %1 == amd64_arm  goto amd64_arm    goto usage    :x86     if not exist  "%~dp0bin\vcvars32.bat"  goto missing    call   "%~dp0bin\vcvars32.bat"  %2    goto :SetVisualStudioVersion     :amd64    if not exist  "%~dp0bin\amd64\vcvars64.bat"  goto  missing    call  "%~dp0bin\amd64\vcvars64.bat"  %2     Goto :setvisualstudioversion    :arm    if not exist   "%~dp0bin\arm\vcvarsarm.bat"  goto missing    call  "%~dp0bin\arm\ Vcvarsarm.bat " %2    goto :setvisualstudioversion    :x86_ amd64    if not exist  "%~dp0bin\x86_amd64\vcvarsx86_amd64.bat"  goto missing     call  "%~dp0bin\x86_amd64\vcvarsx86_amd64.bat"  %2    GOTO : setvisualstudioversion    :x86_arm    if not exist  "%~ Dp0bin\x86_arm\vcvarsx86_arm.bat " goto missing    call "%~dp0bin\x86_arm\ Vcvarsx86_arm.bat " %2    GOTO :SETVISUALSTUDIOVERSION    : amd64_x86    if not exist  "%~dp0bin\amd64_x86\vcvarsamd64_x86.bat"   goto missing    call  "%~dp0bin\amd64_x86\vcvarsamd64_x86.bat"  %2     goto :SetVisualStudioVersion    :amd64_arm     if not exist  "%~dp0bin\amd64_arm\vcvarsamd64_arm.bat"  goto missing     call  "%~dp0bin\amd64_arm\vCvarsamd64_arm.bat " %2    GOTO :SETVISUALSTUDIOVERSION    : Setvisualstudioversion    set visualstudioversion=14.0    goto  :eof    :usage    echo error in script usage .  the correct usage is:    echo     %0 [ option]    echo   or    echo      %0 [option] store    echo where [option] is: x86  ^| amd64 ^| arm ^| x86_amd64 ^| x86_arm ^| amd64_x86 ^|  amd64_arm    echo:    echo the store parameter  sets environment variables to support    echo    store  (rather thAn desktop)  development.    echo:    echo For  example:    echo     %0 x86_amd64     echo     %0 x86_arm store    goto :eof     :missing    echo the specified configuration type is  missing.  the tools for the    echo configuration  might not be installed.    goto :eof

In other words, the difference is

: x86_amd64 If not exist "%~dp0bin\x86_amd64\vcvarsx86_amd64.bat" goto missing call "%~DP0BIN\X86_AMD64\VCVARSX86_AMD 64.bat "%2 goto:setvisualstudioversion

And

: amd64_x86 If not exist "%~dp0bin\amd64_x86\vcvarsamd64_x86.bat" goto missing call "%~dp0bin\amd64_x86\vcvarsamd64_x 86.bat "%2 goto:setvisualstudioversion

Between

i.e.
X86_amd64\vcvarsx86_amd64.bat
And
Amd64_x86\vcvarsamd64_x86.bat
The difference between

With beyond compare compare it two, almost 200 lines of script comparison, I was silly here ...

And then I checked aboutComputer ArchitectureInformation, there are too many specious or talk about when farting "article", and the following article for me a Little help:

Now the x86 CPU in the number of bits on the 32/64bit, there are x86/x86_64/x64/i386/ia32/ia64/amd64 on the arch, and recently a new x32, fortunately not arch, just ABI, not so chaotic.


First of all, the x86 of these arch, do not require very strict, can basically use the following formula to express:

X86=i386=ia32

Amd64=x86_64=x64!=ia64

In fact, many of these two equations are aliases, strictly speaking, there are only x86/x86_64/ia64 three architectures in the x86 world.

AMD introduced backward-compatible AMD64 CPUs before Intel, and Intel's non-compliant 32-bit system IA64 a dismal ending (by Ms), and then Intel supported the AMD64 on the instructions, but did not want to call AMD64, changed a name x86_64.


Again, 64bit/32bit compatibility issues:

Now the 64bit CPU is actually doing a special 32bit compatible design, so 64bit of CPU running 32bit software (including Kernel/app, driver except) is no problem. In turn, 32bit of CPU running on 64bit software is not possible.


Finally, the key point, 64bit compared to 32bit performance advantages:

This is not considered to be an excessive way of running 32bit software on 64bit hardware.

Architecturally speaking, 64bit has 64bit register and 64bit bus, the data transmission efficiency is much higher than 32bit, in addition, the address space of 64bit address bus has breached the 4G limit.

Therefore, for large memory, dense data operation of the application scenario, the advantages of 64bit is very obvious. There are some benchmark on the internet, which is not posted here.


However, for small memory systems, 64bit CPUs may be less efficient in some situations than 32bit CPUs.

Because the address of the CPU is 64 bits, the pointer is 64 bits, the compiled binary file is larger, the memory is occupied more, and on the other hand, because of the problem of 64-bit address, the cache can store fewer instructions, so it is more likely to cause cache miss.


So in some scenarios, the greater addressing space of bitcpu, faster data transfer, faster floating-point arithmetic features, and the cache miss characteristics that are caused by the address/pointer of its "bit", always coexist.


To make full use of the 64 advantage and avoid the problem of cache miss caused by 64bit address, Intel proposed the concept of x32 ABI.

X32 is not an arch, it is an ABI.

The x32 can be used to fully use the 64bit bit registers of the 64bit bus, as well as the new instructions in the order to achieve faster data processing speed.

At the same time x32 uses the 32bit address/pointer,32bit's C data type, so the cache miss does not increase.


X32 is an ABI, and its design includes: Kernel's Support,toolchain Support,system Lib's support. Now kernel (from 3.4) and toolchain support are OK.



Refrence

http://blog.claudxiao.net/2012/05/x32-abi/

http://blog.csdn.net/force_eagle/article/details/7860574


But even if I did, I still didn't understand.
X86_amd64\vcvarsx86_amd64.bat
And
Amd64_x86\vcvarsamd64_x86.bat
The difference between


Some basic concepts of x86/x86_64

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.