This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 1/4] S12Z: GAS: Disallow immediate destination operands
- From: Nick Clifton <nickc at redhat dot com>
- To: John Darrington <john at darrington dot wattle dot id dot au>, binutils at sourceware dot org
- Date: Fri, 1 Feb 2019 10:48:57 +0000
- Subject: Re: [PATCH 1/4] S12Z: GAS: Disallow immediate destination operands
- References: <20190131180442.31410-1-john@darrington.wattle.id.au>
Hi John,
> gas/
>
> * config/tc-s12z.c (lex_opr): Add a parameter to indicate whether
> immediate mode operands should be permitted.
> * testsuite/s12z/imm-dest.d: New file.
> * testsuite/s12z/imm-dest.l: New file.
> * testsuite/s12z/imm-dest.s: New file.
> * testsuite/s12z/s12z.exp: Add them.
Approved - please apply - but I do have one question:
> static int
> -lex_opr (uint8_t *buffer, int *n_bytes, expressionS *exp)
> +lex_opr (uint8_t *buffer, int *n_bytes, expressionS *exp,
> + bool immediate_ok)
> {
Why does this function return an int instead of a bfd_boolean ?
> static int
> -reg_opr (const struct instruction *insn, int allowed_regs)
> +reg_opr (const struct instruction *insn, int allowed_regs,
> + bool immediate_ok)
> {
In fact ... it seems that there are a whole bunch of functions
in tc-s12z.c that ought to be returning booleans. Just an idea
for a clean-up patch...
Cheers
Nick