From: Michal Jaegermann <michal@ellpspace.math.ualberta.ca>
Subject: Re: Ieee on linux/alpha
Date: Tue, 9 Dec 1997 09:48:01 -0700 (MST) [thread overview]
Message-ID: <1b40a3408188fda232a0e1adeef11489.axp-list@archive.invalid> (raw)
In-Reply-To: <m2hg8i4zyh.fsf@blinky.bfr.co.il>
>
>
> It seems that linux/alpha's default behavior is to signal a SIGFPE on
> divide by zero, whereas linux/intel's default behavior is to work with
> NANs, INFs & MINFs.
>
> What's the appropriate way to switch between these two behaviors? Is
> it just a matter of adding -lieee on the link line?
-mieee, you mean.
This is not really documented anywhere, AFAIK, but this is what I got
experimentally from my recent fun-and-games with a program which
required that. Comments in /usr/include/asm/fpu.h mention a function
ieee_set_fp_control(). This is really an interface to osf_setuserinfo(),
provided by 'alpha' part of kernel sources, which affects floating
point unit controls.
There are actually two such functions and they seem to have prototypes
like that
void ieee_set_fp_control(unsigned long);
unsigned long ieee_get_fp_control(void);
although they are missing from headers. One would have to dig through
libraries sources to find that out for sure.
Constants to use with these functions are defined in mentioned above
/usr/include/asm/fpu.h header file and a default state is given by
IEEE_TRAP_ENABLE_MASK (all traps on). Switching to something else
affects only the current process (thread?). This does not seem to
have any real effect unless -mieee compiler switch is in force.
If anybody has more or better information, code examples (using
osf_userinfo() directly to affect other FPU flags?), corrections, etc.,
I am all ears.
> What performance
> hits/benefits should I expect from doing this?
No idea. Benchmark it on your codes. In my case the difference was
between running and not running at all so benefits were infinite. :-)
The fact that something was silently overflowing or underflowing was
immaterial in this particular case. In general I am a bit suspicious
about bridges constructed with a help of programs behaving that way. :-)
Michal
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
next prev parent reply other threads:[~1997-12-09 16:48 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <m2hg8i4zyh.fsf@blinky.bfr.co.il>
1997-12-09 11:15 ` Ieee on linux/alpha Richard Henderson
1997-12-09 16:48 ` Michal Jaegermann [this message]
1997-12-12 11:35 Uncle George
[not found] <349105D1.76A0AEC6@voicenet.com>
1997-12-12 9:40 ` Richard Henderson
-- strict thread matches above, loose matches on Subject: below --
1997-12-12 9:37 Uncle George
[not found] <348FA853.CDEE65B7@voicenet.com>
1997-12-11 17:33 ` Richard Henderson
1997-12-11 8:46 Uncle George
1997-12-11 0:59 Uncle George
[not found] <m2n2i99tgs.fsf@blinky.bfr.co.il>
1997-12-10 17:54 ` Jerry Feldman
1997-12-10 16:42 khan
1997-12-10 15:57 Harvey J. Stein
1997-12-10 14:24 Uncle George
1997-12-10 14:17 Uncle George
1997-12-10 14:13 Harvey J. Stein
1997-12-10 14:07 Uncle George
1997-12-10 10:09 Harvey J. Stein
[not found] <m27m9e4sou.fsf@blinky.bfr.co.il>
1997-12-09 17:02 ` Michal Jaegermann
1997-12-09 17:52 ` Richard Henderson
1997-12-09 12:17 Harvey J. Stein
1997-12-09 9:40 Harvey J. Stein
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox