Unix: which cpu do you have
Want to know what your CPU can do? I tell you how to get instruction set architectures supported on the currently running system. I mean sse, sse2, mmx etc. There are several ways for doing it. I'll show:
Solaris 5.10, isainfo command:
$ isainfo -v
64-bit amd64 applications
cx16 mon sse3 sse2 sse fxsr mmx cmov amd_sysc cx8 tsc fpu
32-bit i386 applications
ahf cx16 mon sse3 sse2 sse fxsr mmx cmov sep cx8 tsc fpu
Linux, look into /proc/cpuinfo:
$ /proc/cpuinfo bash: /proc/cpuinfo: Permission denied bash-3.00$ cat /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 15 model : 39 model name : AMD Opteron(tm) Processor 152 stepping : 1 cpu MHz : 1005.159 cache size : 1024 KB fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext lm 3dnowext 3dnow pni bogomips : 2012.28 TLB size : 1088 4K pages clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: ts fid vid ttpThere can be only one problem. Your operation system can be older then you CPU. In this case you will never see any new instruction sets that your processor may support. So I want to provide one more magic for this thing. SunStudio can help:
$ isainfo -v
64-bit amd64 applications
cx16 mon sse3 sse2 sse fxsr mmx cmov amd_sysc cx8 tsc fpu
32-bit i386 applications
ahf cx16 mon sse3 sse2 sse fxsr mmx cmov sep cx8 tsc fpu
$ /shared/dp/sstrunk/intel-S2/bin/CC -xarch=native -v
### command line files and options (expanded):
### -xarch=sse4.1 -v
Usage: CC [ options ] files. Use 'CC -flags' for details
First we use isainfo command, it says that we have only sse3 instruction.Second we use C++ SunStudio compiler, it says that we can use sse4.1 instructions.
Hope this short topic helps someboby :)

For Solaris 'psrinfo -pv' is also useful as it tells you the name and model as well as processor speed
Posted by Darren Moffat on August 22, 2008 at 05:17 PM GMT+03:00 #
Thanks for useful comment.
Posted by ahot on August 23, 2008 at 08:14 PM GMT+03:00 #