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: New patterns.


Hi,

Attached is a patch to add two new patterns.

They replace "sign bit testing" with "sign testing" as follows.

 	mov.b	r2l,@(40,er5)
-	btst	#7,r2l
-	beq	.L10
+	bge	.L10

 	mov.b	@(28,er3),r2l
-	btst	#7,r2l
-	bne	.L1180:16
+	blt	.L1180:16

Tested on h8300 port.  Comitted.

Kazu Hirata

2002-05-28  Kazu Hirata  <kazu@cs.umass.edu>

	* config/h8300/h8300.md (two anonymous patterns): New.

Index: h8300.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.md,v
retrieving revision 1.84
diff -u -r1.84 h8300.md
--- h8300.md	22 May 2002 11:21:31 -0000	1.84
+++ h8300.md	28 May 2002 12:28:29 -0000
@@ -2179,3 +2179,43 @@
   "mov.w\\t%f2,%e0"
   [(set_attr "cc" "clobber")
    (set_attr "length" "2")])
+
+(define_insn_and_split ""
+  [(set (pc)
+	(if_then_else (eq (zero_extract:SI (subreg:SI (match_operand:QI 0 "register_operand" "") 0)
+					   (const_int 1)
+					   (const_int 7))
+			  (const_int 0))
+		      (label_ref (match_operand 1 "" ""))
+		      (pc)))]
+  ""
+  "#"
+  ""
+  [(set (cc0)
+	(match_dup 0))
+   (set (pc)
+	(if_then_else (ge (cc0)
+			  (const_int 0))
+		      (label_ref (match_dup 1))
+		      (pc)))]
+  "")
+
+(define_insn_and_split ""
+  [(set (pc)
+	(if_then_else (ne (zero_extract:SI (subreg:SI (match_operand:QI 0 "register_operand" "") 0)
+					   (const_int 1)
+					   (const_int 7))
+			  (const_int 0))
+		      (label_ref (match_operand 1 "" ""))
+		      (pc)))]
+  ""
+  "#"
+  ""
+  [(set (cc0)
+	(match_dup 0))
+   (set (pc)
+	(if_then_else (lt (cc0)
+			  (const_int 0))
+		      (label_ref (match_dup 1))
+		      (pc)))]
+  "")


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