aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/mn10300
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2017-05-13 08:40:53 -0600
committerJeff Law <law@gcc.gnu.org>2017-05-13 08:40:53 -0600
commit65fdd5e9aca0af40e4cd2d0683149171fb5c7d24 (patch)
tree9cfd76fb9df43a1713b5f9b83887eceba8ea0db8 /gcc/config/mn10300
parentc7488b4ffb7b91c9fe9b2eeddda30f818351f535 (diff)
downloadgcc-65fdd5e9aca0af40e4cd2d0683149171fb5c7d24.zip
gcc-65fdd5e9aca0af40e4cd2d0683149171fb5c7d24.tar.gz
gcc-65fdd5e9aca0af40e4cd2d0683149171fb5c7d24.tar.bz2
mn10300.c (mn10300_match_ccmode): Fix where we look for cc setter after the compare-elim changes.
2017-05-12 Jeff Law <law@redhat.com> Jakub Jelinek <jakub@redhat.com> * config/mn10300/mn10300.c (mn10300_match_ccmode): Fix where we look for cc setter after the compare-elim changes. * config/mn10300/mn10300.md (addsi3_flags): Fix order of patterns within the vector to match what compare-elim now expects. (subsi3_flags, andsi3_flags, iorsi3_flags): Likewise. (xorsi3_flags, one_cmplsi2_flags): Likewise. * config/rx/rx.c (rx_match_ccmode): Fix where we look cc setter after the compare-elim changes. * config/rx/rx.md (abssi2_flags): Fix order of patterns within the vector to match what compare-elim now expects. (addsi3_flags, adc_flags, addsi3_flags peepholes): Likewise. (andsi3_flags, negsi2_flags, one_cmplsi2_flags): Likewise. (iorsi3_flags, rotlsi3_flags, rotrsi3_flags): Likewise. (ashrsi3_flags, lshrsi3_flags, ashlsi3_flags): Likewise. (ssaddsi3, subsi3_flags, sbb_flags, xorsi3_flags): Likewise. * config/visium/visium.c (single_set_and_flags): Fix where we look for cc setter after the compare-elim changes. * config/visium/visium.md (flags_subst_logic): Fix order of patterns with the vector to match what compare-elim now expects. (flags_subst_arith, add<mode>3_insn_set_carry): Likewise. (add<mode>3_insn_set_overflow, addsi3_insn_set_carry): Likewise. (addsi3_insn_set_overflow, sub<mode>3_insn_set_carry): Likewise. (sub<mode>3_insn_set_overflow, subsi3_insn_set_carry): Likewise. (subsi3_insn_set_overflow, negsi2_insn_set_carry): Likewise. (neg<mode>2_insn_set_overflow): Likewise. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r248007
Diffstat (limited to 'gcc/config/mn10300')
-rw-r--r--gcc/config/mn10300/mn10300.c2
-rw-r--r--gcc/config/mn10300/mn10300.md90
2 files changed, 46 insertions, 46 deletions
diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index dae04d3..301207f 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -2895,7 +2895,7 @@ mn10300_match_ccmode (rtx insn, machine_mode cc_mode)
gcc_checking_assert (XVECLEN (PATTERN (insn), 0) == 2);
- op1 = XVECEXP (PATTERN (insn), 0, 1);
+ op1 = XVECEXP (PATTERN (insn), 0, 0);
gcc_checking_assert (GET_CODE (SET_SRC (op1)) == COMPARE);
flags = SET_DEST (op1);
diff --git a/gcc/config/mn10300/mn10300.md b/gcc/config/mn10300/mn10300.md
index 5a77aab..b4bd279 100644
--- a/gcc/config/mn10300/mn10300.md
+++ b/gcc/config/mn10300/mn10300.md
@@ -592,12 +592,12 @@
;; Note that ADD IMM,SP does not set the flags, so omit that here.
(define_insn "*addsi3_flags"
- [(set (match_operand:SI 0 "register_operand" "=r,!r")
- (plus:SI (match_operand:SI 1 "register_operand" "%0, r")
- (match_operand:SI 2 "nonmemory_operand" "ri, r")))
- (set (reg CC_REG)
- (compare (plus:SI (match_dup 1) (match_dup 2))
- (const_int 0)))]
+ [(set (reg CC_REG)
+ (compare (plus:SI (match_operand:SI 1 "register_operand" "%0, r")
+ (match_operand:SI 2 "nonmemory_operand" "ri, r"))
+ (const_int 0)))
+ (set (match_operand:SI 0 "register_operand" "=r,!r")
+ (plus:SI (match_dup 1) (match_dup 2)))]
"reload_completed && mn10300_match_ccmode (insn, CCZNCmode)"
{ return mn10300_output_add (operands, true); }
[(set_attr "timings" "11,22")]
@@ -605,12 +605,12 @@
;; A helper to expand the above, with the CC_MODE filled in.
(define_expand "addsi3_flags"
- [(parallel [(set (match_operand:SI 0 "register_operand")
- (plus:SI (match_operand:SI 1 "register_operand")
- (match_operand:SI 2 "nonmemory_operand")))
- (set (reg:CCZNC CC_REG)
+ [(parallel [(set (reg:CCZNC CC_REG)
(compare:CCZNC (plus:SI (match_dup 1) (match_dup 2))
- (const_int 0)))])]
+ (const_int 0)))
+ (set (match_operand:SI 0 "register_operand")
+ (plus:SI (match_operand:SI 1 "register_operand")
+ (match_operand:SI 2 "nonmemory_operand")))])]
""
)
@@ -791,12 +791,12 @@
)
(define_insn "*subsi3_flags"
- [(set (match_operand:SI 0 "register_operand" "=r, r")
- (minus:SI (match_operand:SI 1 "register_operand" "0, r")
- (match_operand:SI 2 "nonmemory_operand" "ri,r")))
- (set (reg CC_REG)
- (compare (minus:SI (match_dup 1) (match_dup 2))
- (const_int 0)))]
+ [(set (reg CC_REG)
+ (compare (minus:SI (match_operand:SI 1 "register_operand" "0, r")
+ (match_operand:SI 2 "nonmemory_operand" "ri,r"))
+ (const_int 0)))
+ (set (match_operand:SI 0 "register_operand" "=r, r")
+ (minus:SI (match_dup 1) (match_dup 2)))]
"reload_completed && mn10300_match_ccmode (insn, CCZNCmode)"
"@
sub %2,%0
@@ -807,12 +807,12 @@
;; A helper to expand the above, with the CC_MODE filled in.
(define_expand "subsi3_flags"
- [(parallel [(set (match_operand:SI 0 "register_operand")
- (minus:SI (match_operand:SI 1 "register_operand")
- (match_operand:SI 2 "nonmemory_operand")))
- (set (reg:CCZNC CC_REG)
+ [(parallel [(set (reg:CCZNC CC_REG)
(compare:CCZNC (minus:SI (match_dup 1) (match_dup 2))
- (const_int 0)))])]
+ (const_int 0)))
+ (set (match_operand:SI 0 "register_operand")
+ (minus:SI (match_operand:SI 1 "register_operand")
+ (match_operand:SI 2 "nonmemory_operand")))])]
""
)
@@ -1195,12 +1195,12 @@
)
(define_insn "*andsi3_flags"
- [(set (match_operand:SI 0 "register_operand" "=D,D,r")
- (and:SI (match_operand:SI 1 "register_operand" "%0,0,r")
- (match_operand:SI 2 "nonmemory_operand" " i,D,r")))
- (set (reg CC_REG)
- (compare (and:SI (match_dup 1) (match_dup 2))
- (const_int 0)))]
+ [(set (reg CC_REG)
+ (compare (and:SI (match_operand:SI 1 "register_operand" "%0,0,r")
+ (match_operand:SI 2 "nonmemory_operand" " i,D,r"))
+ (const_int 0)))
+ (set (match_operand:SI 0 "register_operand" "=D,D,r")
+ (and:SI (match_dup 1) (match_dup 2)))]
"reload_completed && mn10300_match_ccmode (insn, CCZNmode)"
"@
and %2,%0
@@ -1282,12 +1282,12 @@
)
(define_insn "*iorsi3_flags"
- [(set (match_operand:SI 0 "register_operand" "=D,D,r")
- (ior:SI (match_operand:SI 1 "register_operand" "%0,0,r")
- (match_operand:SI 2 "nonmemory_operand" " i,D,r")))
- (set (reg CC_REG)
- (compare (ior:SI (match_dup 1) (match_dup 2))
- (const_int 0)))]
+ [(set (reg CC_REG)
+ (compare (ior:SI (match_operand:SI 1 "register_operand" "%0,0,r")
+ (match_operand:SI 2 "nonmemory_operand" " i,D,r"))
+ (const_int 0)))
+ (set (match_operand:SI 0 "register_operand" "=D,D,r")
+ (ior:SI (match_dup 1) (match_dup 2)))]
"reload_completed && mn10300_match_ccmode (insn, CCZNmode)"
"@
or %2,%0
@@ -1318,12 +1318,12 @@
)
(define_insn "*xorsi3_flags"
- [(set (match_operand:SI 0 "register_operand" "=D,D,r")
- (xor:SI (match_operand:SI 1 "register_operand" "%0,0,r")
- (match_operand:SI 2 "nonmemory_operand" " i,D,r")))
- (set (reg CC_REG)
- (compare (xor:SI (match_dup 1) (match_dup 2))
- (const_int 0)))]
+ [(set (reg CC_REG)
+ (compare (xor:SI (match_operand:SI 1 "register_operand" "%0,0,r")
+ (match_operand:SI 2 "nonmemory_operand" " i,D,r"))
+ (const_int 0)))
+ (set (match_operand:SI 0 "register_operand" "=D,D,r")
+ (xor:SI (match_dup 1) (match_dup 2)))]
"reload_completed && mn10300_match_ccmode (insn, CCZNmode)"
"@
xor %2,%0
@@ -1346,11 +1346,11 @@
)
(define_insn "*one_cmplsi2_flags"
- [(set (match_operand:SI 0 "register_operand" "=D")
- (not:SI (match_operand:SI 1 "register_operand" " 0")))
- (set (reg CC_REG)
- (compare (not:SI (match_dup 1))
- (const_int 0)))]
+ [(set (reg CC_REG)
+ (compare (not:SI (match_operand:SI 1 "register_operand" "0"))
+ (const_int 0)))
+ (set (match_operand:SI 0 "register_operand" "=D")
+ (not:SI (match_dup 1)))]
"reload_completed && mn10300_match_ccmode (insn, CCZNmode)"
"not %0"
)