From: Keith Thompson <kst-u@mib.org>
Subject: Re: Specifying parameter passing convention and place (register)
Date: Fri, 09 Jul 2004 21:29:08 GMT
Date: 2004-07-09T21:29:08+00:00 [thread overview]
Message-ID: <lnoemo6f8a.fsf@nuthaus.mib.org> (raw)
In-Reply-To: opsaot0qmdp4pfvb@bram-2
"Nick Roberts" <nick.roberts@acm.org> writes:
> What form should a pragma take for specifying the convention and place
> (register or in memory) for the passing of parameters into and out of
> subprograms?
[...]
> A different possible approach is the use of representation attributes on
> subtypes. The GNAT attribute Passed_By_Reference could be used to specify
> whether a parameter of the subtype is passed by reference or by copy
> (value). An attribute such as Passing_Place could be a value of an
> enumeration such as, for example:
>
> type Parameter_Passing_Place is
> ( Default, Stack,
> AL, AH, DL, DH, CL, CH, BL, BH,
> AX, DX, CX, BX, SI, DI, BP, SP,
> EAX, EDX, ECX, EBX, ESI, EDI, EBP, ESP,
> ST_0, ST_1, ..., ST_7,
> EDX_EAX, ECX_EBX,
> ES, FS, GS, ES_EAX, FS_EDX, GS_ECX );
>
> This way, I can declare, for example:
>
> subtype Integer_Passed_In_EAX is Integer;
> for Integer_Passed_By_EAX'Passing_Place use EAX;
>
> and then I can declare a function:
>
> function Wibble (N: in Integer_Passed_In_EAX)
> return Integer_Passed_In_EAX;
>
> in order to specify that the parameter N and the function are both to be
> passed in the register EAX.
[...]
It seems counterintuitive to associate the parameter passing method
with a subtype rather than with a formal parameter.
What about something like this?
function Wibble (N: in Integer);
for Wibble'Parameter_Passing use ( N => EAX );
Adjust names and syntax to taste.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
next prev parent reply other threads:[~2004-07-09 21:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-05 23:25 Specifying parameter passing convention and place (register) Nick Roberts
2004-07-06 12:58 ` Larry Kilgallen
2004-07-06 17:30 ` Nick Roberts
2004-07-07 4:14 ` Larry Kilgallen
2004-07-07 13:13 ` Nick Roberts
2004-07-07 18:54 ` Larry Kilgallen
2004-07-07 21:01 ` Nick Roberts
2004-07-08 12:06 ` Larry Kilgallen
2004-07-08 15:29 ` Nick Roberts
2004-07-08 14:09 ` Bob Spooner
2004-07-08 18:10 ` Nick Roberts
2004-07-08 12:27 ` Georg Bauhaus
2004-07-08 15:38 ` Larry Kilgallen
2004-07-08 18:03 ` Georg Bauhaus
2004-07-09 21:29 ` Keith Thompson [this message]
2004-07-09 21:50 ` Nick Roberts
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox