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.

The new pattern can do the following

  (A & 0xffff) + (A >> 16)

where A is an unsigend SImode register.

Tested on h8300 port.  Committed.

Kazu Hirata

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

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

Index: h8300.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.md,v
retrieving revision 1.137
diff -u -r1.137 h8300.md
--- h8300.md	29 Dec 2002 22:25:39 -0000	1.137
+++ h8300.md	30 Dec 2002 15:29:22 -0000
@@ -2329,6 +2329,18 @@
   [(set_attr "cc" "set_znv")
    (set_attr "length" "6")])
 
+;; plus:SI
+
+(define_insn "*addsi3_lshiftrt_16_zexthi"
+  [(set (match_operand:SI 0 "register_operand" "=r")
+	(plus:SI (lshiftrt:SI (match_operand:SI 1 "register_operand" "r")
+			      (const_int 16))
+		 (zero_extend:SI (match_operand:HI 2 "register_operand" "0"))))]
+  "TARGET_H8300H || TARGET_H8300S"
+  "add.w\t%e1,%f0\;xor.w\t%e0,%e0\;rotxl.w\t%e0,%e0"
+  [(set_attr "cc" "clobber")
+   (set_attr "length" "6")])
+
 ;; ior:HI
 
 (define_insn "*iorhi3_zext"


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