Skip to content
Snippets Groups Projects
Commit 2d7c73ee authored by Wilco Dijkstra's avatar Wilco Dijkstra
Browse files

AArch64: Enable TARGET_CONST_ANCHOR

Enable TARGET_CONST_ANCHOR to allow complex constants to be created via
immediate add/sub.  Use a 24-bit range as that enables a 3 or 4-instruction
immediate to be replaced by 2 add/sub instructions.  Fix the costing of
add/sub to support 24-bit and 12-bit shifted immediates.
The generated code for the testcase is now the same or better than LLVM.
It also results in a small codesize reduction on SPEC.

gcc/
	* config/aarch64/aarch64.cc (aarch64_rtx_costs): Add correct costs
	for 24-bit and 12-bit shifted immediate add/sub.
	(TARGET_CONST_ANCHOR): Define.
	* config/aarch64/predicates.md (aarch64_pluslong_immediate):
	Fix range check.

gcc/testsuite/
	* gcc.target/aarch64/movk_3.c: New test.
parent 4d9db4bd
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