[parisc-linux] Re: floating point exception error

Randolph Chung Randolph Chung <randolph@tausq.org>
Thu, 9 Jan 2003 23:54:41 -0800


In reference to a message from John David Anglin, dated Dec 11:
> > The code _seems_ to trap on a PA8600. Though I won't say anything until
> > I enable debugging in the trap handler and rerun the test.
> 
> The code doesn't seem to trap on a A500 which I believe is a PA8500.
> I think we need to look at bits 0..1 of the coprocessor configuration
> register to determine instruction validity.  See table 8-6 on page 8-11.
> I can look at what the HP compiler does.  Up to now, we have assumed
> that all PA8000 machines have the same instruction set.

i looked at this some more.. it's not that the fcnv instruction is not
implemented by the processor, but we seem to be falling into one of the
overflow/underflow cases... if you adjust the value being converted (say
remove one of the zeros), the program works without trapping.

page 10-9 of the pa20 arch manual gives the conditions under which a
floating point conversion op will cause an unimplemented exception.
however my reading of the text is that an exception is only generated if
the overflow/underflow exceptions are enabled. i've tried explicitly 
calling feclearexcept(FE_ALL_EXCEPT) before doing the fp op but it still 
causes the unimplemented exception trap.
The kernel debugs seem to indicate the O/U exceptions are not set as 
well....

puzzled,
randolph
-- 
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/