diff options
author | Siavash Eliasi <[email protected]> | 2014-11-08 12:05:05 +0330 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2014-11-26 20:08:38 +0000 |
commit | 8dc8c496e1de4415d9595c53735c213b4e91c135 (patch) | |
tree | 7aa72b27243691d805543b4f5d01af6a93dad56d /src | |
parent | 752c2e9690cf4c4b087d66241ae60316558fca22 (diff) |
mesa: Permanently enable features supported by target CPU at compile time.
This will remove the need for unnecessary runtime checks for CPU features if
already supported by target CPU, resulting in smaller and less branchy code.
V2:
- Removed the SSSE3 related part for the not yet merged patch.
- Avoiding redefinition of macros.
Tested-by: David Heidelberg <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/x86/common_x86_features.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mesa/x86/common_x86_features.h b/src/mesa/x86/common_x86_features.h index 66f2cf651c2..65634aa5dff 100644 --- a/src/mesa/x86/common_x86_features.h +++ b/src/mesa/x86/common_x86_features.h @@ -59,13 +59,39 @@ #define X86_CPUEXT_3DNOW_EXT (1<<30) #define X86_CPUEXT_3DNOW (1<<31) +#ifdef __MMX__ +#define cpu_has_mmx 1 +#else #define cpu_has_mmx (_mesa_x86_cpu_features & X86_FEATURE_MMX) +#endif + #define cpu_has_mmxext (_mesa_x86_cpu_features & X86_FEATURE_MMXEXT) + +#ifdef __SSE__ +#define cpu_has_xmm 1 +#else #define cpu_has_xmm (_mesa_x86_cpu_features & X86_FEATURE_XMM) +#endif + +#ifdef __SSE2__ +#define cpu_has_xmm2 1 +#else #define cpu_has_xmm2 (_mesa_x86_cpu_features & X86_FEATURE_XMM2) +#endif + +#ifdef __3dNOW__ +#define cpu_has_3dnow 1 +#else #define cpu_has_3dnow (_mesa_x86_cpu_features & X86_FEATURE_3DNOW) +#endif + #define cpu_has_3dnowext (_mesa_x86_cpu_features & X86_FEATURE_3DNOWEXT) + +#ifdef __SSE4_1__ +#define cpu_has_sse4_1 1 +#else #define cpu_has_sse4_1 (_mesa_x86_cpu_features & X86_FEATURE_SSE4_1) +#endif #endif |