From 1c821e00b4ab687407f9cc4f859e62aabe2d7ede Mon Sep 17 00:00:00 2001 From: divinity76 Date: Thu, 1 Feb 2024 10:47:17 +0100 Subject: [PATCH] PR review feedback --- c/blake3.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/c/blake3.c b/c/blake3.c index 09f2d02..de3b7f7 100644 --- a/c/blake3.c +++ b/c/blake3.c @@ -342,17 +342,12 @@ INLINE void compress_subtree_to_parent_node( chunk_counter, flags, cv_array); assert(num_cvs <= MAX_SIMD_DEGREE_OR_2); - // If MAX_SIMD_DEGREE is greater than 2 and there's enough input, +#if MAX_SIMD_DEGREE_OR_2 > 2 + // If MAX_SIMD_DEGREE_OR_2 is greater than 2 and there's enough input, // compress_subtree_wide() returns more than 2 chaining values. Condense // them into 2 by forming parent nodes repeatedly. uint8_t out_array[MAX_SIMD_DEGREE_OR_2 * BLAKE3_OUT_LEN / 2]; - // The second half of this loop condition is always true, and we just - // asserted it above. But GCC can't tell that it's always true, and if NDEBUG - // is set on platforms where MAX_SIMD_DEGREE_OR_2 == 2, GCC emits spurious - // warnings here. GCC 8.5 is particularly sensitive, so if you're changing - // this code, test it against that version. -#if MAX_SIMD_DEGREE_OR_2 > 2 - while (num_cvs > 2 && num_cvs <= MAX_SIMD_DEGREE_OR_2) { + while (num_cvs > 2) { num_cvs = compress_parents_parallel(cv_array, num_cvs, key, flags, out_array); memcpy(cv_array, out_array, num_cvs * BLAKE3_OUT_LEN);