]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
h8300.c (push): Call push_h8300hs_normal in normal mode.
authorKazu Hirata <kazu@gcc.gnu.org>
Sun, 23 Nov 2003 22:27:34 +0000 (22:27 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Sun, 23 Nov 2003 22:27:34 +0000 (22:27 +0000)
* config/h8300/h8300.c (push): Call push_h8300hs_normal in
normal mode.
(pop): Call pop_h8300hs_normal in normal mode.
* config/h8300/h8300.md: Likewise.
(pushqi1_h8300hs_normal): New.
(pushqi1): Call pushqi1_h8300hs_normal in normal mode.
(pushhi1_h8300hs_normal): New.
(pushhi1): Call pushhi1_h8300hs_normal in normal mode.
(push_h8300hs_normal): New.
(pop_h8300hs_normal): Likewise.

From-SVN: r73862

gcc/ChangeLog
gcc/config/h8300/h8300.c
gcc/config/h8300/h8300.md

index 0dccce8f542779a439ff9e85b69a14c6a5d39c9c..177edd2e95d8ad4d873670c9e35eca5d3dfea797 100644 (file)
@@ -1,4 +1,17 @@
-2003-11-03  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
+2003-11-23  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * config/h8300/h8300.c (push): Call push_h8300hs_normal in
+       normal mode.
+       (pop): Call pop_h8300hs_normal in normal mode.
+       * config/h8300/h8300.md: Likewise.
+       (pushqi1_h8300hs_normal): New.
+       (pushqi1): Call pushqi1_h8300hs_normal in normal mode.
+       (pushhi1_h8300hs_normal): New.
+       (pushhi1): Call pushhi1_h8300hs_normal in normal mode.
+       (push_h8300hs_normal): New.
+       (pop_h8300hs_normal): Likewise.
+
+2003-11-23  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
 
        * genattrtab.c (count_sub_rtxs): Removed.
 
index dc818dbe6b923210ad1ae9ab4649b97fd3f405e6..41c7f843a702aeb97a61e44eb840647f8b705680 100644 (file)
@@ -434,8 +434,10 @@ push (int rn)
 
   if (TARGET_H8300)
     x = gen_push_h8300 (reg);
-  else
+  else if (!TARGET_NORMAL_MODE)
     x = gen_push_h8300hs (reg);
+  else
+    x = gen_push_h8300hs_normal (reg);
   x = emit_insn (x);
   REG_NOTES (x) = gen_rtx_EXPR_LIST (REG_INC, stack_pointer_rtx, 0);
 }
@@ -450,8 +452,10 @@ pop (int rn)
 
   if (TARGET_H8300)
     x = gen_pop_h8300 (reg);
-  else
+  else if (!TARGET_NORMAL_MODE)
     x = gen_pop_h8300hs (reg);
+  else
+    x = gen_pop_h8300hs_normal (reg);
   x = emit_insn (x);
   REG_NOTES (x) = gen_rtx_EXPR_LIST (REG_INC, stack_pointer_rtx, 0);
 }
index 8f6e78caa8653fc45f5aa2e61b4fbac67df472a2..8a0580308c2118e347e77f6ba83e4029fbc0009e 100644 (file)
   [(set_attr "length" "4")
    (set_attr "cc" "clobber")])
 
+(define_insn "pushqi1_h8300hs_normal"
+  [(parallel [(set (reg:HI SP_REG)
+                  (plus:HI (reg:HI SP_REG) (const_int -4)))
+             (set (mem:QI (plus:HI (reg:HI SP_REG) (const_int -3)))
+                  (match_operand:QI 0 "register_operand" "r"))])]
+  "(TARGET_H8300H || TARGET_H8300S)
+   && operands[0] != stack_pointer_rtx"
+  "mov.l\\t%S0,@-er7"
+  [(set_attr "length" "4")
+   (set_attr "cc" "clobber")])
+
 (define_expand "pushqi1"
   [(use (match_operand:QI 0 "register_operand" ""))]
   ""
 {
   if (TARGET_H8300)
     emit_insn (gen_pushqi1_h8300 (operands[0]));
-  else
+  else if (!TARGET_NORMAL_MODE)
     emit_insn (gen_pushqi1_h8300hs (operands[0]));
+  else
+    emit_insn (gen_pushqi1_h8300hs_normal (operands[0]));
   DONE;
 }")
 
   [(set_attr "length" "4")
    (set_attr "cc" "clobber")])
 
+(define_insn "pushhi1_h8300hs_normal"
+  [(parallel [(set (reg:HI SP_REG)
+                  (plus:HI (reg:HI SP_REG) (const_int -4)))
+             (set (mem:HI (plus:HI (reg:HI SP_REG) (const_int -2)))
+                  (match_operand:HI 0 "register_operand" "r"))])]
+  "(TARGET_H8300H || TARGET_H8300S)
+   && operands[0] != stack_pointer_rtx"
+  "mov.l\\t%S0,@-er7"
+  [(set_attr "length" "4")
+   (set_attr "cc" "clobber")])
+
 (define_expand "pushhi1"
   [(use (match_operand:HI 0 "register_operand" ""))]
   ""
 {
   if (TARGET_H8300)
     emit_insn (gen_pushhi1_h8300 (operands[0]));
-  else
+  else if (!TARGET_NORMAL_MODE)
     emit_insn (gen_pushhi1_h8300hs (operands[0]));
+  else
+    emit_insn (gen_pushhi1_h8300hs_normal (operands[0]));
   DONE;
 }")
 
   "TARGET_H8300H && TARGET_H8300S"
   "")
 
+(define_expand "push_h8300hs_normal"
+  [(set (mem:SI (pre_dec:HI (reg:HI SP_REG)))
+        (match_operand:SI 0 "register_operand" "=r"))]
+  "TARGET_NORMAL_MODE"
+  "")
+
 (define_expand "pop_h8300"
   [(set (match_operand:HI 0 "register_operand" "=r")
        (mem:HI (post_inc:HI (reg:HI SP_REG))))]
   "TARGET_H8300H && TARGET_H8300S"
   "")
 
+(define_expand "pop_h8300hs_normal"
+  [(set (match_operand:SI 0 "register_operand" "=r")
+       (mem:SI (post_inc:HI (reg:HI SP_REG))))]
+  "TARGET_NORMAL_MODE"
+  "")
+
 (define_insn "stm_h8300s_2"
   [(parallel
      [(set (reg:SI SP_REG)