Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

/home/jeroen/FOX/fox/fox-1.7.33/include/fxcpuid.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                              C P U I D   S u p p o r t                        *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1998,2012 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (at your option) any later version.                                           *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 ********************************************************************************/
00021 #ifndef FXCPUID_H
00022 #define FXCPUID_H
00023 
00024 
00025 namespace FX {
00026 
00027 
00028 // CPU Features for x86/x86-64
00029 enum {
00030   CPU_HAS_TSC       = 0x00001,
00031   CPU_HAS_MMX       = 0x00002,
00032   CPU_HAS_CMOV      = 0x00004,
00033   CPU_HAS_SSE       = 0x00008,
00034   CPU_HAS_SSE2      = 0x00010,
00035   CPU_HAS_SSE3      = 0x00020,
00036   CPU_HAS_SSSE3     = 0x00040,
00037   CPU_HAS_SSE4A     = 0x00080,
00038   CPU_HAS_SSE41     = 0x00100,
00039   CPU_HAS_SSE42     = 0x00200,
00040   CPU_HAS_POPCNT    = 0x00400,
00041   CPU_HAS_MOVBE     = 0x00800,
00042   CPU_HAS_CMPXCHG8  = 0x01000,
00043   CPU_HAS_CMPXCHG16 = 0x02000,
00044   CPU_HAS_3DNOWEXT  = 0x04000,
00045   CPU_HAS_3DNOW     = 0x08000
00046   };
00047 
00048 
00052 extern FXAPI FXbool fxCPUIDPresent();
00053 
00061 extern FXAPI FXuint fxCPUCaps(FXuint level=0);
00062 
00071 extern FXAPI FXbool fxCPUGetCaps(FXuint level,FXuint features[]);
00072 
00082 extern FXAPI FXbool fxCPUGetXCaps(FXuint level,FXuint count,FXuint features[]);
00083 
00088 extern FXAPI FXuint fxCPUFeatures();
00089 
00095 extern FXAPI FXbool fxCPUName(FXchar name[]);
00096 
00097 }
00098 
00099 #endif

Copyright © 1997-2011 Jeroen van der Zijp