summaryrefslogtreecommitdiff
path: root/gcc/config/m68k/m68k.md
diff options
context:
space:
mode:
authorschwab <schwab@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-11 22:01:42 +0000
committerschwab <schwab@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-11 22:01:42 +0000
commit886bfde4d2c50b559c267d682909eb553e9bcfc5 (patch)
tree47c3626c654483298a3ef5bd85ce20d1f456081b /gcc/config/m68k/m68k.md
parent4b1da543a2212d4b442c4b83b5233469032003d1 (diff)
downloadgcc-886bfde4d2c50b559c267d682909eb553e9bcfc5.tar.gz
* gcc/config/m68k/m68k.md (rotrhi3+1): Name it rotrhi_lowpart.
(bswapsi2): New expander. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186361 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/m68k/m68k.md')
-rw-r--r--gcc/config/m68k/m68k.md17
1 files changed, 15 insertions, 2 deletions
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index e4b4b59afc2..8104e75492b 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -1,6 +1,6 @@
;;- Machine description for GNU compiler, Motorola 68000 Version
;; Copyright (C) 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001,
-;; 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+;; 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012
;; Free Software Foundation, Inc.
;; This file is part of GCC.
@@ -5475,7 +5475,7 @@
"!TARGET_COLDFIRE"
"ror%.w %2,%0")
-(define_insn ""
+(define_insn "rotrhi_lowpart"
[(set (strict_low_part (match_operand:HI 0 "register_operand" "+d"))
(rotatert:HI (match_dup 0)
(match_operand:HI 1 "general_operand" "dI")))]
@@ -5495,6 +5495,19 @@
(match_operand:QI 1 "general_operand" "dI")))]
"!TARGET_COLDFIRE"
"ror%.b %1,%0")
+
+(define_expand "bswapsi2"
+ [(set (match_operand:SI 0 "register_operand")
+ (bswap:SI (match_operand:SI 1 "register_operand")))]
+ "!TARGET_COLDFIRE"
+{
+ rtx x = operands[0];
+ emit_move_insn (x, operands[1]);
+ emit_insn (gen_rotrhi_lowpart (gen_lowpart (HImode, x), GEN_INT (8)));
+ emit_insn (gen_rotlsi3 (x, x, GEN_INT (16)));
+ emit_insn (gen_rotrhi_lowpart (gen_lowpart (HImode, x), GEN_INT (8)));
+ DONE;
+})
;; Bit set/clear in memory byte.