* Floating point question
@ 1999-01-12 16:57 John Montgomery
1999-01-12 17:11 ` Adam C. Powell, IV
0 siblings, 1 reply; 12+ messages in thread
From: John Montgomery @ 1999-01-12 16:57 UTC (permalink / raw)
To: axp-list
I asked the list recently how to deal with floating point exceptions
resulting from underflows. I was advised that I could use the -miee
flag, but that my code would run slower. Subsequent experimentation has
indicated how true this is - my code now works, but runs almost 3 times
slower than under Digital Unix. So I wonder
1) Why is ieee so much slower?
2) How is this problem handled on Digital Unix?
Some of my factor of 3 is due to having used a better compiler on
Digital Unix, but probably not all of it. What else is going on?
I'll be grateful for any insights that people might have about this.
John Montgomery
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Floating point question
1999-01-12 16:57 Floating point question John Montgomery
@ 1999-01-12 17:11 ` Adam C. Powell, IV
1999-01-12 17:43 ` Greg Lindahl
1999-01-12 20:33 ` John Montgomery
0 siblings, 2 replies; 12+ messages in thread
From: Adam C. Powell, IV @ 1999-01-12 17:11 UTC (permalink / raw)
To: axp-list
John Montgomery wrote:
> I asked the list recently how to deal with floating point exceptions
> resulting from underflows. I was advised that I could use the -miee
> flag, but that my code would run slower. Subsequent experimentation has
> indicated how true this is - my code now works, but runs almost 3 times
> slower than under Digital Unix. So I wonder
>
> 1) Why is ieee so much slower?
>
> 2) How is this problem handled on Digital Unix?
>
> Some of my factor of 3 is due to having used a better compiler on
> Digital Unix, but probably not all of it. What else is going on?
> I'll be grateful for any insights that people might have about this.
Have you tried libffm? If not, the problem is definitely the math
library. The one in glibc is vastly slower than either libffm or Digital
Unix.
As I recall, your problem was underflows in exp() due to large negative
arguments. libffm returns zero by default, without -mieee.
http://people.frankfurt.netsurf.de/Joachim.Wesner/
Zeen,
-Adam `Cold Fusion' Powell, IV http://www.ctcms.nist.gov/~powell/ ____
USDoC, National Institute of Standards & Technology (NIST) |\ ||< |
Center for Theoretical and Computational Materials Science | \||_> |
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Floating point question
1999-01-12 17:11 ` Adam C. Powell, IV
@ 1999-01-12 17:43 ` Greg Lindahl
1999-01-12 20:33 ` John Montgomery
1 sibling, 0 replies; 12+ messages in thread
From: Greg Lindahl @ 1999-01-12 17:43 UTC (permalink / raw)
To: axp-list
> As I recall, your problem was underflows in exp() due to large negative
> arguments. libffm returns zero by default, without -mieee.
To expand on this answer a bit, with the latest libffm, your code
should only need -mieee on Linux if it needs the equivalent on Digital
Unix. DU Fortran and g77 use the same techniques to process
underflows, but g77 is slower on most codes in the first place.
-- g
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Floating point question
1999-01-12 17:11 ` Adam C. Powell, IV
1999-01-12 17:43 ` Greg Lindahl
@ 1999-01-12 20:33 ` John Montgomery
1999-01-12 21:10 ` Greg Lindahl
1 sibling, 1 reply; 12+ messages in thread
From: John Montgomery @ 1999-01-12 20:33 UTC (permalink / raw)
To: uunet!redhat.com!axp-list
Adam C. Powell, IV wrote:
>
> John Montgomery wrote:
>
> > I asked the list recently how to deal with floating point exceptions
> > resulting from underflows. I was advised that I could use the -miee
> > flag, but that my code would run slower. Subsequent experimentation has
> > indicated how true this is - my code now works, but runs almost 3 times
> > slower than under Digital Unix. So I wonder
> >
> > 1) Why is ieee so much slower?
> >
> > 2) How is this problem handled on Digital Unix?
> >
> > Some of my factor of 3 is due to having used a better compiler on
> > Digital Unix, but probably not all of it. What else is going on?
> > I'll be grateful for any insights that people might have about this.
>
> Have you tried libffm? If not, the problem is definitely the math
> library. The one in glibc is vastly slower than either libffm or Digital
> Unix.
Thanks, this helps a lot. A 15 min test case now takes 10 min.
John Montgomery
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Floating point question
1999-01-12 20:33 ` John Montgomery
@ 1999-01-12 21:10 ` Greg Lindahl
1999-01-12 22:03 ` John Montgomery
0 siblings, 1 reply; 12+ messages in thread
From: Greg Lindahl @ 1999-01-12 21:10 UTC (permalink / raw)
To: axp-list
> > Have you tried libffm? If not, the problem is definitely the math
> > library. The one in glibc is vastly slower than either libffm or Digital
> > Unix.
>
> Thanks, this helps a lot. A 15 min test case now takes 10 min.
Is -mieee still required?
-- g
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Floating point question
1999-01-12 21:10 ` Greg Lindahl
@ 1999-01-12 22:03 ` John Montgomery
1999-01-13 14:09 ` Heinz Ulrich Stille
0 siblings, 1 reply; 12+ messages in thread
From: John Montgomery @ 1999-01-12 22:03 UTC (permalink / raw)
To: uunet!redhat.com!axp-list
Greg Lindahl wrote:
>
> > > Have you tried libffm? If not, the problem is definitely the math
> > > library. The one in glibc is vastly slower than either libffm or Digital
> > > Unix.
> >
> > Thanks, this helps a lot. A 15 min test case now takes 10 min.
>
> Is -mieee still required?
No. I suppose therefore I could still die on FPE's not avoided in
libffm, but this hasn't happened yet.
John Montgomery
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Floating point question
1999-01-12 22:03 ` John Montgomery
@ 1999-01-13 14:09 ` Heinz Ulrich Stille
1999-01-13 14:36 ` Greg Lindahl
1999-01-13 20:47 ` Joachim Wesner
0 siblings, 2 replies; 12+ messages in thread
From: Heinz Ulrich Stille @ 1999-01-13 14:09 UTC (permalink / raw)
To: axp-list
Hi!
On Tue, 12 Jan 1999, John Montgomery wrote:
>> Is -mieee still required?
>
>No. I suppose therefore I could still die on FPE's not avoided in
In general, it still is. libffm does not catch everything, like simple
arithmetic. E.g. povray does not work without -mieee even with libffm.
At least you would have to trap and handle the remaining FPEs. IIRC the kernel
doesn't allow blocking, and the man page of sigaction says: "According to POSIX,
the behaviour of a process is undefined after it ignores a SIGFPE, SIGILL, or
SIGSEGV signal that was not generated by the kill() or the raise() functions."
MfG, Ulrich
--
The past nodded and smiled at him, and strolled on, into the future.
T. Pratchett, "Men at Arms"
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: Floating point question
1999-01-13 14:09 ` Heinz Ulrich Stille
@ 1999-01-13 14:36 ` Greg Lindahl
1999-01-13 20:47 ` Joachim Wesner
1 sibling, 0 replies; 12+ messages in thread
From: Greg Lindahl @ 1999-01-13 14:36 UTC (permalink / raw)
To: axp-list
> >> Is -mieee still required?
> >
> >No. I suppose therefore I could still die on FPE's not avoided in
>
> In general, it still is. libffm does not catch everything, like simple
> arithmetic.
But in this specific case, he knows that the program runs under
Digital Unix without -ieee and without any FPEs. So it is correct that
it should also run under egcs without -mieee and without any FPEs.
-- g
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Floating point question
1999-01-13 14:09 ` Heinz Ulrich Stille
1999-01-13 14:36 ` Greg Lindahl
@ 1999-01-13 20:47 ` Joachim Wesner
1999-01-13 21:01 ` Greg Lindahl
1999-01-15 15:01 ` Floating point question Heinz Ulrich Stille
1 sibling, 2 replies; 12+ messages in thread
From: Joachim Wesner @ 1999-01-13 20:47 UTC (permalink / raw)
To: axp-list
On Wed, 13 Jan 1999, Heinz Ulrich Stille wrote:
>Hi!
>
>On Tue, 12 Jan 1999, John Montgomery wrote:
>>> Is -mieee still required?
>>
>>No. I suppose therefore I could still die on FPE's not avoided in
>
>In general, it still is. libffm does not catch everything, like simple
>arithmetic. E.g. povray does not work without -mieee even with libffm.
>
Interesting, DEFINITELY it SHOULD not happen an mo'. I hope I find some time
the next week(s) to try building povray on my system and see how this still
happens. Is there probably a simpler example for this behaviour ??
Joachim Wesner (One of the authors of libffm)
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Floating point question
1999-01-13 20:47 ` Joachim Wesner
@ 1999-01-13 21:01 ` Greg Lindahl
1999-01-14 12:31 ` 32 bit pointers Uncle George
1999-01-15 15:01 ` Floating point question Heinz Ulrich Stille
1 sibling, 1 reply; 12+ messages in thread
From: Greg Lindahl @ 1999-01-13 21:01 UTC (permalink / raw)
To: axp-list
> >In general, it still is. libffm does not catch everything, like simple
> >arithmetic. E.g. povray does not work without -mieee even with libffm.
>
> Interesting, DEFINITELY it SHOULD not happen an mo'. I hope I find some time
> the next week(s) to try building povray on my system and see how this still
> happens. Is there probably a simpler example for this behaviour ??
I thought povray simply used things like NaN and Inf in its
computations? In that case, we're simply screwed.
-- g
^ permalink raw reply [flat|nested] 12+ messages in thread
* 32 bit pointers
1999-01-13 21:01 ` Greg Lindahl
@ 1999-01-14 12:31 ` Uncle George
0 siblings, 0 replies; 12+ messages in thread
From: Uncle George @ 1999-01-14 12:31 UTC (permalink / raw)
To: axp-list
If i could get all the sources i need COULD I on the alpha:
1) malloc everything in the lower 4 gig memory region
a) .TEXT = anywhere in memory
b) .DATA = lower 4 gigs ( even though not modifiable, but can be
pointed to
c) .BSS = lower 4 gigs
2) THEN use 32 bit pointers ( the upper 32 bits = 0x0, and doesn't need
to be otherwise)
3) WHAT would be the gcc/egcc compile time switches to do this ( black )
majic ?
BTW: where can i get a definitive list of features/pragma's for
gcc/egcs.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Floating point question
1999-01-13 20:47 ` Joachim Wesner
1999-01-13 21:01 ` Greg Lindahl
@ 1999-01-15 15:01 ` Heinz Ulrich Stille
1 sibling, 0 replies; 12+ messages in thread
From: Heinz Ulrich Stille @ 1999-01-15 15:01 UTC (permalink / raw)
To: axp-list
On Wed, 13 Jan 1999, Joachim Wesner wrote:
>Interesting, DEFINITELY it SHOULD not happen an mo'. I hope I find some time
>the next week(s) to try building povray on my system and see how this still
>happens. Is there probably a simpler example for this behaviour ??
I don't know of any. At the moment I'm also unable to construct one, as I did not
(yet) track down the problem in povray. I just unpacked the scenes from povdemo
and tried to render them all, got a FPE and recompiled with -mieee (because I
needed a reliable version and didn't have enough time).
MfG, Ulrich
--
No-one knows why smoking boots always remain, no matter how big the explosion.
It seems to be just one of those things.
T. Pratchett, "Sourcery"
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~1999-01-15 15:36 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-01-12 16:57 Floating point question John Montgomery
1999-01-12 17:11 ` Adam C. Powell, IV
1999-01-12 17:43 ` Greg Lindahl
1999-01-12 20:33 ` John Montgomery
1999-01-12 21:10 ` Greg Lindahl
1999-01-12 22:03 ` John Montgomery
1999-01-13 14:09 ` Heinz Ulrich Stille
1999-01-13 14:36 ` Greg Lindahl
1999-01-13 20:47 ` Joachim Wesner
1999-01-13 21:01 ` Greg Lindahl
1999-01-14 12:31 ` 32 bit pointers Uncle George
1999-01-15 15:01 ` Floating point question Heinz Ulrich Stille
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox