Extend neg_const_int simplifications to other const rtxes
authorRichard Sandiford <richard.sandiford@arm.com>
Sat, 21 Sep 2019 12:56:50 +0000 (12:56 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sat, 21 Sep 2019 12:56:50 +0000 (12:56 +0000)
commit681fc0fa40cc4f018cb691d796aa819a24257774
tree1a8c7cd272154e48ea4d73bc50268b21cd13050b
parentb2addbf403fe60091ed4d2363cb36938b75b4892
Extend neg_const_int simplifications to other const rtxes

This patch generalises some neg_const_int-based rtx simplifications
so that they handle all CONST_SCALAR_INTs and also CONST_POLY_INT.
This actually simplifies things a bit, since we no longer have
to treat HOST_WIDE_INT_MIN specially.

This is tested by later SVE patches.

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

gcc/
* simplify-rtx.c (neg_const_int): Replace with...
(neg_poly_int_rtx): ...this new function.
(simplify_binary_operation_1): Extend (minus x C) -> (plus X -C)
to all CONST_SCALAR_INTs and to CONST_POLY_INT.
(simplify_plus_minus): Likewise for constant terms here.

From-SVN: r276017
gcc/ChangeLog
gcc/simplify-rtx.c