Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Re: floating exception
@ 1998-01-13 16:03 David Gilbert
  1998-01-13 17:18 ` Jerry Feldman
  0 siblings, 1 reply; 13+ messages in thread
From: David Gilbert @ 1998-01-13 16:03 UTC (permalink / raw)


> What does -mieee do? Does it contain a library of exception handlers or does it
	> turn the
	> exceptions off. (I would kind of expect the kernel to handle denormals, although
	> NaN's and Infinities
	> I can imagine the user getting).
	Specifically, this tells the compiler to generate floating
	point instructions with the /s (software completion) option.
	(eg. multsu $f10, $f11, $f12 # multiply registers $f10 by $f11
	(t-floating format) with software completion, underflow
	enabled). If either input contains an invalid value (denormal,
	NaN, ...) or the result underfloaws or is invalid, generate a
	trap. The kernel should contain the appropriate code to perform
	the fixup. (Note: I am not 100% sure of Linux. I am responsible
	for the Digital Unix kernel floating point completion).

So what happens without -mieee? He is seeing traps without -mieee.

Dave

-- 
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

^ permalink raw reply	[flat|nested] 13+ messages in thread
[parent not found: <Pine.SOL.3.91.980114105358.14105A-100000@greco2>]
[parent not found: <199801132242.PAA03608@ellpspace.math.ualberta.ca>]
[parent not found: <199801132125.WAA03288@stefan.sime.com>]
* Re: floating exception
@ 1998-01-13 21:25 Stefan Traby
  0 siblings, 0 replies; 13+ messages in thread
From: Stefan Traby @ 1998-01-13 21:25 UTC (permalink / raw)


> dg@cogency.co.uk (David Gilbert) wrote:
> > So what happens without -mieee? He is seeing traps without -mieee.
> If you do not compile with -mieee, application will receive a SIGFPE 
> exception, and crash if the signal is not handled, in the case of NaNs, 
> Infinities, and denormals.

oups, hmm, ok, you agree with me that the following is heavy outdated ?

--------------
   This is Edition 0.06, last updated 23 December 1994, of `The GNU C
Library Reference Manual', for Version 1.09 Beta of the GNU C Library.
--------------

--------------
   None of the mathematical functions ever generates signals as a
result of domain or range errors.  In particular, this means that you
won't see `SIGFPE' signals generated within these functions.  (*Note
Signal Handling::, for more information about signals.)
--------------

What means this good old text: None of the ANS-C fp-funcs (in libc) use
if(NAN != NAN) raise(SIGFPE); internally,
but the kernel may raise real fpu-exception by sending SIGFPE ?? 

I interpret this as: If you use glibc ANS-C fp-funcs only (not asm-inline), 
installing an SIGFPE handler is a paranoid action.

I think this info-file is only outdated and obsolete.
I don't have an AXP nor I wrote fp-code over the last three years...

gcc handles NAN well under i387+ because FPU-exceptions on an intel
can be masked. I don't know it, but your posting makes me think
that masking is not possible on AXP, so this info-file is simply
outdated because it depends on FPUs where exceptions may be masked.
Is this assumption correct ?
If it's correct  than "-mieee" means libm installs a SIGFPE handler itself and
fakes errno, but without "-mieee", SIGFPE is passed to the app ?
I'm in panic for now. If SIGFPE cannot be avoided at all
(ok, it can, SIG_IGN, -mieee), fp-pthreads programming must be near to hell.)
At moment, I know nothing but I'm heavy confused. :-(
In my "dream word" SIGFPE doesn't exists.
Give me some light, please.

-- 
  ciao - 
    Stefan

Stefan Traby                            phone:  +43-3133-6107-2
Mitterlasznitzstr. 13                     fax:  +43-3133-6107-9
8302 Nestelbach                        mailto://stefan@sime.com
Austria

-- 
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

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: floating exception
@ 1998-01-13 20:11 Richard Hadsell
  0 siblings, 0 replies; 13+ messages in thread
From: Richard Hadsell @ 1998-01-13 20:11 UTC (permalink / raw)


David Gilbert wrote:
> 
>         > What does -mieee do? Does it contain a library of exception handlers or does it
>         > turn the
>         > exceptions off. (I would kind of expect the kernel to handle denormals, although
>         > NaN's and Infinities
>         > I can imagine the user getting).
>         Specifically, this tells the compiler to generate floating
>         point instructions with the /s (software completion) option.
>         (eg. multsu $f10, $f11, $f12 # multiply registers $f10 by $f11
>         (t-floating format) with software completion, underflow
>         enabled). If either input contains an invalid value (denormal,
>         NaN, ...) or the result underfloaws or is invalid, generate a
>         trap. The kernel should contain the appropriate code to perform
>         the fixup. (Note: I am not 100% sure of Linux. I am responsible
>         for the Digital Unix kernel floating point completion).
> 
> So what happens without -mieee? He is seeing traps without -mieee.

