[patch] tic4x support in gas

Alan Modra amodra@bigpond.net.au
Thu Oct 10 05:51:00 GMT 2002


On Thu, Sep 26, 2002 at 01:37:39PM +0200, Svein E. Seldal wrote:
> Index: expr.c
> ===================================================================
> RCS file: /cvs/src/src/gas/expr.c,v
> retrieving revision 1.45
> diff -c -3 -p -r1.45 expr.c
> *** expr.c	20 Sep 2002 00:58:39 -0000	1.45
> --- expr.c	26 Sep 2002 11:30:18 -0000
> *************** operand (expressionP)
> *** 841,846 ****
> --- 841,852 ----
>         c = *input_line_pointer;
>         switch (c)
>   	{
> + #ifdef TC_TIC4X
> +         case '.':  /* 0. */
> +           floating_constant (expressionP);
> +           break;
> + #endif
> + 
>   	case 'o':
>   	case 'O':
>   	case 'q':

You should be able to handle this a few lines above, changing

	  /* Check for a hex constant.  */
	  for (s = input_line_pointer; hex_p (*s); s++)
	    ;
	  if (*s == 'h' || *s == 'H')
to
	  /* Check for a hex constant or floating point number.  */
	  for (s = input_line_pointer; hex_p (*s); s++)
	    ;
	  if (*s == 'h' || *s == 'H' || *input_line_pointer == '.')


> *************** operand (expressionP)
> *** 1079,1084 ****
> --- 1085,1100 ----
>   	    else
>   	      expressionP->X_add_number = ! expressionP->X_add_number;
>   	  }
> + #ifdef TC_TIC4X
> +         else if (expressionP->X_op == O_big && expressionP->X_add_number <= 0)
> +         {
> +             /* Negative flonum (eg, -1.000e0).  */
> +             if (generic_floating_point_number.sign == '+')
> +                 generic_floating_point_number.sign = '-';
> +             else if (generic_floating_point_number.sign == 'P')
> +                 generic_floating_point_number.sign = 'N';
> +         }
> + #endif
>   	else if (expressionP->X_op != O_illegal
>   		 && expressionP->X_op != O_absent)
>   	  {

This is careless.  What about case '!' and case '~'?  Please fix
your formatting too.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list