revap types, step 1
Steve Kargl
sgk@troutmask.apl.washington.edu
Thu Aug 26 21:05:00 GMT 2004
On Thu, Aug 26, 2004 at 01:06:30PM -0700, Richard Henderson wrote:
> On Thu, Aug 26, 2004 at 11:06:04AM -0700, Steve Kargl wrote:
>
> > Incidently, the behavior of the -r8 option is outside the scope
> > of the Fortran standard. It typically means that all REAL variables
> > are promoted to DOUBLE PRECISION. It does not necessarily
> > include the promotion of all DOUBLE PRECISION variables to
> > a QUAD precision.
>
> Really? In which case maybe we don't have to do anything.
> With no special options, GCC does not currently support a
> target that doesn't have both a 1 word and a 2 word float.
>
> I can certainly change the patch such that DOUBLE PRECISION
> doesn't adjust based on -r8. I'm not a Fortran user though,
> so someone will have to tell me what's most useful.
>
I'll defer to Paul and Toon. AFAICT, g77 does not have an
option equivalent to -r8, so this isn't a compatibility issue.
Here's the man page entries for f2c and NAG's F95 compiler.
f2c
-r8 Promote REAL to DOUBLE PRECISION, COMPLEX to DOUBLE
COMPLEX.
NAG
-r8 Double the size of default REAL/COMPLEX, and on machines for
which quadruple-precision REAL/COMPLEX are available, double
the size of DOUBLE PRECISION. REAL/COMPLEX specified with
explicit KIND numbers or byte lengths are unaffected - but
since the KIND intrinsic returns the correct values, COM-
PLEX(KIND(0d0)) on a machine with quad-precision floating-
point will correctly select quad-precision COMPLEX.
So, if a target supports QUAD, then I think we should promote
DOUBLE PRECISION to QUAD. If a target does not support QUAD,
then we ignore promotion of DOUBLE PRECISION.
--
Steve
More information about the Fortran
mailing list