Skip to content
Snippets Groups Projects
Commit 835d50c6 authored by Richard Sandiford's avatar Richard Sandiford Committed by Richard Sandiford
Browse files

[AArch64] Fix cost of (plus ... (const_int -C))

The PLUS handling in aarch64_rtx_costs only checked for nonnegative
constants, meaning that simple immediate subtractions like:

  (set (reg R1) (plus (reg R2) (const_int -8)))

had a cost of two instructions.

2019-09-26  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* config/aarch64/aarch64.c (aarch64_rtx_costs): Use
	aarch64_plus_immediate rather than aarch64_uimm12_shift
	to test for valid PLUS immediates.

From-SVN: r276140
parent ec14f8ab
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