This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH - h8300] function_vector attribute in H8300 targets
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: AsgariJ at KPITCummins dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 03 Oct 2004 09:56:02 -0400 (EDT)
- Subject: Re: [PATCH - h8300] function_vector attribute in H8300 targets
- References: <4A1BE23A7B777442B60F4B4916AE0F1335B71E@sohm.kpit.com>
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