🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #20699

Re: Unaligned data and old FORTRAN

#20699
From: Steve Correll
Date: Sat, 08 Apr 1989 02:36
31 lines
1805 bytes
In article <13998@sequent.UUCP>, jjb@sequent.UUCP (Jeff Berkowitz) writes:
> Does the F77 validation suite actually force oddly aligned access and expect
> them to work?  Is there a qualified F77 for the RT PC?

The copy of the US Government validation suite which I have does not require
misaligned access, but it could legally do so. Consider the following program:

     common /x/ i, d, j
     integer i, j, ia(4)
     doubleprecision d
     equivalence (ia(1), i), (ia(4), j)
     ... 
     end

Fortunately for current RISCs, the only legal kind of misalignment in Fortran
77 puts a doubleword on a singleword boundary, and processors with 32-bit
busses tend not to notice that. From what I've seen so far, Fortran 8X does not
change this.

(Three rules in the 77 standard prevent other kinds of misalignment:
   1. There are only three "sizes" of data: character, integer/logical/real,
     and doubleprecision/complex.
   2. An equivalence or common block may not mix character data with
     non-character data.
   3. Doubleprecision/complex must be twice the size of integer/logical/real.)

In practice, of course, Fortran programs from CISC machines pose additional
kinds of misalignment--e.g. a doubleword on a halfword boundary--but these all
involve either extensions to or violations of the standard.
-- 
...{sun,pyramid}!pacbell!key!sjc 				Steve Correll
Technical Details
Message-ID: <747@key.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sgi!key!sjc
References: <13998@sequent.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sgi!key!sjc
From: sjc@key.COM (Steve Correll)
Newsgroups: comp.arch
Subject: Re: Unaligned data and old FORTRAN
Keywords: RISC alignment FORTRAN validation suite
Message-ID: <747@key.COM>
Date: 8 Apr 89 02:36:49 GMT
References: <13998@sequent.UUCP>
Organization: Key Computer Labs, Fremont, CA
Lines: 31