[PATCH 1/4] S12Z: GAS: Disallow immediate destination operands

Nick Clifton nickc@redhat.com
Fri Feb 1 10:49:00 GMT 2019


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



More information about the Binutils mailing list