Skip to content
Snippets Groups Projects
Commit 9ffcf1f1 authored by Pengxuan Zheng's avatar Pengxuan Zheng
Browse files

aarch64: Improve scalar mode popcount expansion by using SVE [PR113860]


This is similar to the recent improvements to the Advanced SIMD popcount
expansion by using SVE. We can utilize SVE to generate more efficient code for
scalar mode popcount too.

Changes since v1:
* v2: Add a new VNx1BI mode and a new test case for V1DI.
* v3: Abandon VNx1BI changes and add a new variant of aarch64_ptrue_reg.

	PR target/113860

gcc/ChangeLog:

	* config/aarch64/aarch64-protos.h (aarch64_ptrue_reg): New function.
	* config/aarch64/aarch64-simd.md (popcount<mode>2): Update pattern to
	also support V1DI mode.
	* config/aarch64/aarch64.cc (aarch64_ptrue_reg): New function.
	* config/aarch64/aarch64.md (popcount<mode>2): Add TARGET_SVE support.
	* config/aarch64/iterators.md (VDQHSD_V1DI): New mode iterator.
	(SVE_VDQ_I): Add V1DI.
	(bitsize): Likewise.
	(VPRED): Likewise.
	(VEC_POP_MODE): New mode attribute.
	(vec_pop_mode): Likewise.

gcc/testsuite/ChangeLog:

	* gcc.target/aarch64/popcnt-sve.c: Update test.
	* gcc.target/aarch64/popcnt11.c: New test.
	* gcc.target/aarch64/popcnt12.c: New test.

Signed-off-by: default avatarPengxuan Zheng <quic_pzheng@quicinc.com>
parent 774ad67f
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