This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Committed] S/390: bswap pattern
- From: "Andreas Krebbel" <krebbel at linux dot vnet dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 28 Jan 2009 17:52:05 +0100
- Subject: [Committed] S/390: bswap pattern
Hello,
I've committed the attached patch to gcc mainline. The patch makes
the load reverse instructions available using the GCC bswap builtins.
Tested on s390 and s390x.
Committed to mainline.
Bye,
-Andreas-
2009-01-28 Andreas Krebbel <krebbel1@de.ibm.com>
* config/s390/s390.md (bswap<mode>2): New pattern added.
Index: gcc/config/s390/s390.md
===================================================================
--- gcc/config/s390/s390.md.orig
+++ gcc/config/s390/s390.md
@@ -8729,3 +8729,19 @@
[(set_attr "type" "load,larl")
(set_attr "op_type" "RXY,RIL")
(set_attr "z10prop" "z10_super")])
+
+
+;
+; Byte swap instructions
+;
+
+(define_insn "bswap<mode>2"
+ [(set (match_operand:GPR 0 "register_operand" "=d, d")
+ (bswap:GPR (match_operand:GPR 1 "nonimmediate_operand" " d,RT")))]
+ ""
+ "@
+ lrv<g>r\t%0,%1
+ lrv<g>\t%0,%1"
+ [(set_attr "type" "*,load")
+ (set_attr "op_type" "RRE,RXY")
+ (set_attr "z10prop" "z10_super")])