This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] arm: bswap pattern
- From: "Andreas Krebbel" <krebbel at linux dot vnet dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 15 Jun 2009 09:50:14 +0200
- Subject: [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