From: Bibek Sahu <scorpio@dodds.net>
To: axp-list@redhat.com
Subject: Re: Alpha's floating point performance
Date: Wed, 18 Nov 1998 16:41:40 -0600 (CST) [thread overview]
Message-ID: <Pine.LNX.3.95.981118163616.25933I-100000@norad.dodds.net> (raw)
In-Reply-To: <19981118222640.A30010@obiwan.unix.cslab.tuwien.ac.at>
If you don't activate optimizations, it most certainly does push
the arguments onto the stack. And inside the function it pushes all local
variables onto the stack. But then, that's _without_ optimizations. ;-)
"gcc -S" will produce the assembler source that is built from the
C file. You give it foo.c, it gives you foo.s.
"asm" is the command to insert direct assembly in the C source.
E.g., asm( "addq $16,1,$0" );
Beyond that, I don't know much about it.
- Bob
On Wed, 18 Nov 1998, Mark Probst wrote:
> On Wed, Nov 18, 1998 at 01:15:03PM -0800, Chris Albertson wrote:
>
> > It depends on the compiler but normally C pushes the arguments
> > onto the stack. The called function pops them off and places the
> > return value on the stack. What is placed on the stack is either
>
> maybe on the 80x86 architecture but surely not on a machine with
> 2x32 general purpose registers! calling convention on the alpha is
> to pass the first six integer arguments of a function through
> registers a0-a5 ($16-$21). the integer return value is returned
> through $0. a function taking one 64bit argument, adding one
> and returning the result would look like this:
>
> ---
> .globl asm_func
>
> .ent asm_func
> asm_func:
> addq $16,1,$0
> jmp $31,($26)
>
> .end asm_func
> ---
>
> a little c program calling it:
>
> ---
> #include <stdio.h>
>
> long asm_func (long l);
>
> int
> main (void)
> {
> printf("%ld\n", asm_func(1));
> return 0;
> }
> ---
>
> that's about it. there's really nothing much to it.
>
> bye
> schani
>
> --
> Mark Probst
> Student, Programmer
> http://www.unix.cslab.tuwien.ac.at/~schani/
>
> --
> To unsubscribe: send e-mail to axp-list-request@redhat.com with
> 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
>
next prev parent reply other threads:[~1998-11-18 22:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.3.96.981117143804.30989B-100000@bach.ce.gatech.edu>
1998-11-18 21:15 ` Alpha's floating point performance Chris Albertson
1998-11-18 22:26 ` Mark Probst
1998-11-18 22:41 ` Bibek Sahu [this message]
1998-11-19 10:33 ` Mark Probst
1998-11-16 22:51 y0000218
1998-11-17 9:09 ` Harvey J. Stein
1998-11-17 16:11 ` Scott Lewis
1998-11-17 19:36 ` Chris Albertson
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox