File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -332,11 +332,11 @@ cpuid_features_finalize(_Py_cpuid_features *flags)
332332 flags -> ready = 1 ;
333333}
334334
335- static int
336- cpuid_features_validate (const _Py_cpuid_features * flags )
335+ int
336+ _Py_cpuid_check_features (const _Py_cpuid_features * flags )
337337{
338338 if (flags -> ready != 1 ) {
339- return -1 ;
339+ return 0 ;
340340 }
341341
342342 // AVX-512/F is required to support any other AVX-512 instruction set
@@ -354,16 +354,10 @@ cpuid_features_validate(const _Py_cpuid_features *flags)
354354 );
355355
356356 if (!flags -> avx512_f && !avx512_require_f ) {
357- return -1 ;
357+ return 0 ;
358358 }
359359
360- return 0 ;
361- }
362-
363- int
364- _Py_cpuid_check_features (const _Py_cpuid_features * flags )
365- {
366- return cpuid_features_validate (flags ) < 0 ? 0 : 1 ;
360+ return 1 ;
367361}
368362
369363/*
@@ -552,7 +546,7 @@ _Py_cpuid_detect_features(_Py_cpuid_features *flags)
552546 cpuid_detect_l1_features (flags );
553547 cpuid_detect_l7_features (flags );
554548 cpuid_features_finalize (flags );
555- if (cpuid_features_validate (flags ) < 0 ) {
549+ if (! _Py_cpuid_check_features (flags )) {
556550 _Py_cpuid_disable_features (flags );
557551 }
558552#endif // !HAS_CPUID_SUPPORT
You can’t perform that action at this time.
0 commit comments