File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -3329,6 +3329,23 @@ static xxh_u64 XXH64_round(xxh_u64 acc, xxh_u64 input)
3329
3329
acc += input * XXH_PRIME64_2;
3330
3330
acc = XXH_rotl64 (acc, 31 );
3331
3331
acc *= XXH_PRIME64_1;
3332
+ #if (defined(__AVX512F__)) && !defined(XXH_ENABLE_AUTOVECTORIZE)
3333
+ /*
3334
+ * DISABLE AUTOVECTORIZATION:
3335
+ * A compiler fence is used to prevent GCC and Clang from
3336
+ * autovectorizing the XXH64 loop (pragmas and attributes don't work for some
3337
+ * reason) without globally disabling AVX512.
3338
+ *
3339
+ * Autovectorization of XXH64 tends to be detrimental,
3340
+ * though the exact outcome may change depending on exact cpu and compiler version.
3341
+ * For information, it has been reported as detrimental for Skylake-X,
3342
+ * but possibly beneficial for Zen4.
3343
+ *
3344
+ * The default is to disable auto-vectorization,
3345
+ * but you can select to enable it instead using `XXH_ENABLE_AUTOVECTORIZE` build variable.
3346
+ */
3347
+ XXH_COMPILER_GUARD (acc);
3348
+ #endif
3332
3349
return acc;
3333
3350
}
3334
3351
You can’t perform that action at this time.
0 commit comments