[parisc-linux] Re: floating point exception error

John David Anglin dave@hiauly1.hia.nrc.ca
Sat, 11 Jan 2003 13:31:58 -0500 (EST)


> I think i found it....
> 
> for class 1 ops (fcnv) pa20 has a 3-bit subop field, pa11 has a 2-bit
> subop field, which determines the source/target formats. our code is not
> correctly determining pa11 vs pa20, so it defaults to pa11 and uses
> subop==1 instead of subop==5
> 
> now, the tricky part is how to get it to detect the right type. the code
> looks like this:
> 
> fpu_type_flags=fpregs[FPU_TYPE_FLAG_POS];  /* get fpu type flags */
> if  (fpu_type_flags & PA2_0_FPU_FLAG)
>     subop = get_subop1_PA2_0(ir);
> else
>     subop = get_subop1_PA1_1(ir);

I think that you probably should always use a 3-bit extract.  If the
value is greater than 3 on a PA 1.1 FPU, then the operation is undefined.
4 is also undefined for PA 2.0.

The above assumes that the kernel doesn't provide PA 2.0 emulation
on PA 1.1 machines.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)