diff options
Diffstat (limited to 'gcc/config/m68k/m68k.md')
-rw-r--r-- | gcc/config/m68k/m68k.md | 17 |
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. |