* IEEE FP Problems
@ 1997-06-02 3:40 Daryll Strauss
0 siblings, 0 replies; only message in thread
From: Daryll Strauss @ 1997-06-02 3:40 UTC (permalink / raw)
We've got a couple of IEEE floating point intensive applications that
we're trying to run under Alpha Linux. One of the applications is a Dec
Unix application which we don't have source to and the other is an
in-house tools which is native under Linux. Both expect the IEEE
behavior for floating point.
There was some useful information on this topic posted to the list by
Jim Paradis in April. I've looked through that and the kernel sources
for traps.c, osf_sys.c, fp-emul.c, and ieee-math.c in 2.1.35. There
seems to be several problems I'm encountering. I've made a little
headway, but I've hit a serious stumbling block.
The first thing I tried was to compile a program under Dec Unix that
checked the state of the fp control register. Those start out being
different. It looks like Dec Unix is clearing the bits back 0 and Linux
isn't. I forced those bits to 0 and I made sure
current->tss.flags&IEEE_TRAP_ENABLE_MASK=0 in
osf_set_program_attributes.
My native Dec Unix application did better, but still produced an FPE on
some data files. I remembered Jim's comments about division by zero, and
took a look at ieee-math.c. It looks like division by 0 returns NaN for
0/0, but causes and FPE for any other numerator. As a first stab I
corrected that by returning setting *c=IEEE_PINF and returning 0 in the
two division routines.
This doesn't appear to be the right answer, because I'm always returning
IEEE_PINF. I'm not sure of the exact IEEE spec. It seems like I should
have to check the sign bits of the two operands and return IEEE_NINF if
they are different. (Is that true for division by negative 0?) From
looking at the rest of the code I don't think IEEE_NINF is ever
returned.
These changes completely solved my floating point exceptions. Now I'm
seeing some arithmetic acceptions. So far, my testing has shown this
as occuring in fp-emul.c in alpha_fp_emul_imprecise in the case where a
OPC_PAL or OPC_JSR is encountered. I'm kind of baffled by this, because
I don't know enough about the Alpha instructions and scheduling. What's
this routine trying to do and what does the arithmetic exception really
mean?
If anyone has an suggestions for how to tackle this I'd be happy to hear
them. I'm hoping to bundle these changes up into a patch once I get all
the problems striaghtened out.
Thanks,
- |Daryll
--
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] only message in thread
only message in thread, other threads:[~1997-06-02 3:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-06-02 3:40 IEEE FP Problems Daryll Strauss
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox