[PATCH] arm: bswap pattern
Andreas Krebbel
krebbel@linux.vnet.ibm.com
Mon Jun 15 08:08:00 GMT 2009
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
More information about the Gcc-patches
mailing list