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] arm: bswap pattern


Hi,

the attached patch uses the rev instruction for arm targets in order
to implement the 32bit bswap pattern.

Tested with a cross-compiler only.

Ok for mainline?

Bye,

-Andreas-


2009-06-15  Andreas Krebbel  <krebbel1@de.ibm.com>

	* config/arm/arm.md (bswapsi2): New pattern added.


Index: gcc/config/arm/arm.md
===================================================================
--- gcc/config/arm/arm.md.orig	2009-06-15 09:42:46.000000000 +0200
+++ gcc/config/arm/arm.md	2009-06-15 09:44:28.000000000 +0200
@@ -10886,6 +10886,16 @@
   [(set_attr "conds" "clob")]
 )
 
+;; BSWAP pattern
+
+(define_insn "bswapsi2"
+  [(set (match_operand:SI 0           "register_operand" "=r")
+        (bswap:SI (match_operand:SI 1 "register_operand" " r")))]
+  "TARGET_32BIT && arm_arch6"
+  "rev\\t%0, %1"
+  [(set_attr "length" "6")])
+
+
 ;; Load the FPA co-processor patterns
 (include "fpa.md")
 ;; Load the Maverick co-processor patterns


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