-
- Downloads
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.
Showing
- gcc/config/riscv/autovec.md 14 additions, 0 deletionsgcc/config/riscv/autovec.md
- gcc/config/riscv/riscv-protos.h 1 addition, 0 deletionsgcc/config/riscv/riscv-protos.h
- gcc/config/riscv/riscv-v.cc 71 additions, 0 deletionsgcc/config/riscv/riscv-v.cc
- gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/popcount-1.c 20 additions, 0 deletionsgcc/testsuite/gcc.target/riscv/rvv/autovec/unop/popcount-1.c
- gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/popcount-2.c 19 additions, 0 deletionsgcc/testsuite/gcc.target/riscv/rvv/autovec/unop/popcount-2.c
- gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/popcount-run-1.c 49 additions, 0 deletions...tsuite/gcc.target/riscv/rvv/autovec/unop/popcount-run-1.c
- gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/popcount.c 1464 additions, 0 deletionsgcc/testsuite/gcc.target/riscv/rvv/autovec/unop/popcount.c
Loading
Please register or sign in to comment