This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, m68k, PR42516] Improve swap on ColdFire


Maxim Kuvyrkov <maxim@codesourcery.com> writes:

> The problem is in rotlsi3 instruction patter which is disabled for
> ColdFire.  This patch adds rotlsi3 expander and splits the constraints
> into alternatives in the original pattern.  Then it enables one of the
> alternatives for ColdFire.

I think this simpler patch works just as well.

Index: m68k.md
===================================================================
--- m68k.md	(revision 155479)
+++ m68k.md	(working copy)
@@ -5368,6 +5368,14 @@
 
 ;; rotate instructions
 
+(define_insn "rotlsi_16"
+  [(set (match_operand:SI 0 "register_operand" "=d")
+	(rotate:SI (match_operand:SI 1 "register_operand" "0")
+		   (const_int 16)))]
+  ""
+  "swap %0"
+  [(set_attr "type" "shift")])
+
 (define_insn "rotlsi3"
   [(set (match_operand:SI 0 "register_operand" "=d")
 	(rotate:SI (match_operand:SI 1 "register_operand" "0")

> While I was at it, I also improved scheduling descriptions for shift
> instructions.

Don't lump together unrelated changes.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]