转自:http://blog.chinaunix.net/uid-20344928-id-2985712.html
32 or 64
linux下查看操作CPU的运行位数:
getconf LONG_BIT
如结果是32,表示当前CPU工作在32位模式下(即操作系统是32位的),但并不表示CPU一定是32位的(64位的也可以当32位的来用)。要查看cpu是否支持64bit,方法如下:
# cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l
如结果大于0, 说明支持64bit处理模式。
顺便说一下,64位的CPU必须运行在64位的操作系统下,才能实现64位的运算模式。
windows下查看操作系统和CPU的位数:
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Xeon(R) CPU X3220 @ 2.40GHz
stepping : 11
cpu MHz : 2400.267
cache size : 4096 KB
physical id : 0
siblings : 4
core id : 3
cpu cores : 4
apicid : 3
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm
bogomips : 4799.50

CPU: Physical Processor ID: 0
CPU: Physical Processor ID: 0
CPU: Physical Processor ID: 0
[01]: x86 Family 15 Model 107 Stepping 2 AuthenticAMD ~2200 Mhz
[02]: x86 Family 15 Model 107 Stepping 2 AuthenticAMD ~2200 Mhz