[parisc-linux] Re: HPPA FPU Specification? (FE_INEXACT raised by accident)
John David Anglin
dave@hiauly1.hia.nrc.ca
Mon, 20 Oct 2003 12:31:34 -0400 (EDT)
> > > Multiple exceptions per instruction is not the intended behaviour :)
> > > I need two numbers, that when added only overflow, not overflow and
> > > inexact. The same to be said for underflow. Perhaps I just need to
> > > dig more.
> >
> > Well 10-7 talks explicitly about what happens when you get both
> > exceptions on a single instruction. On the otherhand, the discussion
> > of the inexact exception seems to imply that inexact should only occur
> > in an overflow/underflow situation when an overflow/underflow exception
> > doesn't occur. Possibly, the PA implementation is not consistent with
> > IEEE mandated behavior, but I can't be sure.
>
> My reading of 10-7 and the equivalent sections in the PA 1.1 arch
> doc indicate that it _can_ happen outside of an overflow/underflow
> situation. It just so happens that it can also be coupled with
> underflow/overflow exceptions.
I wasn't saying that inexact can't happen in other circumstances. I
was wrong in including undeflow in the above and I mis-rembered the
statement at the top of 10-11. It actually states that an inexact
exception shall be signaled if an overflow occurs without an overflow
trap.
> Does having them both at the same time violates the behaviour of
> "feraiseexcept" in the ISO C standard (especially in the case of
> underflow)? If feraiseexcept is called and only an underflow
> requested, but underflow and inexact are enabled, what then?
Does this help? The standard says
"Whether the feraiseexcept function additionally raises the inexact
exception whenever it raises the overflow or underflow exceptions is
implementation defined."
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)