Detect SSE 4.1 and SSE 4.1.

This commit is contained in:
gbeauche 2008-01-01 13:34:47 +00:00
parent 054c37ca0c
commit c581996f82
2 changed files with 21 additions and 1 deletions

View File

@ -33,7 +33,9 @@ enum {
HWCAP_I386_EDX_FLAGS = (HWCAP_I386_CMOV|HWCAP_I386_MMX|HWCAP_I386_SSE|HWCAP_I386_SSE2),
HWCAP_I386_SSE3 = 1 << 0,
HWCAP_I386_SSSE3 = 1 << 9,
HWCAP_I386_ECX_FLAGS = (HWCAP_I386_SSE3|HWCAP_I386_SSSE3),
HWCAP_I386_SSE4_1 = 1 << 19,
HWCAP_I386_SSE4_2 = 1 << 20,
HWCAP_I386_ECX_FLAGS = (HWCAP_I386_SSE3|HWCAP_I386_SSSE3|HWCAP_I386_SSE4_1|HWCAP_I386_SSE4_2)
};
// Determine x86 CPU features
@ -116,6 +118,18 @@ bool cpuinfo_check_ssse3(void)
return x86_cpu_features & HWCAP_I386_SSSE3;
}
// Check for x86 feature SSE4.1
bool cpuinfo_check_sse4_1(void)
{
return x86_cpu_features & HWCAP_I386_SSE4_1;
}
// Check for x86 feature SSE4_2
bool cpuinfo_check_sse4_2(void)
{
return x86_cpu_features & HWCAP_I386_SSE4_2;
}
// PowerPC CPU features
static uint32 ppc_cpu_features = 0;

View File

@ -39,6 +39,12 @@ extern bool cpuinfo_check_sse3(void);
// Check for x86 feature SSSE3
extern bool cpuinfo_check_ssse3(void);
// Check for x86 feature SSE4.1
extern bool cpuinfo_check_sse4_1(void);
// Check for x86 feature SSE4_2
extern bool cpuinfo_check_sse4_2(void);
// Check for ppc feature VMX (Altivec)
extern bool cpuinfo_check_altivec(void);