This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] h8300: Clarify normal mode related stuff.


Hi,

Attached is a patch to clarify normal mode related stuff.

Some patterns are only applicable to normal mode.  While I don't think
a normal mode pattern is mistakenly used in advanced mode, it's more
descriptive to explicitly mention TARGET_NORML_MODE.

Tested on h8300 port.  Committed.

Kazu Hirata

2003-12-03  Kazu Hirata  <kazu@cs.umass.edu>

	* config/h8300/h8300.c (push): Call gen_push_h8300hs_advanced
	instead of gen_push_h8300hs.
	(pop): Call gen_pop_h8300hs_advanced instead of
	gen_pop_h8300hs.
	* config/h8300/h8300.h (TRAMPOLINE_SIZE): Use Pmode.
	* config/h8300/h8300.md (*tablejump_h8300hs_advanced):
	Tighten the predicate.
	(*tablejump_h8300hs_normal): Tighten the predicate.
	(push_h8300hs): Change to
	push_h8300hs_advanced.
	(pop_h8300hs): Change to pop_h8300hs_advanced.

Index: h8300.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.c,v
retrieving revision 1.257
diff -u -r1.257 h8300.c
--- h8300.c	27 Nov 2003 17:40:10 -0000	1.257
+++ h8300.c	4 Dec 2003 04:21:35 -0000
@@ -435,7 +435,7 @@
   if (TARGET_H8300)
     x = gen_push_h8300 (reg);
   else if (!TARGET_NORMAL_MODE)
-    x = gen_push_h8300hs (reg);
+    x = gen_push_h8300hs_advanced (reg);
   else
     x = gen_push_h8300hs_normal (reg);
   x = emit_insn (x);
@@ -453,7 +453,7 @@
   if (TARGET_H8300)
     x = gen_pop_h8300 (reg);
   else if (!TARGET_NORMAL_MODE)
-    x = gen_pop_h8300hs (reg);
+    x = gen_pop_h8300hs_advanced (reg);
   else
     x = gen_pop_h8300hs_normal (reg);
   x = emit_insn (x);
Index: h8300.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.h,v
retrieving revision 1.160
diff -u -r1.160 h8300.h
--- h8300.h	30 Nov 2003 04:31:04 -0000	1.160
+++ h8300.h	4 Dec 2003 04:21:36 -0000
@@ -735,7 +735,7 @@
 
 /* Length in units of the trampoline for entering a nested function.  */
 
-#define TRAMPOLINE_SIZE ((TARGET_H8300 || TARGET_NORMAL_MODE) ? 8 : 12)
+#define TRAMPOLINE_SIZE ((Pmode == HImode) ? 8 : 12)
 
 /* Emit RTL insns to build a trampoline.
    FNADDR is an RTX for the address of the function's pure code.
Index: h8300.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.md,v
retrieving revision 1.252
diff -u -r1.252 h8300.md
--- h8300.md	28 Nov 2003 05:39:20 -0000	1.252
+++ h8300.md	4 Dec 2003 04:21:37 -0000
@@ -1763,7 +1763,7 @@
 (define_insn "*tablejump_h8300hs_advanced"
   [(set (pc) (match_operand:SI 0 "register_operand" "r"))
    (use (label_ref (match_operand 1 "" "")))]
-  "TARGET_H8300H || TARGET_H8300S"
+  "(TARGET_H8300H || TARGET_H8300S) && !TARGET_NORMAL_MODE"
   "jmp	@%0"
   [(set_attr "cc" "none")
    (set_attr "length" "2")])
@@ -1792,7 +1792,7 @@
 
 (define_insn "*indirect_jump_h8300hs_advanced"
   [(set (pc) (match_operand:SI 0 "jump_address_operand" "Vr"))]
-  "TARGET_H8300H || TARGET_H8300S"
+  "(TARGET_H8300H || TARGET_H8300S) && !TARGET_NORMAL_MODE"
   "jmp @%0"
   [(set_attr "cc" "none")
    (set_attr "length" "2")])
@@ -1867,16 +1867,16 @@
   "TARGET_H8300"
   "")
 
-(define_expand "push_h8300hs"
+(define_expand "push_h8300hs_advanced"
   [(set (mem:SI (pre_dec:SI (reg:SI SP_REG)))
         (match_operand:SI 0 "register_operand" ""))]
-  "TARGET_H8300H && TARGET_H8300S"
+  "TARGET_H8300H && TARGET_H8300S && !TARGET_NORMAL_MODE"
   "")
 
 (define_expand "push_h8300hs_normal"
   [(set (mem:SI (pre_dec:HI (reg:HI SP_REG)))
         (match_operand:SI 0 "register_operand" ""))]
-  "TARGET_NORMAL_MODE"
+  "TARGET_H8300H && TARGET_H8300S && TARGET_NORMAL_MODE"
   "")
 
 (define_expand "pop_h8300"
@@ -1885,16 +1885,16 @@
   "TARGET_H8300"
   "")
 
-(define_expand "pop_h8300hs"
+(define_expand "pop_h8300hs_advanced"
   [(set (match_operand:SI 0 "register_operand" "")
 	(mem:SI (post_inc:SI (reg:SI SP_REG))))]
-  "TARGET_H8300H && TARGET_H8300S"
+  "TARGET_H8300H && TARGET_H8300S && !TARGET_NORMAL_MODE"
   "")
 
 (define_expand "pop_h8300hs_normal"
   [(set (match_operand:SI 0 "register_operand" "")
 	(mem:SI (post_inc:HI (reg:HI SP_REG))))]
-  "TARGET_NORMAL_MODE"
+  "TARGET_H8300H && TARGET_H8300S && TARGET_NORMAL_MODE"
   "")
 
 (define_insn "stm_h8300s_2_advanced"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]