Skip to content

Commit e2f0536

Browse files
AntoinePrvserge-sans-paille
authored andcommitted
Fix subleaf in Intel CPUID
1 parent 5a270a9 commit e2f0536

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

include/xsimd/config/xsimd_cpu_features_x86.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -528,12 +528,12 @@ namespace xsimd
528528
__cpuidex(buf, leaf, subleaf);
529529
std::memcpy(reg.data(), buf, sizeof(buf));
530530

531-
#elif defined(__INTEL_COMPILER)
532-
int buf[4];
533-
__cpuid(buf, leaf);
534-
std::memcpy(reg.data(), buf, sizeof(buf));
535-
536-
#elif defined(__GNUC__) || defined(__clang__)
531+
// Intel compiler has long had support for `__cpuid`, but only recently for `__cpuidex`.
532+
// Modern Clang and GCC also now support `__cpuidex`.
533+
// It was decided to keep the inline ASM version for maximum compatibility, as the difference
534+
// in ASM is negligible compared to the cost of CPUID.
535+
// https://github.com/xtensor-stack/xsimd/pull/1278
536+
#elif defined(__GNUC__) || defined(__clang__) || defined(__INTEL_COMPILER)
537537

538538
#if defined(__i386__) && defined(__PIC__)
539539
// %ebx may be the PIC register

0 commit comments

Comments
 (0)