|
|
Up |
|
|
  |
Author: braamsbraams Date: Jun 15, 2008 16:40
In connection with my effort to implement Kahan summation in a manner
that is robust against the treatments of optimizing compilers I just
posted a request for interpretation to the J3 committee web server.
The request is attached FYI. --Bas Braams
To: J3 08-208
From: Bas Braams
Subject: Interpretation, precise f.p. semantics of the REAL intrinsic
Date: 2008 June 15
REQUEST FOR INTERPRETATION:
Must the intrinsic function REAL with KIND parameter wp return a value
that is a REAL (KIND=wp) floating point number?
RATIONALE FOR THE QUESTION:
|
| Show full article (1.79Kb) |
|
| | 9 Comments |
|
  |
Author: Steven G. KarglSteven G. Kargl Date: Jun 15, 2008 17:35
In article w7g2000hsa.googlegroups.com>,
"braams@mathcs.emory.edu" mathcs.emory.edu> writes:
> In connection with my effort to implement Kahan summation in a manner
> that is robust against the treatments of optimizing compilers I just
> posted a request for interpretation to the J3 committee web server.
> The request is attached FYI. --Bas Braams
>
> To: J3 08-208
> From: Bas Braams
> Subject: Interpretation, precise f.p. semantics of the REAL intrinsic
> Date: 2008 June 15
>
> REQUEST FOR INTERPRETATION:
>
> Must the intrinsic function REAL with KIND parameter wp return a value
> that is a REAL (KIND=wp) floating point number?
I think the Fortran 95 standard already answers this question:
13.14 Specifications of the intrinsic procedures
|
| Show full article (1.48Kb) |
|
| | no comments |
|
  |
Author: nospamnospam Date: Jun 15, 2008 17:52
> In connection with my effort to implement Kahan summation in a manner
> that is robust against the treatments of optimizing compilers I just
> posted a request for interpretation to the J3 committee web server.
...
> Must the intrinsic function REAL with KIND parameter wp return a value
> that is a REAL (KIND=wp) floating point number?
Did you check the existing interprations first? This sounds like almost
a word-for-word copy of one that I recall Van Snyder submitting a few
years ago.
I don't think I'll jump into the middle of that debate. (Added later -
Looks like I did after all, but anyway, I won't argue about it). I seem
to recall the one on Van's interp being fairly heated. But I'll note a
few things.
1. Part of what strikes me as so simillar to Van's request is that you
haven't really phrased the question in a way that a direct answer will
be very useful. Of course it returns a real(kind=wp) floating...
|
| Show full article (5.35Kb) |
| no comments |
|
  |
Author: glen herrmannsfeldtglen herrmannsfeldt Date: Jun 15, 2008 21:01
> RATIONALE FOR THE QUESTION:
> Computer hardware may use a wider floating-point format for registers
> than for memory; e.g., 80 bits for registers and 64 bits for memory
> for the case of standard double precision floating point numbers.
> Some algorithms require a high level of control over floating point
> semantics. If the intrinsic function REAL with KIND parameter wp is
> guaranteed to return a REAL (KIND=wp) result then a programmer can use
> this to force intermediate results into main memory format, never mind
> that the optimizing compiler may have placed the intermediate in a
> register.
For x87, I believe the only way to force memory format is to
actually write to memory. (Hopefully to cache.) That is slow
enough that compilers try to avoid doing it.
|
| Show full article (1.48Kb) |
| no comments |
|
  |
Author: James GilesJames Giles Date: Jun 15, 2008 22:37
glen herrmannsfeldt wrote:
>> RATIONALE FOR THE QUESTION:
>
>> Computer hardware may use a wider floating-point format for registers
>> than for memory; e.g., 80 bits for registers and 64 bits for memory
>> for the case of standard double precision floating point numbers.
>> Some algorithms require a high level of control over floating point
>> semantics. If the intrinsic function REAL with KIND parameter wp is
>> guaranteed to return a REAL (KIND=wp) result then a programmer can
>> use this to force intermediate results into main memory format,
>> never mind that the optimizing compiler may have placed the
>> intermediate in a register.
>
> For x87, I believe the only way to force memory format is to
> actually write to memory. (Hopefully to cache...
|
| Show full article (1.86Kb) |
| no comments |
|
  |
Author: Charles ColdwellCharles Coldwell Date: Jun 16, 2008 04:23
glen herrmannsfeldt ugcs.caltech.edu> writes:
>
> For x87, I believe the only way to force memory format is to
> actually write to memory. (Hopefully to cache.) That is slow
> enough that compilers try to avoid doing it.
No, you can instruct the co-processor to use 64-bit double precision
with this (GNU/Linux platform):
#include
void set_double_(void)
{
unsigned short cw;
_FPU_GETCW(cw);
cw &= ~0x300;
cw |= _FPU_DOUBLE;
_FPU_SETCW(cw);
}
Then
external set_double
call set_double()
|
| Show full article (0.72Kb) |
| no comments |
|
  |
Author: glen herrmannsfeldtglen herrmannsfeldt Date: Jun 16, 2008 05:15
Charles Coldwell wrote:
> glen herrmannsfeldt ugcs.caltech.edu> writes:
>>For x87, I believe the only way to force memory format is to
>>actually write to memory. (Hopefully to cache.) That is slow
>>enough that compilers try to avoid doing it.
> No, you can instruct the co-processor to use 64-bit double precision
You can, but:
It doesn't reduce the exponent range to the double memory format.
It doesn't apply to all operations.
Also, even without those two, does it give the same
result in all cases? (Maybe, but can you be sure?)
-- glen
|
| |
| no comments |
|
  |
Author: Arjen MarkusArjen Markus Date: Jun 16, 2008 04:59
> In connection with my effort to implement Kahan summation in a manner
> that is robust against the treatments of optimizing compilers I just
> posted a request for interpretation to the J3 committee web server.
> The request is attached FYI. --Bas Braams
>
> To: J3 08-208
> From: Bas Braams
> Subject: Interpretation, precise f.p. semantics of the REAL intrinsic
> Date: 2008 June 15
>
> REQUEST FOR INTERPRETATION:
>
> Must the intrinsic function REAL with KIND parameter wp return a value
> that is a REAL (KIND=wp) floating point number?
>
> RATIONALE FOR THE QUESTION:
>
> Computer hardware may use a wider floating-point format for registers ...
|
| Show full article (2.42Kb) |
| no comments |
|
  |
Author: braamsbraams Date: Jun 16, 2008 08:04
Richard,
Thank you for your detailed comments. Right now I am going to skip
over
much of what you wrote and address just two things. Recall my
question:
> Must the intrinsic function REAL with KIND parameter wp return a value
> that is a REAL (KIND=wp) floating point number?
I tried to be concise. You wrote
> Of course it returns a real(kind=wp) floating point number. It is hard
> to imagine how the standard could be much more explicit about that than
> it already is; and it is hard to imagine how an interp answer could be
> any more explicit either.
Let's be a bit more careful then and formulate the question exactly
how
it is meant. (Except, I'm afraid I'm using the Adams et al. Fortran
95
Handbook as my reference, not the full 2003 Standard.) Associated...
|
| Show full article (2.82Kb) |
| no comments |
|
  |
|
|
  |
Author: Charles ColdwellCharles Coldwell Date: Jun 18, 2008 04:49
glen herrmannsfeldt ugcs.caltech.edu> writes:
>> RATIONALE FOR THE QUESTION:
>
>> Computer hardware may use a wider floating-point format for registers
>> than for memory; e.g., 80 bits for registers and...
|
| Show full article (1.78Kb) |
| no comments |
|
|