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: Add an alternative to movstrict[qh]i.


Hi,

Attached is a patch to add an alternative to movstrict[qh]i.

Building newlib with the latest GCC stops with an error, saying

  error: insn does not satisfy its constraints:
  (set (strict_low_part (reg:QI 2 r2))
       (mem:QI (post_inc:SI (reg:SI 3 r3))))

This problem happens because predicate general_operand_src allows
post_inc but none of the constraints accepts post_inc.  The patch
fixes the problem by adding one more alternative to movstrict[qh]i.

Tested on h8300-hms.  Committed.

Kazu Hirata

2004-01-13  Kazu Hirata  <kazu@cs.umass.edu>

	* config/h8300/h8300.md (movstrictqi): Add an alternative with
	the source being post_inc.  Tighten the predicate for the
	destination to register_operand.
	(movstricthi): Likewise.

Index: h8300.md
===================================================================
RCS file: /home/kazu/nobackup/gcc-cvs/gcc/gcc/config/h8300/h8300.md,v
retrieving revision 1.254
diff -u -r1.254 h8300.md
--- h8300.md	26 Dec 2003 16:15:24 -0000	1.254
+++ h8300.md	13 Jan 2004 18:07:40 -0000
@@ -214,17 +214,19 @@
 }")
 
 (define_insn "movstrictqi"
-  [(set (strict_low_part (match_operand:QI 0 "general_operand_dst" "+r,r,r,r"))
-			 (match_operand:QI 1 "general_operand_src" "I,r,n,m"))]
+  [(set (strict_low_part
+	 (match_operand:QI 0 "register_operand"    "+r,r,r,r,r"))
+	 (match_operand:QI 1 "general_operand_src" " I,r,n,>,m"))]
   ""
   "@
    sub.b	%X0,%X0
    mov.b	%X1,%X0
    mov.b	%R1,%X0
+   mov.b	%X1,%X0
    mov.b	%R1,%X0"
   [(set (attr "length")
 	(symbol_ref "compute_mov_length (operands)"))
-   (set_attr "cc" "set_zn,set_znv,set_znv,set_znv")])
+   (set_attr "cc" "set_zn,set_znv,set_znv,set_znv,set_znv")])
 
 ;; movhi
 
@@ -325,17 +327,19 @@
 }")
 
 (define_insn "movstricthi"
-  [(set (strict_low_part (match_operand:HI 0 "general_operand_dst" "+r,r,r,r"))
-			 (match_operand:HI 1 "general_operand_src" "I,r,i,m"))]
+  [(set (strict_low_part
+	 (match_operand:HI 0 "register_operand"    "+r,r,r,r,r"))
+	 (match_operand:HI 1 "general_operand_src" " I,r,i,>,m"))]
   ""
   "@
    sub.w	%T0,%T0
    mov.w	%T1,%T0
    mov.w	%T1,%T0
+   mov.w	%T1,%T0
    mov.w	%T1,%T0"
   [(set (attr "length")
 	(symbol_ref "compute_mov_length (operands)"))
-   (set_attr "cc" "set_zn,set_znv,set_znv,set_znv")])
+   (set_attr "cc" "set_zn,set_znv,set_znv,set_znv,set_znv")])
 
 ;; movsi
 


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