64位的电脑 != 64根地址线

  最近在学c++,跟着书打了这个代码:

    int dnout = 4;
    int dnout2 = 4;
    cout<< "dnout = "<<dnout<<" add = "<< &dnout <<endl;
    cout<< "dnout = "<<dnout2<<" add = "<< &dnout2 <<endl;

x86_64的环境编译指令:

clang++ -Wall -g -std=c++11 -stdlib=libc++ test.cpp -o test
./test

运行结果:

dnout = 4 add = 0x7fff 6960 277c
dnout = 4 add = 0x7fff 6960 2778

发现地址并不是想像中的0x[0-f]{16} 我的64位电脑地址线只有48根!

然后以32位编译

clang++ -Wall -g -m32 -std=c++11 -stdlib=libc++ test.cpp -o test
./test

dnout = 4 add = 0xc001 5974
dnout = 4 add = 0xc001 5970

正常的32根地址线。

百度 google后 发现目前不兼容32位的安腾也只有50根地址线。

http://ark.intel.com/products/43407/Intel-Itanium-Processor-9310-10M-Cache-1_60-GHz-4_80-GTs-Intel-QPI  

一般的x86_64 intel的产品 ,有36,40,46 等等根地址线的产品

至于,为什么console显示48根地址线,应该归功于操作系统的虚拟地址。根据操作系统的不同而不同把。

这是签名?
原文地址:https://www.cnblogs.com/Lelpuchcr/p/3139201.html