Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Randy Chapman <chapman@shell.ncm.com>
Subject: Re: SIGFPE
Date: Thu, 10 Apr 1997 14:04:10 -0400	[thread overview]
Message-ID: <199704101804.OAA13497@shell.ncm.com> (raw)

In article <334D10D4.6CF5A78@jrp.tiac.net> you wrote:
: When you specify the "-mieee" flag to gcc, it generates recoverable
: code.  The recovery code itself is in the kernel
: (arch/alpha/math-emu/fp-emul.c if you want to check it out).  If 
: everything is working right, then the SIGFPE presented to the user
: contains the CPU state at the point where the exception occurred.

Whats this do to fp performance ?  If needed, I can actually check
before the operation is done for divide-by-zero and pass to some
other code for that case, but I was also hoping to avoid that extra
compare.  Then again, I guess I could go check this myself.

: You're right.  I checked the code and found to my horror that there's
: a big hole in the divide-by-zero case.  In ieee-math.c the divide
: routines correctly return QNaN in the case of 0/0, but in the case of
: nonzero/0 they fall through and cause a signal to be generated.  I'll
: come up with a fix for this soon...

Hrm.  I'm still getting a fault on double 0 divided by double 0 with -mieee
on 2.1.26, however. (does the same thing with floats as well)

        a = 0.0;
        b = 0.0;
        printf("about to divide %g by %g\n", a, b);
        c = a/b;
		printf("divided\n");
        printf("result: %g\n", c);

compiled with:
nova:~> gcc -mieee testieee.c -lm
nova:~> ./a.out
about to divide 0 by 0
Floating exception (core dumped)
nova:~> uname -a
Linux nova.campus.luth.se 2.1.26 #3 Thu Apr 3 19:30:10 CEST 1997 alpha

--randy

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

             reply	other threads:[~1997-04-10 18:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-10 18:04 Randy Chapman [this message]
1997-04-10 19:07 ` SIGFPE Richard Henderson
1997-04-10 19:09 ` SIGFPE Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
1997-08-27 14:23 SIGFPE Christopher J. Grayce
1997-04-10 18:31 SIGFPE Jim Paradis
1997-04-10 16:09 SIGFPE Jim Paradis
1997-04-10 11:41 SIGFPE Olaf Flebbe
1997-04-09 19:05 SIGFPE Jim Paradis
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