The point is that -mieee allows code to gracefully handle NaNs and
denormalized numbers.  Without it, the floating-point exception handler
cannot produce a reasonable result and let the program continue.  A
reasonable result would be a NaN if one of the operands is a NaN, and it
would probably be a 0 if a denormalized number is multiplied by
something.

You might have noticed that -mieee implies some other options which
increase the granularity of exception context information to the
instruction level.  I don't know what other effects it has on the actual
generated code.

-- 
Dick Hadsell			914-381-8400  Fax: 914-381-9790
Reply-to:			hadsell@blueskystudios.com
Blue Sky | VIFX			http://www.blueskystudios.com
1 South Road, Harrison, NY 10528

-- 
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

^ permalink raw reply	[flat|nested] 13+ messages in thread
[parent not found: <34BB6FB0.1092A7A0@cogency.co.uk>]
* Re: floating exception
@ 1998-01-13 15:09 Richard Hadsell
  0 siblings, 0 replies; 13+ messages in thread
From: Richard Hadsell @ 1998-01-13 15:09 UTC (permalink / raw)


Alessandro Mirone wrote:
> 
> Hi people,
> 
>   I get "floating exceptions" (and core dump) from some programs
> that gave NaN when compiled on a PC-Linux.
>  Could someone give me somt tips about how
> to deal with it?  a solution of course would be checking the
> values before doing mathematical operations.
>  But apart that could I use some compilation switch to get NaN
> and avoid crashing the programs?
> Any help is appreciated
> bye

Have you tried compiling with "-mieee"?  It worked for me, for similar
problems.  If your program fails to compile because of an internal
compiler error, you may have to reduce the optimization level.  But it
probably won't -- I'm running on an alpha.

-- 
Dick Hadsell			914-381-8400  Fax: 914-381-9790
Reply-to:			hadsell@blueskystudios.com
Blue Sky | VIFX			http://www.blueskystudios.com
1 South Road, Harrison, NY 10528

-- 
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

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: floating exception
@ 1998-01-13 13:44 David Alan Gilbert
  0 siblings, 0 replies; 13+ messages in thread
From: David Alan Gilbert @ 1998-01-13 13:44 UTC (permalink / raw)


Jerry Feldman wrote:

> You must compile with ieee. The Alpha chips generate an exception on several conditions such as NaN,
> Infinities, denormals. These must be handled in an exception handler. Use the -mieee when compiling with GCC.

What does -mieee do? Does it contain a library of exception handlers or does it
turn the
exceptions off. (I would kind of expect the kernel to handle denormals, although
NaN's and Infinities
I can imagine the user getting).

Dave

-- 
----------------------------------------------------------------------
- Dr. David Alan Gilbert - WARNING! This is a beta release .signature-
- Work:    dg @ cogency.co.uk        -    0161-428-9444              -
- Home:    gro.gilbert @ treblig.org -                               -
----------------------------------------------------------------------

-- 
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

^ permalink raw reply	[flat|nested] 13+ messages in thread
[parent not found: <Pine.SOL.3.91.980113105530.27582E-100000@greco2>]
* floating exception
@ 1998-01-13 11:00 Alessandro Mirone
  0 siblings, 0 replies; 13+ messages in thread
From: Alessandro Mirone @ 1998-01-13 11:00 UTC (permalink / raw)


Hi people,
  
  I get "floating exceptions" (and core dump) from some programs
that gave NaN when compiled on a PC-Linux.
 Could someone give me somt tips about how
to deal with it?  a solution of course would be checking the 
values before doing mathematical operations.
 But apart that could I use some compilation switch to get NaN
and avoid crashing the programs?
Any help is appreciated
bye 

Alessandro MIRONE
LULI, 91128  Ecole Polytechnique, Palaiseau
alex@greco2.polytechnique.fr
tel: (33) (1) 64468029
Tel cellulaire : 0681643779 

-- 
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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~1998-01-14 16:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-01-13 16:03 floating exception David Gilbert
1998-01-13 17:18 ` Jerry Feldman
     [not found] <Pine.SOL.3.91.980114105358.14105A-100000@greco2>
1998-01-14 16:00 ` Michal Jaegermann
     [not found] <199801132242.PAA03608@ellpspace.math.ualberta.ca>
1998-01-14  9:58 ` Alessandro Mirone
     [not found] <199801132125.WAA03288@stefan.sime.com>
1998-01-13 22:42 ` Michal Jaegermann
1998-01-14 13:29 ` Jerry Feldman
  -- strict thread matches above, loose matches on Subject: below --
1998-01-13 21:25 Stefan Traby
1998-01-13 20:11 Richard Hadsell
     [not found] <34BB6FB0.1092A7A0@cogency.co.uk>
1998-01-13 15:24 ` Jerry Feldman
1998-01-13 15:09 Richard Hadsell
1998-01-13 13:44 David Alan Gilbert
     [not found] <Pine.SOL.3.91.980113105530.27582E-100000@greco2>
1998-01-13 13:25 ` Jerry Feldman
1998-01-13 11:00 Alessandro Mirone

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox