Re: Unpopular parameter passing mechanisms and parallelisation (was Re: sequential binary parallelization at run-time)

glen herrmannsfeldt <gah@ugcs.caltech.edu>
Tue, 30 Oct 2007 23:24:45 -0800

          From comp.compilers

Related articles
sequential binary parallelization at run-time wangli.one@gmail.com (Lauren) (2007-10-25)
Re: sequential binary parallelization at run-time gneuner2@comcast.net (George Neuner) (2007-10-27)
Unpopular parameter passing mechanisms and parallelisation (was Re: se al407@cam.ac.uk (Anton Lokhmotov) (2007-10-28)
Re: Unpopular parameter passing mechanisms and parallelisation (was Re gneuner2@comcast.net (George Neuner) (2007-10-30)
Re: Unpopular parameter passing mechanisms and parallelisation (was Re gah@ugcs.caltech.edu (glen herrmannsfeldt) (2007-10-30)
| List of all articles for this month |

From: glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups: comp.compilers
Date: Tue, 30 Oct 2007 23:24:45 -0800
Organization: Compilers Central
References: 07-10-082 07-10-089 07-10-091 07-10-098
Keywords: design, Fortran
Posted-Date: 31 Oct 2007 09:56:20 EDT

George Neuner wrote:


> 28 Oct 2007 19:06:41 +0000, Anton Lokhmotov <al407@cam.ac.uk> wrote:


(snip)


>>As for imperative programming, another undeservedly abandoned
>>parameter passing semantics is call-by-value-result (CBVR). In CBVR,
>>writes to the caller's memory by the callee do not happen until the
>>callee returns but the callee keeps track of them.
        :
> <snip examples>


Fortran still allows call-by-value-result.


I first knew it used for scalar variables (only) on the
OS/360 Fortran G and H compilers. (Probably E also.)


For S/360 it is more efficient in time and space to copy a
scalar to local memory, addressed by the same base register
as the other data, and copy back later. In most cases it
takes two instructions to reference a variable through its
address. (One to load the address into a register, the
second to load or store as appropriate). For arrays,
OS/360 always does call by reference.


>>This semantics is similar to that of vector assignment statements in
>>Fortran 90 (which we discussed here around August) and allows the
>>callee's code to be automatically parallelised even if it contains
>>references or pointers that can potentially alias (which complicates
>>dependence analysis in mainstream programming languages).


The usual case in current compilers is that in some cases Fortran
allows non-contiguous arrays to be passed. In other cases, arrays
are assumed contiguous. That can require a copy to be made before
the call, and copy back after, usually done by the caller not the
callee but the effect is the same.


> Fortran's semantics were designed to correspond with the behavior of
> real hardware - serial pipelined vector processors.
(snip)


> As a parameter passing method, CBVR was deprecated because most
> programmers found it confusing.


They still do, but it is still allowed.


-- glen



Post a followup to this message

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