Skip to content
Snippets Groups Projects
Commit d8545fb2 authored by liuhongt's avatar liuhongt
Browse files

Detect bswap + rotate for byte permutation in pass_bswap.

The patch doesn't handle:
  1. cast64_to_32,
  2. memory source with rsize < range.

gcc/ChangeLog:

	PR middle-end/108938
	* gimple-ssa-store-merging.cc (is_bswap_or_nop_p): New
	function, cut from original find_bswap_or_nop function.
	(find_bswap_or_nop): Add a new parameter, detect bswap +
	rotate and save rotate result in the new parameter.
	(bswap_replace): Add a new parameter to indicate rotate and
	generate rotate stmt if needed.
	(maybe_optimize_vector_constructor): Adjust for new rotate
	parameter in the upper 2 functions.
	(pass_optimize_bswap::execute): Ditto.
	(imm_store_chain_info::output_merged_store): Ditto.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/pr108938-1.c: New test.
	* gcc.target/i386/pr108938-2.c: New test.
	* gcc.target/i386/pr108938-3.c: New test.
	* gcc.target/i386/pr108938-load-1.c: New test.
	* gcc.target/i386/pr108938-load-2.c: New test.
parent 365b1d54
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