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 abssf.


Hi,

Attached is a patch to add abssf.

Tested on h8300 port.  Committed.

Kazu Hirata

2003-02-10  Kazu Hirata  <kazu@cs.umass.edu>

	* config/h8300/h8300.md (abssf2): New.
	(*abssf2_h8300): Likewise.
	(*abssf2_h8300hs): Likewise.

Index: h8300.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.md,v
retrieving revision 1.157
diff -u -r1.157 h8300.md
--- h8300.md	8 Feb 2003 18:27:12 -0000	1.157
+++ h8300.md	10 Feb 2003 22:42:24 -0000
@@ -1437,7 +1437,33 @@
   "xor.w\\t#32768,%e0"
   [(set_attr "cc" "clobber")
    (set_attr "length" "4")])
+
+;; ----------------------------------------------------------------------
+;; ABSOLUTE VALUE INSTRUCTIONS
+;; ----------------------------------------------------------------------
 
+(define_expand "abssf2"
+  [(set (match_operand:SF 0 "register_operand" "")
+	(abs:SF (match_operand:SF 1 "register_operand" "")))]
+  ""
+  "")
+
+(define_insn "*abssf2_h8300"
+  [(set (match_operand:SF 0 "register_operand" "=r")
+	(abs:SF (match_operand:SF 1 "register_operand" "0")))]
+  "TARGET_H8300"
+  "and.b\\t#127,%z0"
+  [(set_attr "cc" "clobber")
+   (set_attr "length" "2")])
+
+(define_insn "*abssf2_h8300hs"
+  [(set (match_operand:SF 0 "register_operand" "=r")
+	(abs:SF (match_operand:SF 1 "register_operand" "0")))]
+  "TARGET_H8300H || TARGET_H8300S"
+  "and.w\\t#32767,%e0"
+  [(set_attr "cc" "clobber")
+   (set_attr "length" "4")])
+
 ;; ----------------------------------------------------------------------
 ;; NOT INSTRUCTIONS
 ;; ----------------------------------------------------------------------


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