public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Excessive limitation on gas for MIPS?
@ 2003-03-18  3:31 Sean McNeil
  2003-03-18 13:03 ` Thiemo Seufer
  0 siblings, 1 reply; 4+ messages in thread
From: Sean McNeil @ 2003-03-18  3:31 UTC (permalink / raw)
  To: binutils

Hello all,

I was testing the CVS repository binutils against an older version of
GCC and I was getting some errors that didn't look right at all:

Error: Number (0x0) larger than 32 bits

where 0x0 was always smaller than 32 bits.

Looking into it a little, I think there is an excessive limitation in
load_register and the following patch fixed my problem:

RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.197
diff -c -3 -p -r1.197 tc-mips.c
*** gas/config/tc-mips.c        12 Mar 2003 23:07:37 -0000      1.197
--- gas/config/tc-mips.c        18 Mar 2003 03:29:53 -0000
*************** load_register (counter, reg, ep, dbl)
*** 3582,3588 ****
   
    /* The value is larger than 32 bits.  */
   
!   if (HAVE_32BIT_GPRS)
      {
        as_bad (_("Number (0x%lx) larger than 32 bits"),
              (unsigned long) ep->X_add_number);
--- 3582,3588 ----
   
    /* The value is larger than 32 bits.  */
   
!   if (HAVE_32BIT_GPRS && ! dbl)
      {
        as_bad (_("Number (0x%lx) larger than 32 bits"),
              (unsigned long) ep->X_add_number);

I would appreciate any feedback on the validity of this relaxation.  It
appears that instructions are legitimate with the fix/patch.

Cheers,
Sean


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Excessive limitation on gas for MIPS?
  2003-03-18  3:31 Excessive limitation on gas for MIPS? Sean McNeil
@ 2003-03-18 13:03 ` Thiemo Seufer
  0 siblings, 0 replies; 4+ messages in thread
From: Thiemo Seufer @ 2003-03-18 13:03 UTC (permalink / raw)
  To: binutils

Sean McNeil wrote:
[snip]
> *** gas/config/tc-mips.c        12 Mar 2003 23:07:37 -0000      1.197
> --- gas/config/tc-mips.c        18 Mar 2003 03:29:53 -0000
> *************** load_register (counter, reg, ep, dbl)
> *** 3582,3588 ****
>    
>     /* The value is larger than 32 bits.  */
>    
> !   if (HAVE_32BIT_GPRS)
>       {
>         as_bad (_("Number (0x%lx) larger than 32 bits"),
>               (unsigned long) ep->X_add_number);
> --- 3582,3588 ----
>    
>     /* The value is larger than 32 bits.  */
>    
> !   if (HAVE_32BIT_GPRS && ! dbl)
>       {
>         as_bad (_("Number (0x%lx) larger than 32 bits"),
>               (unsigned long) ep->X_add_number);
> 
> I would appreciate any feedback on the validity of this relaxation.  It
> appears that instructions are legitimate with the fix/patch.

It is wrong. HAVE_32BIT_GPRS checks if the CPU/the ABI allows to use
registers wider than 32 bits. The case you are observing should be
handled by the code immediately above the part you changed.

Could you provide the preprocessed assembly which triggers this case?


Thiemo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Excessive limitation on gas for MIPS?
  2003-03-18 23:36 Sean McNeil
@ 2003-03-19  0:05 ` Thiemo Seufer
  0 siblings, 0 replies; 4+ messages in thread
From: Thiemo Seufer @ 2003-03-19  0:05 UTC (permalink / raw)
  To: Sean McNeil; +Cc: binutils

Sean McNeil wrote:
> > It is wrong. HAVE_32BIT_GPRS checks if the CPU/the ABI allows to use
> > registers wider than 32 bits. The case you are observing should be
> > handled by the code immediately above the part you changed.
> > 
> > Could you provide the preprocessed assembly which triggers this case?
> 
> I am using the following switches to an older GCC:
> 
> -G0 -mips4 -mlong32 -EB -ansi -fno-builtin -O -Wall
> 
> The assembler end up getting called with:
> 
> -G0 -EB -mips4 -O2 -v -mabi=32
> 
> even though cc1 was called with:
> 
> -mfp64 -mgp64 -mexplicit-type-size -G0 -meb -quiet -dumpbase
  ^^^^^^^^^^^^^
The compiler generates code for 64 bit wide registers. The assembler
shouldn't be called with -mabi=32 in this case. Adjusting the spec file
should help.

> bcm1250MacEnd.c -mips4 -mlong32
> 
> It turns out that there is a spec in the compiler that passes -mabi=32
> when no abi was specified.  It is this that is causing trouble as the
> compiler is generating assembly like:
> 
> 	dli	$3,0x5ee400000040000
> 
> the assembler is only displaying the lower significant 32 bits in the
> message, by the way.
> 
> so,
> 
> 1) an abi of 32 implies 32-bit registers?  I shouldn't think so.

It does. o32 is the ABI which was invented for the old 32bit MIPS
CPUs.

> 2) Doesn't a "dli" instruction state "double load" or 64 bits?

Yes.

> 3) This behavior has changed from previous gas versions.

Yes, gas expands now 64 bit macros (as it should).

> Thanks for the input.  I am not on the binutils list, so I had to check
> the archive to see your response.

A 'Mail-Followup-To:' mail header would have helped.


Thiemo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Excessive limitation on gas for MIPS?
@ 2003-03-18 23:36 Sean McNeil
  2003-03-19  0:05 ` Thiemo Seufer
  0 siblings, 1 reply; 4+ messages in thread
From: Sean McNeil @ 2003-03-18 23:36 UTC (permalink / raw)
  To: binutils

> It is wrong. HAVE_32BIT_GPRS checks if the CPU/the ABI allows to use
> registers wider than 32 bits. The case you are observing should be
> handled by the code immediately above the part you changed.
> 
> Could you provide the preprocessed assembly which triggers this case?

I am using the following switches to an older GCC:

-G0 -mips4 -mlong32 -EB -ansi -fno-builtin -O -Wall

The assembler end up getting called with:

-G0 -EB -mips4 -O2 -v -mabi=32

even though cc1 was called with:

-mfp64 -mgp64 -mexplicit-type-size -G0 -meb -quiet -dumpbase
bcm1250MacEnd.c -mips4 -mlong32

It turns out that there is a spec in the compiler that passes -mabi=32
when no abi was specified.  It is this that is causing trouble as the
compiler is generating assembly like:

	dli	$3,0x5ee400000040000

the assembler is only displaying the lower significant 32 bits in the
message, by the way.

so,

1) an abi of 32 implies 32-bit registers?  I shouldn't think so.
2) Doesn't a "dli" instruction state "double load" or 64 bits?
3) This behavior has changed from previous gas versions.

Thanks for the input.  I am not on the binutils list, so I had to check
the archive to see your response.

Cheers,
Sean


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-03-19  0:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-18  3:31 Excessive limitation on gas for MIPS? Sean McNeil
2003-03-18 13:03 ` Thiemo Seufer
2003-03-18 23:36 Sean McNeil
2003-03-19  0:05 ` Thiemo Seufer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).