Re: SPARC references (Dan Salomon)
Fri, 29 Mar 91 21:47:51 GMT

          From comp.compilers

Related articles
SPARC references (1991-03-20)
Re: SPARC references (1991-03-24)
Re: SPARC references (John ffitch) (1991-03-28)
Re: SPARC references (1991-03-29)
Re: SPARC references chased@Eng.Sun.COM (1991-04-01)
Re: SPARC references (1991-04-01)
Re: SPARC references (1991-04-12)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Dan Salomon)
Keywords: SPARC, optimize, code
Organization: University of Manitoba, Winnipeg, Canada
References: <> <> <>
Date: Fri, 29 Mar 91 21:47:51 GMT

In article <> John ffitch <> writes:
>There was reference to a book by Dewar and Smosna which compared SPARC and
>MIPS. Does anyone know the publisher? I have been unable to trace it in
>our library.

I was the original poster of the information. Unfortunately my copy was
lent out at the time so all I could provide were the authors last names
and the title. Here is the full reference:

        Microprocessors: A Programmers View
        Robert B.K. Dewar & Matthew Smosna
        McGraw Hill (c) 1990
        ISBN 0-07-016639-0

>So far my experience of SPARC has been less than good, as
>the explanation in the Architecture manual leaves a lot to the
>imagination. Some thing which really explained what happens to the stack
>or window roll, how va_args is supposed to work, and so on would be really

You won't find that kind of detail in Dewar and Smosna. Check out the
manual "Porting Software to SPARC Sytems" that comes bound with the
"Assembler Language Reference Manual". It has a little information on
this topic in the section "Porting C Programs" and the subsection on

>In my code someone keeps trampling on the stack, and honest guv'
>it's not me!

This is indeed a "gotcha" of programming on the SPARC. If you read the
specifications of the calling conventions carefully (in the appendix
called "Software Considerations" of the architecture manual) you will find
that the top of the stack must at all times contain 23 words that can be
clobbered by called procedures. So any space that you use on the stack
must have been allocated below the stack top by the SAVE instruction.

The difficulty that I have had is in finding specific details on the
calling conventions that the C compiler uses. I believe, for instance,
that it will say that the caller, not the callee, is responsible for
saving the floating-point registers.

Dan Salomon -- salomon@ccu.UManitoba.CA
                              Dept. of Computer Science / University of Manitoba
Winnipeg, Manitoba, Canada R3T 2N2 / (204) 275-6682

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.