Delete wuffs_base__cpu_arch__x86_64__capabilities

This commit is contained in:
Nigel Tao committed 2021-02-18 13:30:28 +11:00
1 parent c8be16af3e
commit bbc720c261
3 files changed
+1 -89

No files matched your search

-43
View File
@@ -142,49 +142,6 @@ wuffs_base__cpu_arch__have_arm_neon() {
#endif // defined(WUFFS_BASE__CPU_ARCH__ARM_NEON)
}
// WUFFS_BASE__CPU_ARCH__X86_64__ETC are bits returned by
// wuffs_base__cpu_arch__x86_64__capabilities.
// - "SSE42" means all of SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, PCLMUL and
// POPCNT.
// - "AVX2" means all of AVX and AVX2.
// - "AVX512ETC" is reserved, pending need. Note that AVX-512 consists of
// multiple extensions that may be implemented independently.
#define WUFFS_BASE__CPU_ARCH__X86_64__SSE42 0x01
#define WUFFS_BASE__CPU_ARCH__X86_64__AVX2 0x02
static inline uint32_t //
wuffs_base__cpu_arch__x86_64__capabilities() {
#if defined(WUFFS_BASE__CPU_ARCH__X86_64)
uint32_t ret = 0;
unsigned int eax1 = 0;
unsigned int ebx1 = 0;
unsigned int ecx1 = 0;
unsigned int edx1 = 0;
if (__get_cpuid(1, &eax1, &ebx1, &ecx1, &edx1)) {
const unsigned int sse42_ecx1 = bit_PCLMUL | bit_POPCNT | bit_SSE4_2;
if ((ecx1 & sse42_ecx1) == sse42_ecx1) {
ret |= WUFFS_BASE__CPU_ARCH__X86_64__SSE42;
}
}
unsigned int eax7 = 0;
unsigned int ebx7 = 0;
unsigned int ecx7 = 0;
unsigned int edx7 = 0;
if (__get_cpuid_count(7, 0, &eax7, &ebx7, &ecx7, &edx7)) {
const unsigned int avx256_ebx7 = bit_AVX2;
if ((ebx7 & avx256_ebx7) == avx256_ebx7) {
ret |= WUFFS_BASE__CPU_ARCH__X86_64__AVX2;
}
}
return ret;
#else
return 0;
#endif // defined(WUFFS_BASE__CPU_ARCH__X86_64)
}
static inline bool //
wuffs_base__cpu_arch__have_sse42() {
#if defined(WUFFS_BASE__CPU_ARCH__X86_64)