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 a new pattern.


Hi,

Attached is a patch to add a new pattern.

Tested on h8300.  Committed.

Kazu Hirata

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

	* config/h8300/h8300.md (*andorsi3): New.

Index: h8300.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.md,v
retrieving revision 1.99
diff -u -r1.99 h8300.md
--- h8300.md	12 Nov 2002 14:01:33 -0000	1.99
+++ h8300.md	12 Nov 2002 23:20:09 -0000
@@ -1118,6 +1118,25 @@
   [(set_attr "length" "4")
    (set_attr "cc" "clobber")])
 
+(define_insn "*andorsi3"
+  [(set (match_operand:SI 0 "register_operand" "=r")
+	(ior:SI (and:SI (match_operand:SI 2 "register_operand" "r")
+			(match_operand:SI 3 "single_one_operand" "n"))
+	(match_operand:SI 1 "register_operand" "0")))]
+  "(INTVAL (operands[3]) & 0xffff) != 0"
+  "*
+{
+  operands[3] = GEN_INT (INTVAL (operands[3]) & 0xffff);
+  if (INTVAL (operands[3]) > 128)
+    {
+      operands[3] = GEN_INT (INTVAL (operands[3]) >> 8);
+      return \"bld\\t%V3,%x2\;bst\\t%V3,%x0\";
+    }
+  return \"bld\\t%V3,%w2\;bst\\t%V3,%w0\";
+}"
+  [(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" "")


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