common_x86_features.h revision 7117f1b4
1/* $Id: common_x86_features.h,v 1.1.1.1 2008/07/29 05:10:22 mrg Exp $ */ 2 3/* 4 * Mesa 3-D graphics library 5 * Version: 5.1 6 * 7 * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. 8 * 9 * Permission is hereby granted, free of charge, to any person obtaining a 10 * copy of this software and associated documentation files (the "Software"), 11 * to deal in the Software without restriction, including without limitation 12 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 13 * and/or sell copies of the Software, and to permit persons to whom the 14 * Software is furnished to do so, subject to the following conditions: 15 * 16 * The above copyright notice and this permission notice shall be included 17 * in all copies or substantial portions of the Software. 18 * 19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 */ 26 27/* 28 * x86 CPUID feature information. The raw data is returned by 29 * _mesa_identify_x86_cpu_features() and interpreted with the cpu_has_* 30 * helper macros. 31 * 32 * Gareth Hughes 33 */ 34 35#ifndef __COMMON_X86_FEATURES_H__ 36#define __COMMON_X86_FEATURES_H__ 37 38#define X86_FEATURE_FPU (1<<0) 39#define X86_FEATURE_CMOV (1<<1) 40#define X86_FEATURE_MMXEXT (1<<2) 41#define X86_FEATURE_MMX (1<<3) 42#define X86_FEATURE_FXSR (1<<4) 43#define X86_FEATURE_XMM (1<<5) 44#define X86_FEATURE_XMM2 (1<<6) 45#define X86_FEATURE_3DNOWEXT (1<<7) 46#define X86_FEATURE_3DNOW (1<<8) 47 48/* standard X86 CPU features */ 49#define X86_CPU_FPU (1<<0) 50#define X86_CPU_CMOV (1<<15) 51#define X86_CPU_MMX (1<<23) 52#define X86_CPU_XMM (1<<25) 53#define X86_CPU_XMM2 (1<<26) 54 55/* extended X86 CPU features */ 56#define X86_CPUEXT_MMX_EXT (1<<22) 57#define X86_CPUEXT_3DNOW_EXT (1<<30) 58#define X86_CPUEXT_3DNOW (1<<31) 59 60#define cpu_has_mmx (_mesa_x86_cpu_features & X86_FEATURE_MMX) 61#define cpu_has_mmxext (_mesa_x86_cpu_features & X86_FEATURE_MMXEXT) 62#define cpu_has_xmm (_mesa_x86_cpu_features & X86_FEATURE_XMM) 63#define cpu_has_xmm2 (_mesa_x86_cpu_features & X86_FEATURE_XMM2) 64#define cpu_has_3dnow (_mesa_x86_cpu_features & X86_FEATURE_3DNOW) 65#define cpu_has_3dnowext (_mesa_x86_cpu_features & X86_FEATURE_3DNOWEXT) 66 67#endif 68 69