S/390: Add add/sub/mul overflow check patterns
authorAndreas Krebbel <krebbel@linux.ibm.com>
Wed, 24 Jul 2019 11:27:56 +0000 (11:27 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Wed, 24 Jul 2019 11:27:56 +0000 (11:27 +0000)
commit4caa6bab76241bc16517bf1d1075c986d0d0b8ad
treec2585c57177403ab03fea7af0e95aefb6d6172b4
parent21caa1a2649d586f4f8830aba43b0c132584f2dd
S/390: Add add/sub/mul overflow check patterns

This patch implements the addv, subv, and mulv patterns for signed
integers.

gcc/ChangeLog:

2019-07-24  Andreas Krebbel  <krebbel@linux.ibm.com>

* config/s390/predicates.md (addv_const_operand): New predicate.
* config/s390/s390-modes.def (CCO): New condition code mode.
* config/s390/s390.c (s390_match_ccmode_set): Handle E_CCOmode.
(s390_branch_condition_mask): Likewise.
* config/s390/s390.md ("addv<mode>4", "subv<mode>4")
("mulv<mode>4"): New expanders.
("*addv<mode>3_ccoverflow", "*addv<mode>3_ccoverflow_const")
("*subv<mode>3_ccoverflow", "*mulv<mode>3_ccoverflow"): New
pattern definitions.

gcc/testsuite/ChangeLog:

2019-07-24  Andreas Krebbel  <krebbel@linux.ibm.com>

* gcc.target/s390/addsub-signed-overflow-1.c: New test.
* gcc.target/s390/addsub-signed-overflow-2.c: New test.
* gcc.target/s390/mul-signed-overflow-1.c: New test.
* gcc.target/s390/mul-signed-overflow-2.c: New test.

From-SVN: r273759
gcc/ChangeLog
gcc/config/s390/predicates.md
gcc/config/s390/s390-modes.def
gcc/config/s390/s390.c
gcc/config/s390/s390.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/s390/addsub-signed-overflow-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/addsub-signed-overflow-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/mul-signed-overflow-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/mul-signed-overflow-2.c [new file with mode: 0644]