From: Mark Probst <schani@unix.cslab.tuwien.ac.at>
To: axp-list@redhat.com
Subject: Re: Alpha's floating point performance
Date: Wed, 18 Nov 1998 22:26:40 +0000 [thread overview]
Message-ID: <19981118222640.A30010@obiwan.unix.cslab.tuwien.ac.at> (raw)
In-Reply-To: <365338D7.AE1FA0DA@topdog.logicon.com>; from Chris Albertson on Wed, Nov 18, 1998 at 01:15:03PM -0800
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/
next prev parent reply other threads:[~1998-11-18 21:25 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 [this message]
1998-11-18 22:41 ` Bibek Sahu
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