Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygengetcpuflags.h
Go to the documentation of this file.
00001 /* 00002 getcpucpuflags: get cpuflags for ia32 00003 00004 copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1 00005 see COPYING and AUTHORS files in distribution or http:#mpg123.org 00006 initially written by KIMURA Takuhiro (for 3DNow!) 00007 extended for general use by Thomas Orgis 00008 */ 00009 00010 #ifndef MPG123_H_GETCPUFLAGS 00011 #define MPG123_H_GETCPUFLAGS 00012 00013 /* standard level flags part 1 (ECX)*/ 00014 #define FLAG_SSE3 0x00000001 00015 00016 /* standard level flags part 2 (EDX) */ 00017 #define FLAG2_MMX 0x00800000 00018 #define FLAG2_SSE 0x02000000 00019 #define FLAG2_SSE2 0x04000000 00020 #define FLAG2_FPU 0x00000001 00021 /* cpuid extended level 1 (AMD) */ 00022 #define XFLAG_MMX 0x00800000 00023 #define XFLAG_3DNOW 0x80000000 00024 #define XFLAG_3DNOWEXT 0x40000000 00025 00026 struct cpuflags 00027 { 00028 unsigned int id; 00029 unsigned int std; 00030 unsigned int std2; 00031 unsigned int ext; 00032 }; 00033 00034 extern struct cpuflags cpu_flags; 00035 00036 unsigned int getcpuflags(struct cpuflags* cf); 00037 00038 /* checks the family */ 00039 #define cpu_i586(s) ( ((s.id & 0xf00)>>8) == 0 || ((s.id & 0xf00)>>8) > 4 ) 00040 /* checking some flags... */ 00041 #define cpu_fpu(s) (FLAG2_FPU & s.std2) 00042 #define cpu_mmx(s) (FLAG2_MMX & s.std2 || XFLAG_MMX & s.ext) 00043 #define cpu_3dnow(s) (XFLAG_3DNOW & s.ext) 00044 #define cpu_3dnowext(s) (XFLAG_3DNOWEXT & s.ext) 00045 #define cpu_sse(s) (FLAG2_SSE & s.std2) 00046 #define cpu_sse2(s) (FLAG2_SSE2 & s.std2) 00047 #define cpu_sse3(s) (FLAG_SSE3 & s.std) 00048 00049 #endif Generated on Sun May 27 2012 04:33:12 for ReactOS by
1.7.6.1
|