Using SPARC v9

Using SPARC v9

Post by Michael Gschwin » Wed, 24 Sep 1997 04:00:00



I need to access the 64 bit capabilities of the new V9 (under
Solaris 2.5.1), and I wonder what I need to do in order to use these
instructions...

The main problem I see is interoperability with the operating
system which needs to be told to save/restore 64 bit values on
register stack under/overflow...  Now the compilers all leave
16 words for saving a register window, which at 64 bit per regs
is not quite enough :-(

Thus, I figure that the OS contains different spill code for
v8, V8+ and V9 processes...  Does anybody know whether
even this minimal support for V9 already exists in 2.5.1?  I will
happily use the 32 bit ABI if I can do 64 bit arithmetic
efficiently ;-)

Any suggestions, pointers, hints will be appreciated!

m.

PS: I have seriously though about saving all 64 bit registers
before every function call, but that would be too constraining...
Also, I wonder whether Solaris will save 64 bit regs on a context
switch (which should be less of a problem because the restriction
to 16 words reserved on the stack is not there...)

 
 
 

Using SPARC v9

Post by Jim Moore - Solaris OS Sustaining Engineerin » Wed, 24 Sep 1997 04:00:00



> [...]

> The main problem I see is interoperability with the operating
> system which needs to be told to save/restore 64 bit values on
> register stack under/overflow...  Now the compilers all leave
> 16 words for saving a register window, which at 64 bit per regs
> is not quite enough :-(

> Thus, I figure that the OS contains different spill code for
> v8, V8+ and V9 processes...  Does anybody know whether
> even this minimal support for V9 already exists in 2.5.1?  I will
> happily use the 32 bit ABI if I can do 64 bit arithmetic
> efficiently ;-)

There is rudimentary 64-bit window spill/fill support
under 2.5.1.  The decision on which spill handler to use
depends on whether %sp is even or odd.

Note that we don't (yet) officially support 64-bit windows

Cheers,
Jim.
-=-
Jim Moore, Principal Engineer     | "adb is *still* your friend"
Solaris OS Sustaining Engineering |


 
 
 

Using SPARC v9

Post by Casper H.S. Dik - Network Security Engine » Wed, 24 Sep 1997 04:00:00


[[ Reply by email or post, don't do both ]]


>I need to access the 64 bit capabilities of the new V9 (under
>Solaris 2.5.1), and I wonder what I need to do in order to use these
>instructions...

You can't access all of it yet.

Quote:>The main problem I see is interoperability with the operating
>system which needs to be told to save/restore 64 bit values on
>register stack under/overflow...  Now the compilers all leave
>16 words for saving a register window, which at 64 bit per regs
>is not quite enough :-(

In 2.5.1, the %o and global registers are saved in a special part
of teh context; none of the other registers are saved so the
other windows lose their upper 32 bits.

Quote:>Thus, I figure that the OS contains different spill code for
>v8, V8+ and V9 processes...  Does anybody know whether
>even this minimal support for V9 already exists in 2.5.1?  I will
>happily use the 32 bit ABI if I can do 64 bit arithmetic
>efficiently ;-)

You can do 64 bit arithmetic effeciently, but not directly by the compiler.
(Well, the libraries contain 64 bit code that will do long long operations
more or less effectively but called through a 32 bit API so or'ing and shifting
is stil needed.

Quote:>PS: I have seriously though about saving all 64 bit registers
>before every function call, but that would be too constraining...
>Also, I wonder whether Solaris will save 64 bit regs on a context
>switch (which should be less of a problem because the restriction
>to 16 words reserved on the stack is not there...)

Solaris only saves the current %o registers an dthe %g registers; only those
registers can safely be used in 64 bit mode and only without intervening system
calls. (interrupts are OK)

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

Using SPARC v9

Post by John F Ca » Tue, 30 Sep 1997 04:00:00




Quote:>Thus, I figure that the OS contains different spill code for
>v8, V8+ and V9 processes...

The kernel has spill routines for mixed 32/64 bit stack frames, but user
code is forced to use the 32 bit version.  Without OS source you will have a
hard time changing this.  It's only a couple bits in a processor register
that need to change but you need to set these bits on every context switch
and record them in the process structure.

Quote:>Does anybody know whether even this minimal support for V9 already exists
>in 2.5.1?  I will happily use the 32 bit ABI if I can do 64 bit arithmetic
>efficiently ;-)

The OS saves all 64 bits of the out and global registers on a context switch.
The high 32 bits of the out registers may be cleared on a call to a non-leaf
function (i.e. if a save is executed).  The high 32 bits of in and local
registers may be cleared at any time.

You can use all the user level V9 instructions in Solaris (except possibly
popc) as long as you don't store 64 bit results in the wrong registers.

--

 
 
 

1. using little endian on sparc v9

Hello,

Has anybody used the ability to read and write in little endian mode on
sparc v9 implementations? I've read about specifying ASI_PRIMARY_LITTLE with
the load and store alternate instructions, but I'd like to do this from C if
possible.

What about marking the executable as little endian? Or a library (shared or
static) as little endian?

thanks for any suggestions,
Marc

2. compiling in linux

3. Sparc v9 emulator?

4. X-CD-Roast 0.95c - CD-Writer-Program for X

5. application call stack on SPARC v9

6. X Display prob

7. Looking for the SPARC Architecture Manuals V8 and V9

8. Sun courses - web-based or cdrom?

9. Is GCC supporting SPARC V9 architecture?

10. Linux Sparc V9 code optimazation

11. SPARC v9 memory model

12. Sparc V9 chip; which sys/isa_defs.h ?

13. SPARC V9 ABI