From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199704101804.OAA13497@shell.ncm.com> Date: Thu, 10 Apr 1997 14:04:10 -0400 From: Randy Chapman Subject: Re: SIGFPE 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