aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hayes <m.hayes@elec.canterbury.ac.nz>2000-01-04 22:12:59 +0000
committerMichael Hayes <m.hayes@gcc.gnu.org>2000-01-04 22:12:59 +0000
commite46fbd72b848a771f66f526cf10a86780143b528 (patch)
tree3c847c7552cc906329b31ae218d218ba9ec3b023
parent966f8bfd169f1bb78dddd9ebc51e7c6b7a0e1b91 (diff)
downloadgcc-e46fbd72b848a771f66f526cf10a86780143b528.zip
gcc-e46fbd72b848a771f66f526cf10a86780143b528.tar.gz
gcc-e46fbd72b848a771f66f526cf10a86780143b528.tar.bz2
c4x.md (*addqi3_noclobber_reload): Ensure that CC never modified inadvertently.
* config/c4x/c4x.md (*addqi3_noclobber_reload): Ensure that CC never modified inadvertently. From-SVN: r31217
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/c4x/c4x.md30
2 files changed, 26 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6cafbc6..dabbc64 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2000-01-05 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
+
+ * config/c4x/c4x.md (*addqi3_noclobber_reload): Ensure that CC never
+ modified inadvertently.
+
2000-01-04 Joel Sherrill <joel@OARcorp.com>
* configure.in (v850*-*-rtems*): New target.
diff --git a/gcc/config/c4x/c4x.md b/gcc/config/c4x/c4x.md
index c37bb00..5870cbd 100644
--- a/gcc/config/c4x/c4x.md
+++ b/gcc/config/c4x/c4x.md
@@ -1,5 +1,5 @@
;; Machine description for the TMS320C[34]x for GNU C compiler
-;; Copyright (C) 1994-98, 1999 Free Software Foundation, Inc.
+;; Copyright (C) 1994-99, 2000 Free Software Foundation, Inc.
;; Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz)
;; and Herman Ten Brugge (Haj.Ten.Brugge@net.HCC.nl)
@@ -1885,15 +1885,27 @@
; may be allocated to reload the PLUS and thus gen_reload will
; emit an add insn that may clobber CC.
(define_insn "*addqi3_noclobber_reload"
- [(set (match_operand:QI 0 "reg_operand" "=a!r,a!r,a!r")
- (plus:QI (match_operand:QI 1 "src_operand" "%0,rR,rS<>")
- (match_operand:QI 2 "src_operand" "rIm,JR,rS<>")))]
+ [(set (match_operand:QI 0 "reg_operand" "=a*c,a*c,a*c,!*d,!*d,!*d")
+ (plus:QI (match_operand:QI 1 "src_operand" "%0,rR,rS<>,%0,rR,rS<>")
+ (match_operand:QI 2 "src_operand" "rIm,JR,rS<>,rIm,JR,rS<>")))]
"reload_in_progress"
- "@
- addi\\t%2,%0
- addi3\\t%2,%1,%0
- addi3\\t%2,%1,%0"
- [(set_attr "type" "binary,binary,binary")])
+ "*
+ if (IS_STD_REG (REGNO (operands[0])))
+ {
+ if (which_alternative == 0)
+ return \"addi\\t%2,%0\";
+ else
+ return \"addi3\\t%2,%1,%0\";
+ }
+ else
+ {
+ if (which_alternative == 0)
+ return \"push\\tst\\n\\taddi\\t%2,%0\\n\\tpop\\tst\";
+ else
+ return \"push\\tst\\n\\taddi3\\t%2,%1,%0\\n\\tpop\\tst\";
+ }
+ "
+ [(set_attr "type" "binary,binary,binary,multi,multi,multi")])
; Default to int16 data attr.