Hi Mathieu,
Mathieu Borderé <[email protected]> writes:
> I was looking around the coreutils wc codebase and noticed there was an AVX2
> line counting implementation, but no AVX512 version. I took a stab at adding
> one.
>
> On my machine running a Ryzen 9 7900, this results in a 10% speedup compared
> to AVX2 when counting lines in a file with a billion lines, see attached
> terminal output.
Great, thanks! I can't test immediately since since my system is too old
for AVX512.
This change will require a copyright assignment. Do you have one? I
don't have access to fencepost to check, and no one at the FSF seems to
watch the email for requesting one. :(
Minor ChangeLog nit:
> * src/wc.h: Declare wc_lines_avx512 function.
I would write this like:
* src/wc.h (wc_lines_avx512): Declare function.
> diff --git a/src/wc_avx512.c b/src/wc_avx512.c
> new file mode 100644
> index 000000000..41faea646
> --- /dev/null
> +++ b/src/wc_avx512.c
> @@ -0,0 +1,58 @@
> +/* wc_avx512 - Count the number of newlines with avx512 instructions.
> + Copyright (C) 2021-2025 Free Software Foundation, Inc.
Since it is a new file, I would put only 2025 for the copyright year.
I assume you put 2021 since the file was inspired by src/wc_avx2.c. But
I think it is different enough and we have that context in the commit
message.
> --- a/tests/wc/wc-cpu.sh
> +++ b/tests/wc/wc-cpu.sh
> @@ -19,7 +19,7 @@
> . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
> print_ver_ wc
Needs a copyright header. But thanks for providing a test!
Collin