Deutsch   English   Français   Italiano  
<c7d39917db81f33fd90a8b57e7d0f85d@www.novabbs.org>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder9.news.weretis.net!news.nk.ca!rocksolid2!i2pn2.org!.POSTED!not-for-mail
From: mitchalsup@aol.com (MitchAlsup1)
Newsgroups: comp.arch
Subject: Re: Calling conventions (particularly 32-bit ARM)
Date: Tue, 14 Jan 2025 23:27:22 +0000
Organization: Rocksolid Light
Message-ID: <c7d39917db81f33fd90a8b57e7d0f85d@www.novabbs.org>
References: <vlgngv$1ks4a$1@dont-email.me> <4903307dfcce354508c9fc016a4c1ea1@www.novabbs.org> <vli2gu$1aftg$1@paganini.bofh.team> <vm17ka$1d58r$1@dont-email.me> <vm1pp4$31m2n$1@paganini.bofh.team> <vm67ic$2fnmd$1@dont-email.me> <vm69pj$2h7bt$1@dont-email.me> <20250114234819.000012ac@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
	logging-data="3634429"; mail-complaints-to="usenet@i2pn2.org";
	posting-account="o5SwNDfMfYu6Mv4wwLiW6e/jbA93UAdzFodw5PEa6eU";
User-Agent: Rocksolid Light
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Rslight-Site: $2y$10$Ai2pJ/quFOZ3RfU/nBOsIujImJuSPkVVn96zO.TK0ASC3J2kh2y46
X-Rslight-Posting-User: cb29269328a20fe5719ed6a1c397e21f651bda71
Bytes: 2905
Lines: 44

On Tue, 14 Jan 2025 21:48:19 +0000, Michael S wrote:

> On Tue, 14 Jan 2025 19:18:27 +0100
> Terje Mathisen <terje.mathisen@tmsw.no> wrote:
>
>> Stephen Fuld wrote:
>>> On 1/12/2025 5:20 PM, Waldek Hebisch wrote:
>>>> You are implicitely assuming that passing large number of
>>>> arguments is expensive.
>>>
>>> I guess.  I am actually assuming that passing arguments in memory
>>> is more expensive than passing them in registers.  I don't think
>>> that is controversial.
>>
>> Usually true, except for recursive functions where you have to store
>> most stuff on the stack anyway, so going directly there can sometimes
>> generate more compact code.
>>
>> Terje
>>
>
> I would think that for Fortran (==everything passed by reference)
> memory would beat registers most of the time.

Pass by COMMON block was even faster.

>                                               May be, except for
> functions with 0-4 parameters.

> Do common Fortarn compilers even bother with passing in register?

Fortran compilers are given an ABI (leaning towards C, C++) and
are required to "do something reasonable" in mapping Fortran
conventions into C conventions. C subroutines on the called
side, then, have to have a data structure identical to what
Fortran compiler would have produced (Dope Vector). C callers
will have to use those kinds of structures to successfully
call Fortran entry points.

> It would require replacement of natural by-reference "pointer in
> register points to value in memory" calling sequence to something like
> copy-in/copy-out, right?

No, Fortran will pass dope vectors to called subroutines. The
called subroutine needs to understand the dope vector.