[parisc-linux] Re: floating point exception error

Randolph Chung Randolph Chung <randolph@tausq.org>
Fri, 10 Jan 2003 22:16:38 -0800


> Ok, that's good to hear.  Your info, along with Randolph's info that it
> traps on the 8500, 8600, and 8700 CPUs, leads me to the same conclusion
> as Randolph came to.  It looks like there's something wrong with the
> fcnv emulation in the linux kernel's emulation handler, even though it
> was derived from the hpux handler, where everything appears to work
> fine.

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);

FPU_TYPE_FLAG_POS is defined as
#define EM_FPU_TYPE_OFFSET 272
#define FPU_TYPE_FLAG_POS (EM_FPU_TYPE_OFFSET>>2)
(272>>2 == 68)

so, i wonder:
1) why those numbers? (where is it documented?)
2) is there a special way to read that fpu type from the fpu? or do we
use boot_cpu_data.cpu_type?

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