]> gcc.gnu.org Git - gcc.git/commit
RISC-V: Add popcount fallback expander.
authorRobin Dapp <rdapp@ventanamicro.com>
Wed, 18 Oct 2023 08:26:55 +0000 (10:26 +0200)
committerRobin Dapp <rdapp@ventanamicro.com>
Mon, 23 Oct 2023 16:42:11 +0000 (18:42 +0200)
commit82bbbb73c67f79582d38a1aa63984987dcd0923a
tree0d9e3d3699123fe2533898cb19d7c7cfefe0c23a
parent458db9b6149b2e9bef94ab76909eb914ed9f675a
RISC-V: Add popcount fallback expander.

I didn't manage to get back to the generic vectorizer fallback for
popcount so I figured I'd rather create a popcount fallback in the
riscv backend.  It uses the WWG algorithm from libgcc.

gcc/ChangeLog:

* config/riscv/autovec.md (popcount<mode>2): New expander.
* config/riscv/riscv-protos.h (expand_popcount): Define.
* config/riscv/riscv-v.cc (expand_popcount): Vectorize popcount
with the WWG algorithm.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/unop/popcount-1.c: New test.
* gcc.target/riscv/rvv/autovec/unop/popcount-2.c: New test.
* gcc.target/riscv/rvv/autovec/unop/popcount-run-1.c: New test.
* gcc.target/riscv/rvv/autovec/unop/popcount.c: New test.
gcc/config/riscv/autovec.md
gcc/config/riscv/riscv-protos.h
gcc/config/riscv/riscv-v.cc
gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/popcount-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/popcount-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/popcount-run-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/popcount.c [new file with mode: 0644]
This page took 0.069014 seconds and 5 git commands to generate.