Skip to content

Commit c8a6e56

Browse files
committed
Fix
1 parent bae48fc commit c8a6e56

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/libunicode/simd_detector.cpp

+8-7
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
// auto max_simd_size() -> size_t;
1212

1313
void cpuid(int32_t out[4], int32_t eax, int32_t ecx);
14+
#if _WIN32
15+
__int64 xgetbv(unsigned int x);
16+
#elif defined(__GNUC__) || defined(__clang__)
1417
uint64_t xgetbv(unsigned int index);
15-
enum class Simd_Size
16-
{
17-
sse2,
18-
avx,
19-
};
20-
auto detect_os_avx() -> bool;
18+
#else
19+
#endif
20+
21+
auto detect_os_avx() -> bool;
2122
auto detect_os_avx512() -> bool;
2223

2324
#if defined(__x86_64__) || defined(_M_X64) || defined(__i386) || defined(_M_IX86)
@@ -65,7 +66,7 @@ auto detect_os_avx() -> bool
6566

6667
if (osUsesXSAVE_XRSTORE && cpuAVXSuport)
6768
{
68-
uint64_t const xcrFeatureMask = xgetbv(_XCR_XFEATURE_ENABLED_MASK);
69+
auto const xcrFeatureMask = xgetbv(_XCR_XFEATURE_ENABLED_MASK);
6970
avxSupported = (xcrFeatureMask & 0x6) == 0x6;
7071
}
7172

0 commit comments

Comments
 (0)