For Programmers: Free Programming Magazines  


Home > Archive > Compilers > October 2007 > Re: Unpopular parameter passing mechanisms and parallelisation (was Re: sequential bi









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Unpopular parameter passing mechanisms and parallelisation (was Re: sequential bi
glen herrmannsfeldt

2007-10-31, 7:20 pm

George Neuner wrote:

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


(snip)

:[color=darkred]
> <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.


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.
[color=darkred]
> 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

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com