* 64-bit Pointers and Array Indexing with 32-bit Integers
@ 1995-04-18 4:00 John Red-Horse
1995-04-19 4:00 ` Steve Lionel
0 siblings, 1 reply; 2+ messages in thread
From: John Red-Horse @ 1995-04-18 4:00 UTC (permalink / raw)
Howdy All,
We're currently in the porting stage for a Fortran-based memory management
package that I support and a curious question came to mind: How does the
Fortran compiler access array locations by integer indexing that overflow
32 bits? I have a motivation for stating the problem this way, but the
fact is not all array accesses are done via processes like DO loops
(which, I guess, one could internally convert to pointer arithmetic on the
fly). For example, I might compute the array location by doing some
integer arithmetic on an index.
thanks,
john
------
John Red-Horse jrredho@sandia.gov
Structural Dynamics & Vibration Control
Sandia National Laboratories (505)845-9190
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: 64-bit Pointers and Array Indexing with 32-bit Integers
1995-04-18 4:00 64-bit Pointers and Array Indexing with 32-bit Integers John Red-Horse
@ 1995-04-19 4:00 ` Steve Lionel
0 siblings, 0 replies; 2+ messages in thread
From: Steve Lionel @ 1995-04-19 4:00 UTC (permalink / raw)
In article <3n0tcu$t09@news.sandia.gov>, jrredho@sandia.gov (John Red-Horse)
writes:
|>We're currently in the porting stage for a Fortran-based memory management
|>package that I support and a curious question came to mind: How does the
|>Fortran compiler access array locations by integer indexing that overflow
|>32 bits? I have a motivation for stating the problem this way, but the
|>fact is not all array accesses are done via processes like DO loops
|>(which, I guess, one could internally convert to pointer arithmetic on the
|>fly). For example, I might compute the array location by doing some
|>integer arithmetic on an index.
It does the indexing calculation in 64 bits.
Probably not relevant to your specific question, but relevant in general to
64-bit array indexing, is the following excerpt from the DEC Fortran
release notes:
2.3 Static Array Offsets Must Be Smaller than 32-bit Integers -
Dynamic Offsets May Exceed 32-bit Values
There is a restriction currently in the DFAO compiler. The restriction is
that an array offset for a statically allocated array must fit in 32 bits
(signed). An "array offset" is the byte offset from the array's virtual origin.
This restriction goes along with the restriction that no addressable statically
allocated object, eg, array or COMMON block, can be bigger (in bytes) than
32-bits.
Array index calculations in DFAO V3.4 and later are done using 64-bit integer
calculations (V3.3 used 32-bit arithmetic for these calculations).
This means that you can have dynamically-allocated arrays that exceed 2**31
bytes in total size (arrays whose storage is gotten by calling malloc, for
example).
It is *not* yet possible to have statically allocated arrays this large. You
can't declare an array larger than 2**31 bytes in total size. These are *not*
supported:
INTEGER BIG_ARRAY_1D (2**30)
INTEGER BIG_ARRAY_2D (2**26, 32)
The same restriction applies to adjustable arrays. For example, this is *not*
supported:
CALL SUB (A, 2**26, 32, 10)
...
SUBROUTINE SUB (A, I, J, K)
INTEGER*8 I,J,K
REAL A (I,J,K)
This is ok:
CALL SUB (A, 2**33)
...
SUBROUTINE SUB (A, A_SIZE)
INTEGER*8 A_SIZE
REAL A (1)
--
Steve Lionel Mail: lionel@quark.enet.dec.com
DEC Fortran Development WWW: http://www.digital.com/info/slionel.html
Digital Equipment Corporation CompuServe: 75263,3001
110 Spit Brook Road, ZKO2-3/N30
Nashua, NH 03062-2698 "Free advice is worth every cent"
For a summary of Digital's Internet services, send mail to info@digital.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1995-04-19 4:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-04-18 4:00 64-bit Pointers and Array Indexing with 32-bit Integers John Red-Horse
1995-04-19 4:00 ` Steve Lionel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox