Prev: Problem with automatic reallocation of allocatable scalar on assignment
Next: a wiki entry for gfortran
From: Ron Shepard on 9 Aug 2010 11:17 In article <i3obbu$iim$1(a)gosset.csi.cam.ac.uk>, nmm(a)gosset.csi.cam.ac.uk (Nick Maclaren) wrote: > For S/360 (and > >successors) it takes one instruction to reference a local variable, > >but two to reference a variable by reference. Are you comparing a local scalar to a dummy array element? If you compare apples to apples, or arrays to arrays, then after you have the two base addresses for the local and dummy arrays, what is the difference in the instructions used to access elements? If you are processing the elements in natural array order, what is the difference in local and dummy array access? $.02 -Ron Shepard
From: Nick Maclaren on 9 Aug 2010 11:40 In article <ron-shepard-33B1B2.10173109082010(a)forte.easynews.com>, Ron Shepard <ron-shepard(a)NOSPAM.comcast.net> wrote: > >> For S/360 (and >> >successors) it takes one instruction to reference a local variable, >> >but two to reference a variable by reference. > >Are you comparing a local scalar to a dummy array element? If you >compare apples to apples, or arrays to arrays, then after you have >the two base addresses for the local and dummy arrays, what is the >difference in the instructions used to access elements? If you are >processing the elements in natural array order, what is the >difference in local and dummy array access? Firstly, I didn't post that - Glen did. Secondly, the reason is that local scalars could be accessed by an offset from the instruction base register, but scalars passed as arguments have to be accessed by loading the argument, and then accessing the value. Regards, Nick Maclaren.
From: glen herrmannsfeldt on 9 Aug 2010 12:00 Ron Shepard <ron-shepard(a)nospam.comcast.net> wrote: > In article <i3obbu$iim$1(a)gosset.csi.cam.ac.uk>, > nmm(a)gosset.csi.cam.ac.uk (Nick Maclaren) wrote: >> For S/360 (and >> >successors) it takes one instruction to reference a local variable, >> >but two to reference a variable by reference. > Are you comparing a local scalar to a dummy array element? No, local scalar, or local copy of dummy scalar, to a call by reference (address of) an argument. > If you > compare apples to apples, or arrays to arrays, then after you have > the two base addresses for the local and dummy arrays, what is the > difference in the instructions used to access elements? S/360 and S/370 Fortran compilers, I believe including VS Fortran, pass scalars by value result. A copy is made to a local variable (three instructions) and copy back just before return (three instructions). Arrays are by reference (copy the address, two instructions). > If you are > processing the elements in natural array order, what is the > difference in local and dummy array access? For small arrays that can be accessed through the same base register as used for code and scalars, only enough to compute the offset. Larger arrays use an address constant, so the same number of instructions as a dummy array reference. At some point it depends on how many registers are available. One base register for each COMMON block. -- glen
From: Terence on 9 Aug 2010 18:14 Well, I have now an non-error report producing F77 compilable version, with DO-loop indentation for readability, and which includes all the input and output file creation required for non-JCL mainframe execution with 20 work files ("tapes"), and the orignal source and data. However, I suspect the algorithm needs more that 64K bytes in the array it carves up into sub variables. The original source seem to request 40960 floating point words which are used three different times in three different carvings. So I will now hand it over; I think it will need re-writing as F90 to get dynamic assignments of memory. But that will be someone else's thesis.
From: mecej4 on 9 Aug 2010 20:03
Terence wrote: > Well, I have now an non-error report producing F77 compilable version, > with DO-loop indentation for readability, and which includes all the > input and output file creation required for non-JCL mainframe > execution with 20 work files ("tapes"), and the orignal source and > data. > However, I suspect the algorithm needs more that 64K bytes in the > array it carves up into sub variables. The original source seem to > request 40960 floating point words which are used three different > times in three different carvings. I believe that the compiler you used (MS Fortran 3.x) had a $LARGE metacommand to allow the use of arrays that occupied > 64K bytes. However, if your three arrays need to _coexist_, you need 983K bytes; adding in the needs of OS, BIOS and code, that will overflow the 20-bit address limits of 16 bit mode. -- mecej4 |