Re: Weird problem on Lahey lf95 v6.2b
From: glen herrmannsfeldt (gah_at_ugcs.caltech.edu)
Date: 06/07/04
- Next message: Dick Hendrickson: "Re: Nesting of internal subroutines"
- Previous message: glen herrmannsfeldt: "Re: sin/sind"
- In reply to: Richard Maine: "Re: Weird problem on Lahey lf95 v6.2b"
- Next in thread: Rich Townsend: "Re: Weird problem on Lahey lf95 v6.2b"
- Reply: Rich Townsend: "Re: Weird problem on Lahey lf95 v6.2b"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 07 Jun 2004 19:28:31 GMT
Richard Maine wrote:
> Rich Townsend <rhdt@barVOIDtol.udel.edu> writes:
>>Can anyone suggest what is happening here? My initial guess is that
>>b(i_b) is being held in an extended-precision register in the first
>>print statement, but in the second and third has been truncated down
>>to a real. But why is this happening?
> Seems like a likely explanation. The I/O will presumably involve plenty
> of register usage - enough to flush most anything. The initial
> subtraction is likely done before the I/O process "gets going"
> enough to flush the registers.
There are two different problems to consider. One is the
use of extended precision for intermediate results, the other
is the possible use of double precision for single precision
results.
The x87 processor has the ability to truncate the fraction
to reduce precision, but it isn't easy or convenient to change
those flags in the middle of expressions.
>>Surely, the compiler is required
>>to perform the truncation on the register b(i_b) when it is referenced
>>in the first statement,
> That's actually a point of some controversy, which I might
> summarize as saying that surely it is not that sure. :-)
(big snip)
It has been suggested that a C implementation that returned
42 for all floating point operations would be standard conforming,
though certainly a low quality implementation. It might be
that Fortran isn't that loose on its floating point.
As many people want speed in Fortran programs, and doing the
truncation may require store/load (hopefully through cache),
one can see that it might not be very fast.
I started a discussion some time ago on the result of
single precision multiply, which many processors generate
a double precision result for, and the code may or may
not truncate it.
-- glen
- Next message: Dick Hendrickson: "Re: Nesting of internal subroutines"
- Previous message: glen herrmannsfeldt: "Re: sin/sind"
- In reply to: Richard Maine: "Re: Weird problem on Lahey lf95 v6.2b"
- Next in thread: Rich Townsend: "Re: Weird problem on Lahey lf95 v6.2b"
- Reply: Rich Townsend: "Re: Weird problem on Lahey lf95 v6.2b"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|