summaryrefslogtreecommitdiffstats
path: root/src/mesa/x86/common_x86.c
diff options
context:
space:
mode:
authorMatt Atwood <[email protected]>2014-05-02 09:44:44 -0700
committerMatt Turner <[email protected]>2014-05-22 10:17:16 -0700
commita2fb71e23bced3f3585e91726590efe6034a10ed (patch)
tree1c97317b16355bc29ebc76f1649cab5acee52067 /src/mesa/x86/common_x86.c
parent8b9302f2b4b0536abb91cb73682ec13640fe9eaf (diff)
mesa/x86: add SSE4.1 runtime detection.
Add a bit to _mesa_x86_features for SSE 4.1, along with macros to query. Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa/x86/common_x86.c')
-rw-r--r--src/mesa/x86/common_x86.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/x86/common_x86.c b/src/mesa/x86/common_x86.c
index a91f07e2e89..08b1558975a 100644
--- a/src/mesa/x86/common_x86.c
+++ b/src/mesa/x86/common_x86.c
@@ -241,6 +241,7 @@ _mesa_get_x86_features(void)
/* get cpu features */
cpu_features = _mesa_x86_cpuid_edx(1);
+ cpu_features_ecx = _mesa_x86_cpuid_ecx(1);
if (cpu_features & X86_CPU_FPU)
_mesa_x86_cpu_features |= X86_FEATURE_FPU;
@@ -257,6 +258,8 @@ _mesa_get_x86_features(void)
_mesa_x86_cpu_features |= X86_FEATURE_XMM;
if (cpu_features & X86_CPU_XMM2)
_mesa_x86_cpu_features |= X86_FEATURE_XMM2;
+ if (cpu_features & x86_CPU_SSE4_1)
+ _mesa_x86_features |= X86_FEATURE_SSE4_1;
#endif
/* query extended cpu features */
@@ -341,6 +344,9 @@ _mesa_get_x86_features(void)
_mesa_x86_cpu_features |= X86_FEATURE_XMM | X86_FEATURE_XMM2;
__get_cpuid(1, &eax, &ebx, &ecx, &edx);
+
+ if (ecx & bit_SSE4_1)
+ _mesa_x86_cpu_features |= X86_FEATURE_SSE4_1;
#endif /* USE_X86_ASM */
(void) detection_debug;