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.md: Change the order of alternatives inmovsi_h8300hs.


Hi,

Attached is a patch to change the order of alternatives in
movsi_h8300hs.

Without the patch, a push into the stack fits into the alternative
with which_alternative = 4, which is assigned length of 10 even though
the actual length is only 4.  This is because the constraint 'm'
accepts pre_dec.

The patch rearranges the constraints so that a push and a pop get the
correct length.

Tested on h8300 port.  Committed.

Kazu Hirata

2002-11-29  Kazu Hirata  <kazu@cs.umass.edu>

	* config/h8300/h8300.md (movsi_h8300hs): Change the order of
	alternatives to correct the length when the memory operand is
	either pre_dec or post_inc.

Index: h8300.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.md,v
retrieving revision 1.112
diff -u -r1.112 h8300.md
--- h8300.md	29 Nov 2002 16:10:21 -0000	1.112
+++ h8300.md	29 Nov 2002 16:12:29 -0000
@@ -468,8 +468,8 @@
    (set_attr "cc" "clobber")])
 
 (define_insn "movsi_h8300hs"
-  [(set (match_operand:SI 0 "general_operand_dst" "=r,r,r,r,m,<,r,*a,*a,r")
-	(match_operand:SI 1 "general_operand_src" "I,r,i,m,r,r,>,I,r,*a"))]
+  [(set (match_operand:SI 0 "general_operand_dst" "=r,r,r,<,r,r,m,*a,*a,r")
+	(match_operand:SI 1 "general_operand_src" "I,r,i,r,>,m,r,I,r,*a"))]
   "(TARGET_H8300S || TARGET_H8300H)
    && (register_operand (operands[0], SImode)
        || register_operand (operands[1], SImode))
@@ -539,7 +539,7 @@
     }
    return \"mov.l	%S1,%S0\";
 }"
-  [(set_attr "length" "2,2,6,10,10,4,4,2,6,4")
+  [(set_attr "length" "2,2,6,4,4,10,10,2,6,4")
    (set_attr "cc" "set_zn,set_znv,clobber,set_znv,set_znv,set_znv,set_znv,none_0hit,none_0hit,set_znv")])
 
 (define_insn "movsf_h8300h"


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