[arm] Introduce arm_carry_operation
authorRichard Earnshaw <rearnsha@arm.com>
Fri, 18 Oct 2019 19:02:35 +0000 (19:02 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Fri, 18 Oct 2019 19:02:35 +0000 (19:02 +0000)
commit1e271beeec163b124eb424c0c9918b045e289c06
treee7d468a16e2a7534dd19d7c78a76febb470813d0
parentbc8dd50fe4cddc779349ef79f55e9e623c3c215f
[arm] Introduce arm_carry_operation

An earlier patch introduced arm_borrow_operation, this one introduces
the carry variant, which is the same except that the logic of the
carry-setting is inverted.  Having done this we can now match more
cases where the carry flag is propagated from comparisons with
different modes without having to define even more patterns.  A few
small changes to the expand patterns are required to directly create
the carry representation.

The iterators LTUGEU is no-longer needed and removed, as is the code
attribute 'cnb'.

Finally, we fix a long-standing bug which was probably inert before:
in Thumb2 a shift with ADC can only be by an immediate amount;
register-specified shifts are not permitted.

* config/arm/predicates.md (arm_carry_operation): New special
predicate.
* config/arm/iterators.md (LTUGEU): Delete iterator.
(cnb): Delete code attribute.
(optab): Delete ltu and geu elements.
* config/arm/arm.md (addsi3_carryin): Renamed from
addsi3_carryin_<optab>.  Remove iterator and use arm_carry_operand.
(add0si3_carryin): Similarly, but from add0si3_carryin_<optab>.
(addsi3_carryin_alt2): Similarly, but from addsi3_carryin_alt2_<optab>.
(addsi3_carryin_clobercc): Similarly.
(addsi3_carryin_shift): Similarly.  Do not allow register shifts in
Thumb2 state.

From-SVN: r277171
gcc/ChangeLog
gcc/config/arm/arm.md
gcc/config/arm/iterators.md
gcc/config/arm/predicates.md