and/or pattern for H8

Joern Rennecke amylaar@redhat.com
Thu Aug 30 06:07:00 GMT 2001


This pattern saves some bytes in the library, for example mallocr.c

Thu Aug 30 14:03:33 2001  J"orn Rennecke <amylaar@redhat.com>

	* h8300.md (*andorhi3): New pattern.

Index: h8300.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/h8300/h8300.md,v
retrieving revision 1.36
diff -p -r1.36 h8300.md
*** h8300.md	2001/08/29 18:21:07	1.36
--- h8300.md	2001/08/30 13:03:29
***************
*** 1013,1018 ****
--- 1013,1036 ----
    [(set_attr "length" "2,4")
     (set_attr "cc" "set_znv,clobber")])
  
+ (define_insn "*andorhi3"
+   [(set (match_operand:HI 0 "register_operand" "=r")
+ 	(ior:HI (and:HI (match_operand:HI 2 "register_operand" "r")
+ 			(match_operand:HI 3 "p_operand" "P"))
+ 	(match_operand:HI 1 "register_operand" "0")))]
+   ""
+   "*
+ {
+   if (INTVAL (operands[3]) > 128)
+     {
+       operands[3] = GEN_INT (INTVAL (operands[3]) >> 8);
+       return \"bld\t%V3,%t2\;bst\t%V3,%t0\";
+     }
+   return \"bld\t%V3,%s2\;bst\t%V3,%s0\";
+ }"
+   [(set_attr "length" "4")
+    (set_attr "cc" "clobber")])
+ 
  (define_expand "andsi3"
    [(set (match_operand:SI 0 "register_operand" "")
  	(and:SI (match_operand:SI 1 "register_operand" "")



More information about the Gcc-patches mailing list