This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch] MIPS: Add mips16e save/restore instruction support.
- From: Thiemo Seufer <ths at networkno dot de>
- To: David Ung <davidu at mips dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 1 Nov 2005 03:23:08 +0100
- Subject: Re: [Patch] MIPS: Add mips16e save/restore instruction support.
- References: <1129816458.27580.26.camel@localhost.localdomain>
David Ung wrote:
>
> This patch adds the MIPS16e save/restore instructions to the opcode
> table, dissambler and gas.
[snip]
> Index: gas/config/tc-mips.c
> ===================================================================
> RCS file: /cvs/src/src/gas/config/tc-mips.c,v
> retrieving revision 1.324
> diff -c -p -b -r1.324 tc-mips.c
> *** gas/config/tc-mips.c 19 Oct 2005 18:47:09 -0000 1.324
> --- gas/config/tc-mips.c 20 Oct 2005 13:36:38 -0000
> *************** mips16_ip (char *str, struct mips_cl_ins
> *** 9836,9841 ****
> --- 9836,10013 ----
> }
> continue;
>
> + case 'm': /* register list for save insn */
> + case 'M': /* register list for restore insn */
Comment formatting.
> + {
> + int opcode = 0;
> + int framesz = 0, seen_framesz = 0;
> + int args = 0, astatics = 0, sregs = 0;
> +
> + while (*s != '\0')
> + {
> + unsigned int reg1, reg2;
> +
> + while (*s == ' ' || *s == ',')
> + ++s;
> + my_getExpression (&imm_expr, s);
> + if (imm_expr.X_op == O_constant)
> + {
> + /* Handle the frame size. */
> + if (seen_framesz)
> + {
> + as_bad ("more than one frame size in list");
Should be i18n: as_bad (_("... , there are more such instances further
down.
[snip]
> + /* Encode args/astatic combination. */
> + if (args & astatics)
> + as_bad ("arg/static registers overlap");
> + else if (args == 0xf)
> + /* All $a0-$a3 are args. */
> + opcode |= 0xe << 16;
> + else if (astatics == 0xf)
> + /* All $a0-$a3 are a-statics. */
Now, how is it called, "astatic", "static" or "a-static"? Consistent
naming would be good. I also dislike the magic constants showing up
here.
Thiemo