Skip to content
Snippets Groups Projects
Commit 82bbbb73 authored by Robin Dapp's avatar Robin Dapp
Browse files

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.
parent 458db9b6
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment