All of lore.kernel.org
 help / color / mirror / Atom feed
* $ta0 .. $ta3 registers in O32 on MIPS
@ 2011-09-28 12:33 Ralf Baechle
  2011-09-28 15:11   ` Paul_Koning
  0 siblings, 1 reply; 4+ messages in thread
From: Ralf Baechle @ 2011-09-28 12:33 UTC (permalink / raw)
  To: binutils, linux-mips, David Kuehling

The register names $ta0 .. $ta3 were added by SGI for N32 / N64 code.
Because these reference $8 .. $11 just like $t0 .. $t3 in the O32 ABI
their availability in O32 as well appears dangerous, if not a bug:

$ cat s.s 
	addu	$ta0, $ta0
$ mips-linux-as -o s.o s.s
$ file s.o
s.o: ELF 32-bit MSB relocatable, MIPS, MIPS-I version 1 (SYSV), not stripped
$

I was expecting an error message and I'm wondering, was this intentional?

  Ralf

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

* RE: $ta0 .. $ta3 registers in O32 on MIPS
@ 2011-09-28 15:11   ` Paul_Koning
  0 siblings, 0 replies; 4+ messages in thread
From: Paul_Koning @ 2011-09-28 15:11 UTC (permalink / raw)
  To: ralf, binutils, linux-mips, dvdkhlng

>The register names $ta0 .. $ta3 were added by SGI for N32 / N64 code.
>Because these reference $8 .. $11 just like $t0 .. $t3 in the O32 ABI their availability in O32 as well appears dangerous, if not a bug:
>
>$ cat s.s 
>	addu	$ta0, $ta0
>$ mips-linux-as -o s.o s.s
>$ file s.o
>s.o: ELF 32-bit MSB relocatable, MIPS, MIPS-I version 1 (SYSV), not stripped $
>
>I was expecting an error message and I'm wondering, was this intentional?

I would say so.  I call this a feature.  It makes it easier to write assembly code that assembles without change in both O32 and N32/N64.  Consider a function that has 4 or fewer arguments, but needs a pile of scratch registers.  It can use ta0-ta3 as four scratch registers, which is correct in all the ABIs.

	paul

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

* RE: $ta0 .. $ta3 registers in O32 on MIPS
@ 2011-09-28 15:11   ` Paul_Koning
  0 siblings, 0 replies; 4+ messages in thread
From: Paul_Koning @ 2011-09-28 15:11 UTC (permalink / raw)
  To: ralf, binutils, linux-mips, dvdkhlng

>The register names $ta0 .. $ta3 were added by SGI for N32 / N64 code.
>Because these reference $8 .. $11 just like $t0 .. $t3 in the O32 ABI their availability in O32 as well appears dangerous, if not a bug:
>
>$ cat s.s 
>	addu	$ta0, $ta0
>$ mips-linux-as -o s.o s.s
>$ file s.o
>s.o: ELF 32-bit MSB relocatable, MIPS, MIPS-I version 1 (SYSV), not stripped $
>
>I was expecting an error message and I'm wondering, was this intentional?

I would say so.  I call this a feature.  It makes it easier to write assembly code that assembles without change in both O32 and N32/N64.  Consider a function that has 4 or fewer arguments, but needs a pile of scratch registers.  It can use ta0-ta3 as four scratch registers, which is correct in all the ABIs.

	paul

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

* Re: $ta0 .. $ta3 registers in O32 on MIPS
  2011-09-28 15:11   ` Paul_Koning
  (?)
@ 2011-09-28 19:43   ` Ralf Baechle
  -1 siblings, 0 replies; 4+ messages in thread
From: Ralf Baechle @ 2011-09-28 19:43 UTC (permalink / raw)
  To: Paul_Koning; +Cc: binutils, linux-mips, dvdkhlng

On Wed, Sep 28, 2011 at 10:11:40AM -0500, Paul_Koning@Dell.com wrote:

> >I was expecting an error message and I'm wondering, was this intentional?
> 
> I would say so.  I call this a feature.  It makes it easier to write assembly code that assembles without change in both O32 and N32/N64.  Consider a function that has 4 or fewer arguments, but needs a pile of scratch registers.  It can use ta0-ta3 as four scratch registers, which is correct in all the ABIs.

Turns out that later IRIX version also retroactively introduced the
ta registers for O32 and I just never noticed.  So I'm going to change the
Linux kernel headers for consistence and compatibility with everybody else.

  Ralf

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

end of thread, other threads:[~2011-09-28 19:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-28 12:33 $ta0 .. $ta3 registers in O32 on MIPS Ralf Baechle
2011-09-28 15:11 ` Paul_Koning
2011-09-28 15:11   ` Paul_Koning
2011-09-28 19:43   ` Ralf Baechle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.