aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDavid Edelsohn <edelsohn@gnu.org>2007-02-18 20:55:31 +0000
committerDavid Edelsohn <dje@gcc.gnu.org>2007-02-18 15:55:31 -0500
commit03f79051aed05fa47ae45bebc93083b6777e2896 (patch)
treebbb83c74922360c2d8a42e1da691b933e88fdd63 /gcc
parent61a04b5b59974a336e436f0aac7d0e4353007dc9 (diff)
downloadgcc-03f79051aed05fa47ae45bebc93083b6777e2896.zip
gcc-03f79051aed05fa47ae45bebc93083b6777e2896.tar.gz
gcc-03f79051aed05fa47ae45bebc93083b6777e2896.tar.bz2
rs6000.md (bswapsi2): New define_insn and splitter.
2007-02-18 David Edelsohn <edelsohn@gnu.org> Roger Sayle <roger@eyesopen.com> * config/rs6000/rs6000.md (bswapsi2): New define_insn and splitter. Co-Authored-By: Roger Sayle <roger@eyesopen.com> From-SVN: r122104
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/rs6000/rs6000.md27
2 files changed, 32 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 751d6c1..c797248 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2007-02-18 David Edelsohn <edelsohn@gnu.org>
+ Roger Sayle <roger@eyesopen.com>
+
+ * config/rs6000/rs6000.md (bswapsi2): New define_insn and splitter.
+
2007-02-18 Sandra Loosemore <sandra@codesourcery.com>
* calls.c (initialize_argument_information): Pass original EXP
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 21959a5..54202e4 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -2186,6 +2186,33 @@
DONE;
})
+(define_insn "bswapsi2"
+ [(set (match_operand:SI 0 "reg_or_mem_operand" "=r,Z,&r")
+ (bswap:SI (match_operand:SI 1 "reg_or_mem_operand" "Z,r,r")))]
+ ""
+ "@
+ {lbrx|lwbrx} %0,%y1
+ {stbrx|stwbrx} %1,%y0
+ #"
+ [(set_attr "length" "4,4,12")])
+
+(define_split
+ [(set (match_operand:SI 0 "gpc_reg_operand" "")
+ (bswap:SI (match_operand:SI 1 "gpc_reg_operand" "")))]
+ "reload_completed"
+ [(set (match_dup 0)
+ (rotate:SI (match_dup 1) (const_int 8)))
+ (set (zero_extract:SI (match_dup 0)
+ (const_int 8)
+ (const_int 0))
+ (match_dup 1))
+ (set (zero_extract:SI (match_dup 0)
+ (const_int 8)
+ (const_int 16))
+ (rotate:SI (match_dup 1)
+ (const_int 16)))]
+ "")
+
(define_expand "mulsi3"
[(use (match_operand:SI 0 "gpc_reg_operand" ""))
(use (match_operand:SI 1 "gpc_reg_operand" ""))