Add CPU features (sse3, ssse3) detection code for x86-64.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
This commit is contained in:
Erik de Castro Lopo
2013-09-15 09:46:17 +10:00
parent b72540b43c
commit 84c3e3d52c
2 changed files with 75 additions and 4 deletions

View File

@@ -41,6 +41,7 @@
typedef enum {
FLAC__CPUINFO_TYPE_IA32,
FLAC__CPUINFO_TYPE_X86_64,
FLAC__CPUINFO_TYPE_PPC,
FLAC__CPUINFO_TYPE_UNKNOWN
} FLAC__CPUInfo_Type;
@@ -60,6 +61,11 @@ typedef struct {
FLAC__bool extmmx;
} FLAC__CPUInfo_IA32;
typedef struct {
FLAC__bool sse3;
FLAC__bool ssse3;
} FLAC__CPUInfo_x86_64;
typedef struct {
FLAC__bool altivec;
FLAC__bool ppc64;
@@ -70,6 +76,7 @@ typedef struct {
FLAC__CPUInfo_Type type;
union {
FLAC__CPUInfo_IA32 ia32;
FLAC__CPUInfo_x86_64 x86_64;
FLAC__CPUInfo_PPC ppc;
} data;
} FLAC__CPUInfo;
@@ -77,6 +84,7 @@ typedef struct {
void FLAC__cpu_info(FLAC__CPUInfo *info);
#ifndef FLAC__NO_ASM
#ifdef FLAC__CPU_IA32
#ifdef FLAC__HAS_NASM
FLAC__uint32 FLAC__cpu_have_cpuid_asm_ia32(void);
@@ -84,6 +92,13 @@ void FLAC__cpu_info_asm_ia32(FLAC__uint32 *flags_edx, FLAC__uint32 *flag
FLAC__uint32 FLAC__cpu_info_extended_amd_asm_ia32(void);
#endif
#endif
#if defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64
#ifdef FLAC__HAS_X86INTRIN
void FLAC__cpu_info_x86(FLAC__uint32 *flags_edx, FLAC__uint32 *flags_ecx);
#endif
#endif
#endif
#endif