This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] m68k: Use ASSEMBLER_DIALECT
- From: Roman Zippel <zippel at linux-m68k dot org>
- To: Kazu Hirata <kazu at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, law at redhat dot com, Andreas Schwab <schwab at suse dot de>, bernie at develer dot com
- Date: Mon, 27 Aug 2007 19:06:27 +0200 (CEST)
- Subject: Re: [patch] m68k: Use ASSEMBLER_DIALECT
- References: <200708261959.l7QJxwj8018103@sparrowhawk.codesourcery.com>
Hi,
On Sun, 26 Aug 2007, Kazu Hirata wrote:
> Hi,
>
> Attached is a patch to use ASSEMBLER_DIALECT to simplify constructs
> that use MOTOROLA.
>
> I assigned option 0 to the Motorola syntax because the motorola syntax
> adds characters to the MIT syntax. This way, we can say
>
> j{b}eq
Some time ago I posted a patch, which replaced all of these simply with
jeq, but Jeff had some objections, which I still don't understand. The
point here is that this has nothing to do with the official MOTOROLA
syntax - both variants jeq and jbeq are assembler pseudo ops and the only
supported assembler left is gas, so it would be far simpler and easier to
support to clean this up properly and just use one of these pseudo ops.
> I didn't go as far as replacing "%." with "{.}". We can do that
> another time if people agree that it's a good idea.
It's a known syntax and works in most cases.
> else
> {
> if (store_p)
> - return MOTOROLA ? "movm.l %1,%a0" : "moveml %1,%a0";
> + return "mov{m.|em}l %1,%a0";
> else
> - return MOTOROLA ? "movm.l %a0,%1" : "moveml %a0,%1";
> + return "mov{m.|em}l %a0,%1";
> }
Here I would suggest to just replace it with movem%.l, movm is not
MOTOROLA syntax.
> @@ -3260,8 +3218,8 @@ output_addsi3 (rtx *operands)
> && (INTVAL (operands[2]) < -32768 || INTVAL (operands[2]) > 32767))
> return "move%.l %2,%0\n\tadd%.l %1,%0";
> if (GET_CODE (operands[2]) == REG)
> - return MOTOROLA ? "lea (%1,%2.l),%0" : "lea %1@(0,%2:l),%0";
> - return MOTOROLA ? "lea (%c2,%1),%0" : "lea %1@(%c2),%0";
> + return "lea {(%1,%2.l)|%1@(0,%2:l)},%0";
> + return "lea {(%c2,%1)|%1@(%c2)},%0";
> }
> if (GET_CODE (operands[2]) == CONST_INT)
> {
These things should be cleaned up in the long term by splitting them and
using a different pattern, so it's a simple "lea %1,%0" at some point.
bye, Roman