home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / arts / cpuinfo.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-09-10  |  2.1 KB  |  73 lines

  1.     /*
  2.  
  3.     Copyright (C) 2001 Malte Starostik <malte@kde.org>
  4.  
  5.     This library is free software; you can redistribute it and/or
  6.     modify it under the terms of the GNU Library General Public
  7.     License as published by the Free Software Foundation; either
  8.     version 2 of the License, or (at your option) any later version.
  9.   
  10.     This library is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.     Library General Public License for more details.
  14.    
  15.     You should have received a copy of the GNU Library General Public License
  16.     along with this library; see the file COPYING.LIB.  If not, write to
  17.     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  18.     Boston, MA 02111-1307, USA.
  19.  
  20.     */
  21.  
  22. #ifndef _arts_cpuinfo_h
  23. #define _arts_cpuinfo_h
  24.  
  25. #include "arts_export.h"
  26. /*
  27.  * BC - Status (2002-03-08): CpuInfo
  28.  *
  29.  * This class will be kept binary compatible - it just exports the static
  30.  * CpuInfo::flags() function as only functionality.
  31.  */
  32.  
  33. namespace Arts {
  34.  
  35.     /**
  36.      * Provides information about the availability of the various
  37.      * "Multimedia extensions" the CPU supports. If you implement
  38.      * a routine in assembler, use @ref flags() to know which
  39.      * SIMD instructions the user's CPU knows about.
  40.      *
  41.      * @short Information about the CPU's SIMD implementation
  42.      */
  43.     class ARTS_EXPORT CpuInfo
  44.     {
  45.     public:
  46.         /**
  47.          * Values for the detected features of the CPU:
  48.          * @li CpuMMX - CPU supports MMX
  49.          * @li CpuEMMX - CPU supports Cyrix Extended MMX
  50.          * @li Cpu3DNow - CPU supports AMD 3DNow!
  51.          * @li CpuSSE - CPU supports Intel SSE
  52.          */
  53.         enum Flags
  54.         {
  55.             CpuMMX   = 0x001, // Pentium MMX
  56.             CpuEMMX  = 0x002, // Cyrix Extended MMX
  57.             Cpu3DNow = 0x004, // AMD 3DNow!
  58.             CpuSSE   = 0x008  // Pentium III SSE
  59.         };
  60.         /**
  61.          * @return the @ref Flags values that correspond to the
  62.          * CPU's features. Multiple values are bitwised or'ed
  63.          */
  64.         static int flags() { return s_flags; }
  65.     
  66.     private:
  67.         friend class CpuInfoStartup;
  68.         static int s_flags;
  69.     };
  70. }
  71.  
  72. #endif // _arts_cpuinfo_h
  73.