From e46fbd72b848a771f66f526cf10a86780143b528 Mon Sep 17 00:00:00 2001 From: Michael Hayes Date: Tue, 4 Jan 2000 22:12:59 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 5 +++++ gcc/config/c4x/c4x.md | 30 +++++++++++++++++++++--------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6cafbc6b069..dabbc64cb9d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-01-05 Michael Hayes + + * config/c4x/c4x.md (*addqi3_noclobber_reload): Ensure that CC never + modified inadvertently. + 2000-01-04 Joel Sherrill * configure.in (v850*-*-rtems*): New target. diff --git a/gcc/config/c4x/c4x.md b/gcc/config/c4x/c4x.md index c37bb00de6b..5870cbdb2ee 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.