------- Comment #2 from j dot d dot pryce at ntlworld dot com 2007-11-30 12:40
-------
Subject: Re: Directed rounding doesn't work on MacOS X
Dear Pinskia
On 28 Nov 2007, at 17:08, pinskia at gcc dot gnu dot org wrote:
> ------- Comment #1 from pinskia at gcc dot gnu dot org 2007-11-28
> 17:08 -------
> I doubt that this is a gcc bug.
Consider this. Suppose I just downloaded the vanilla GCC system on to
the shiny new Mac from which I am writing. And I find everything
works fine except that whenever I use fprintf(), it crashes the
system. I report this as a bug, and I get back the comment
"I doubt that this is a gcc bug."
In a strict sense maybe not. fprintf() in GCC works fine on other
Unix-based systems. The trouble would be that GCC's communication
with the OS kernel somehow screwed up on this particular system. So
you can blame the kernel, not GCC. This is way beyond my capability
as a user to fix or even understand, so I have to rely on you experts
to fix it.
Of course as it's fprintf() that's crashing, you wouldn't say, in
effect, "It's none of my business, guvnor". You would aim to fix it
ASAP, because a C++ system without fprintf() is simply not credible.
Interval arithmetic IA is in a unique position. It *also* relies on a
basic and simple communication with the OS, namely the ability to
switch rounding mode. If you can do this, your IA software works. If
you can't, it doesn't.
When it works, it can *provably* get correct answers to problems that
are hard or even impractical by other means, e.g. see chapter 4 by
Stan Wagon in the "100 dollar, 100 digit challenge" book.
The hardware hooks to switch rounding mode are there on any IEEE754-
compliant CPU, as this one is. Languages support it: e.g. C has
fegetround/fegetround.
The trouble seems to be that the detail of how rounding mode is
handled at machine instruction level varies widely between machines.
E.g. is the mode a global flag in the floating-point unit or is it
encoded within each FP instruction? So perhaps it is tricky to make
it work on each new architecture. While making fprintf() work is
routine.
Tricky though it may be, the buck stops at you compiler writers.
Interval computation is an increasingly important mainstream
scientific computing activity. We interval folk haven't the skills to
make it work on a new machine. If you don't help us, who will?
John Pryce
[EMAIL PROTECTED]
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34261