diff options
author | Robin Dapp <rdapp@ventanamicro.com> | 2023-10-18 10:26:55 +0200 |
---|---|---|
committer | Robin Dapp <rdapp@ventanamicro.com> | 2023-10-23 18:42:11 +0200 |
commit | 82bbbb73c67f79582d38a1aa63984987dcd0923a (patch) | |
tree | 0d9e3d3699123fe2533898cb19d7c7cfefe0c23a /gcc/config/riscv/riscv-protos.h | |
parent | 458db9b6149b2e9bef94ab76909eb914ed9f675a (diff) | |
download | gcc-82bbbb73c67f79582d38a1aa63984987dcd0923a.zip gcc-82bbbb73c67f79582d38a1aa63984987dcd0923a.tar.gz gcc-82bbbb73c67f79582d38a1aa63984987dcd0923a.tar.bz2 |
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.
Diffstat (limited to 'gcc/config/riscv/riscv-protos.h')
-rw-r--r-- | gcc/config/riscv/riscv-protos.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/config/riscv/riscv-protos.h b/gcc/config/riscv/riscv-protos.h index 5dc97c2..6cb9d45 100644 --- a/gcc/config/riscv/riscv-protos.h +++ b/gcc/config/riscv/riscv-protos.h @@ -521,6 +521,7 @@ void expand_fold_extract_last (rtx *); void expand_cond_unop (unsigned, rtx *); void expand_cond_binop (unsigned, rtx *); void expand_cond_ternop (unsigned, rtx *); +void expand_popcount (rtx *); /* Rounding mode bitfield for fixed point VXRM. */ enum fixed_point_rounding_mode |