[arm] Improve constant handling for subvsi4.
commit238273fe06e3da6dd1d80b04217d53c76cf5fa41
authorRichard Earnshaw <rearnsha@arm.com>
Fri, 18 Oct 2019 19:05:01 +0000 (18 19:05 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Fri, 18 Oct 2019 19:05:01 +0000 (18 19:05 +0000)
tree177180722b23c5cf0e36552f397dbc843cb3a815
parenteff5ce0a95699d3eeded9854bff25913cfbdb2f3
[arm] Improve constant handling for subvsi4.

This patch addresses constant handling in subvsi4.  Either operand may
be a constant.  If the second input (operand[2]) is a constant, then
we can canonicalize this into an addition form, providing we take care
of the INT_MIN case.  In that case the negation has to handle the fact
that -INT_MIN is still INT_MIN and we need to ensure that a subtract
operation is performed rather than an addition.  The remaining cases
are largely duals of the usubvsi4 expansion.

This patch also fixes a technical correctness bug in the old
expansion, where we did not realy describe the test for overflow in
the RTL.  We seem to have got away with that, however...

* config/arm/arm.md (subv<mode>4): Delete.
(subvdi4): New expander pattern.
(subvsi4): Likewise.  Handle some immediate values.
(subvsi3_intmin): New insn pattern.
(subvsi3): Likewise.
(subvsi3_imm1): Likewise.
* config/arm/arm.c (select_cc_mode): Also allow minus for CC_V
idioms.

From-SVN: r277189
gcc/ChangeLog
gcc/config/arm/arm.c
gcc/config/arm/arm.md