Skip to content

Commit 08daa8a

Browse files
committed
fix SIMD-256 detection
1 parent 3d56d93 commit 08daa8a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Modules/blake2module.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ blake2module_init_cpu_features(Blake2State *state)
122122
#endif
123123

124124
#if _Py_HACL_CAN_COMPILE_VEC256
125-
state->can_run_simd256 = flags.avx && flags.avx2;
125+
state->can_run_simd256 = state->can_run_simd128
126+
&& flags.avx && flags.avx2;
126127
#else
127128
state->can_run_simd256 = false;
128129
#endif

Modules/hmacmodule.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,8 @@ hmacmodule_init_cpu_features(hmacmodule_state *state)
15641564
#endif
15651565

15661566
#if _Py_HACL_CAN_COMPILE_VEC256
1567-
state->can_run_simd256 = flags.avx && flags.avx2;
1567+
state->can_run_simd256 = state->can_run_simd128
1568+
&& flags.avx && flags.avx2;
15681569
#else
15691570
state->can_run_simd256 = false;
15701571
#endif

0 commit comments

Comments
 (0)