File tree 1 file changed +8
-7
lines changed
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 11
11
// auto max_simd_size() -> size_t;
12
12
13
13
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__)
14
17
uint64_t xgetbv (unsigned int index);
15
- enum class Simd_Size
16
- {
17
- sse2,
18
- avx,
19
- };
18
+ #else
19
+ #endif
20
+
20
21
auto detect_os_avx () -> bool;
21
22
auto detect_os_avx512 () -> bool;
22
23
@@ -65,7 +66,7 @@ auto detect_os_avx() -> bool
65
66
66
67
if (osUsesXSAVE_XRSTORE && cpuAVXSuport)
67
68
{
68
- uint64_t const xcrFeatureMask = xgetbv (_XCR_XFEATURE_ENABLED_MASK);
69
+ auto const xcrFeatureMask = xgetbv (_XCR_XFEATURE_ENABLED_MASK);
69
70
avxSupported = (xcrFeatureMask & 0x6 ) == 0x6 ;
70
71
}
71
72
@@ -114,7 +115,7 @@ auto unicode::detail::max_simd_size() -> size_t
114
115
if (nIds >= 0x00000007 )
115
116
{
116
117
cpuid (info, 0x00000007 , 0 );
117
- bool const HW_AVX2 = (info[1 ] & ((int ) 1 << 5 )) != 0 ;
118
+ bool const HW_AVX2 = (info[1 ] & ((int ) 1 << 5 ));
118
119
if (!HW_AVX2)
119
120
return 128 ;
120
121
You can’t perform that action at this time.
0 commit comments