Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!mintaka!spdcc!iecc!johnl From: johnl@iecc.cambridge.ma.us (John R. Levine) Newsgroups: comp.arch Subject: Re: Segmented Architectures ( formerly Re: 48-bit computers) Message-ID: <1991Apr04.234928.8637@iecc.cambridge.ma.us> Date: 4 Apr 91 23:49:28 GMT References: <1991Apr04.023845.3501@kithrup.COM> <23615@as0c.sei.cmu.edu> <4919@lib.tmc.edu> Organization: I.E.C.C. Lines: 45 In article <4919@lib.tmc.edu> jmaynard@thesis1.med.uth.tmc.edu (Jay Maynard) writes: >> DOUBLE PRECISION BIGMAT(50000,50000) > >There's nothing that says that array elements in FORTRAN - or, for that >matter, C - have to be contiguous. Well, there is the small matter of ANSI X3.9-1978. In sections 5.2.5 and 17.1.1 it makes it pretty clear that all arrays have to be contiguous with the first subscript varying fastest. The F90 standard gives you a little wiggle room by saying that arrays that mentioned in EQUIVALENCE or COMMON statements have to be contiguous, other arrays can be implemented any way the compiler wants. Real programs tend to put their large arrays in common in which case the array above really does need a 20 gigabyte flat address space. The argument might be made that any program that does that is "wrong" but many numeric codes can easily expand to fill all available memory, particularly those that cut up a 2- or 3- dimensional space into a mesh and do something on each element in the mesh, since the finer the mesh, the more accurate the results. I have little sympathy for arguments that a 50000 x 50000 array is somehow different from a 1000 x 1000 array just because it's bigger. A segmented address space need not be a disaster for large arrays, though the much reviled Intel implementation is for two reasons: -- Segment arithmetic is very complicated due to Intel's inexplicable decision to make the low three bits of the segment number magic. -- Loading a segment register is so slow on existing implementations (on a 486, a segment load takes 6 cycles, a regular load takes 1) that you have to handle intrasegment addresses differently from intersegment in order to get reasonable performance. The RT PC and RS/6000 have a segmented address space, but the segment number is merely the high four bits of the address. If you have an array or file that is bigger than a segment (256MB in this case) you can map it into several contiguous segments without having to do anything special in your object code. Segmentation like that can be quite useful both for sharing and for protection. -- John R. Levine, IECC, POB 349, Cambridge MA 02238, +1 617 864 9650 johnl@iecc.cambridge.ma.us, {ima|spdcc|world}!iecc!johnl Cheap oil is an oxymoron.