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: Remove an ungly hack for udivmod[sh]i4


Hi,

Attached is a patch to remove an ungly hack for udivmod[sh]i4.

The mask off performed at the beginning of the expander is no longer
needed due to a recent patch to optabs.c.

Tested on h8300 port.  Committed.

Kazu Hirata

2002-09-12  Kazu Hirata  <kazu@cs.umass.edu>

	* config/h8300/h8300.md (udivmodqi4): Do not use an expander.
	(udivmodhi4): Likewise.

Index: h8300.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.md,v
retrieving revision 1.91
diff -u -r1.91 h8300.md
--- h8300.md	8 Sep 2002 08:20:44 -0000	1.91
+++ h8300.md	12 Sep 2002 16:42:12 -0000
@@ -911,25 +911,7 @@
 ;; DIVIDE/MOD INSTRUCTIONS
 ;; ----------------------------------------------------------------------
 
-(define_expand "udivmodqi4"
-  [(set (match_operand:HI 1 "register_operand" "")
-	(and:HI (match_dup 1)
-		(const_int 255)))
-   (parallel [(set (match_operand:QI 0 "register_operand" "")
-		   (truncate:QI
-		     (udiv:HI
-		       (match_dup 1)
-		       (zero_extend:HI
-			 (match_operand:QI 2 "register_operand" "")))))
-	      (set (match_operand:QI 3 "register_operand" "")
-		   (truncate:QI
-		     (umod:HI
-		       (match_dup 1)
-		       (zero_extend:HI (match_dup 2)))))])]
-  ""
-  "")
-
-(define_insn ""
+(define_insn "udivmodqi4"
   [(set (match_operand:QI 0 "register_operand" "=r")
 	(truncate:QI
 	  (udiv:HI
@@ -973,25 +955,7 @@
   [(set_attr "length" "6")
    (set_attr "cc" "clobber")])
 
-(define_expand "udivmodhi4"
-  [(set (match_operand:SI 1 "register_operand" "")
-	(and:SI (match_dup 1)
-		(const_int 65535)))
-   (parallel [(set (match_operand:HI 0 "register_operand" "")
-		   (truncate:HI
-		     (udiv:SI
-		       (match_dup 1)
-		       (zero_extend:SI
-			 (match_operand:HI 2 "register_operand" "")))))
-	      (set (match_operand:HI 3 "register_operand" "")
-		   (truncate:HI
-		     (umod:SI
-		       (match_dup 1)
-		       (zero_extend:SI (match_dup 2)))))])]
-  "TARGET_H8300H || TARGET_H8300S"
-  "")
-
-(define_insn ""
+(define_insn "udivmodhi4"
   [(set (match_operand:HI 0 "register_operand" "=r")
 	(truncate:HI
 	  (udiv:SI


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