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 - h8300] function_vector attribute in H8300 targets


Hi Asgari,

> +      else if (GET_CODE (inside) == SYMBOL_REF)
> +        {
> +            assemble_name (file,XSTR (inside,0));
> +        }
> +      else if (GET_CODE (inside) == REG)
> +        {
> +            if (TARGET_H8300)
> +              fprintf (file, "%s", names_big[REGNO (inside)]);
> +            else
> +              fprintf (file, "%s", names_extended[REGNO (inside)]);
> +        }

You might want to have h8300.c:print_operand_address() handle these
two cases to avoid code duplication.

> +      else if (GET_CODE (inside) == CONST_INT)
> +        {
> +            if (TARGET_H8300 || TARGET_NORMAL_MODE)
> +              fprintf (file, "%d", INTVAL (inside) & 0xffff);
> +            else
> +              fprintf (file, "%d", INTVAL (inside) & 0xffffff);
> +        }

There is a similar case in h8300.c:print_operand_address().  You might
want to look at it and see if you can reuse or extend.

>  }
> +/* Handle a "function_vector" attribute; arguments as in
> +   struct attribute_spec.handler.  */

One blank line between the closing brace and the comment.

Kazu Hirata


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