cris: update recent patterns. Simplify cris_select_cc_mode.
authorHans-Peter Nilsson <hp@axis.com>
Sun, 5 Jul 2020 23:10:54 +0000 (01:10 +0200)
committerHans-Peter Nilsson <hp@axis.com>
Sun, 5 Jul 2020 23:17:54 +0000 (01:17 +0200)
commit9596eccb9c64faa13750692b46dd0779aac0d57c
treeebcde04d5354812ffed4ce05c1e54f2a5f8cdab3
parent65f8403f1a99f965ad3ed36adc4f889cf95ee1eb
cris: update recent patterns. Simplify cris_select_cc_mode.

The code in cris_select_cc_mode for selecting CC_NZmode was
partly inconsistent with the comment and partly seemed
ambiguous.  I couldn't find a reason why I qualified selection
of CC_NZmode on the setting operation once a matching user was
spotted, so I just removed that.  The cris.c update was due to
observing the new test-case failing; the CC_NZmode compare
wasn't eliminated.

The recently re-instated adds/addu/subs/subu/bound patterns are
rewritten to replace the use of match_operator with iterators.

gcc:
* config/cris/cris.c (cris_select_cc_mode): Always return
CC_NZmode for matching comparisons.  Clarify comments.
* config/cris/cris-modes.def: Clarify mode comment.
* config/cris/cris.md (plusminus, plusminusumin, plusumin): New
code iterators.
(addsub, addsubbo, nd): New code iterator attributes.
("*<addsub><su>qihi"): Rename from "*extopqihi".  Use code
iterator constructs instead of match_operator constructs.
("*<addsubbo><su><nd><mode>si<setnz>"): Similar from
"*extop<mode>si<setnz>".
("*add<su>qihi_swap"): Similar from "*addxqihi_swap".
("*<addsubbo><su><nd><mode>si<setnz>_swap"): Similar from
"*extop<mode>si<setnz>_swap".

gcc/testsuite:
* gcc.target/cris/pr93372-39.c: New test.
gcc/config/cris/cris-modes.def
gcc/config/cris/cris.c
gcc/config/cris/cris.md
gcc/testsuite/gcc.target/cris/pr93372-39.c [new file with mode: 0644]