Last of the gas cleanups

Alan Modra amodra@bigpond.net.au
Tue Feb 1 02:44:00 GMT 2005


On Tue, Feb 01, 2005 at 01:22:21AM +0100, Andreas Schwab wrote:
> "Ben Elliston" <bje@au1.ibm.com> writes:
> 
> > Index: config/tc-alpha.c
> > ===================================================================
> > RCS file: /home/bje/src-cvs/src/gas/config/tc-alpha.c,v
> > retrieving revision 1.63
> > diff -u -p -u -r1.63 tc-alpha.c
> > --- config/tc-alpha.c	31 Jan 2005 23:18:25 -0000	1.63
> > +++ config/tc-alpha.c	31 Jan 2005 23:39:58 -0000
> > @@ -159,30 +159,17 @@ struct alpha_macro
> >  /* XXX: The non-shift version appears to trigger a compiler bug when
> >     cross-assembling from x86 w/ gcc 2.7.2.  */
> >  
> > -#if 1
> >  #define range_signed_16(x) \
> >  	(((offsetT) (x) >> 15) == 0 || ((offsetT) (x) >> 15) == -1)
> >  #define range_signed_32(x) \
> >  	(((offsetT) (x) >> 31) == 0 || ((offsetT) (x) >> 31) == -1)
> > -#else
> > -#define range_signed_16(x)	((offsetT) (x) >= -(offsetT) 0x8000 &&	\
> > -				 (offsetT) (x) <=  (offsetT) 0x7FFF)
> > -#define range_signed_32(x)	((offsetT) (x) >= -(offsetT) 0x80000000 && \
> > -				 (offsetT) (x) <=  (offsetT) 0x7FFFFFFF)
> > -#endif
> >  
> >  /* Macros for sign extending from 16- and 32-bits.  */
> >  /* XXX: The cast macros will work on all the systems that I care about,
> >     but really a predicate should be found to use the non-cast forms.  */
> >  
> > -#if 1
> >  #define sign_extend_16(x)	((short) (x))
> >  #define sign_extend_32(x)	((int) (x))
> > -#else
> > -#define sign_extend_16(x)	((offsetT) (((x) & 0xFFFF) ^ 0x8000) - 0x8000)
> > -#define sign_extend_32(x)	((offsetT) (((x) & 0xFFFFFFFF) \
> > -					   ^ 0x80000000) - 0x80000000)
> > -#endif
> 
> These should probably go the other way round.  The disabled alternatives
> are more portable in the long run.

Agreed, except that the cast to offsetT should be applied to (x) in
sign_extend_*.

> --- config/tc-ia64.c	31 Jan 2005 23:18:29 -0000	1.128
> +++ config/tc-ia64.c	31 Jan 2005 23:39:58 -0000
> @@ -11198,16 +11198,11 @@ ia64_handle_align (fragp)
>    if (!bytes && fragp->tc_frag_data)
>      {
>        if (fragp->fr_fix < 16)
> -#if 1
>  	/* FIXME: It won't work with
>  	   .align 16
>  	   alloc r32=3Dar.pfs,1,2,4,0
>  	 */
>  	;
> -#else
> -	as_bad_where (fragp->fr_file, fragp->fr_line,
> -		      _("Can't add stop bit to mark end of instruction group"));
> -#endif
>        else
>  	/* Bundles are always in little-endian byte order. Make sure
>  	   the previous bundle has the stop bit.  */

And this patch loses the "It" the comment is referring to.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list