43 #include <linux/kernel.h>
49 #include <asm/signal.h>
50 #include <asm/siginfo.h>
53 #undef Fpustatus_register
54 #define Fpustatus_register Fpu_register[0]
59 #define SIGNALCODE(signal, code) ((signal) << 24 | (code))
60 #define copropbit 1<<31-2
66 #define MAX_EXCP_REG 7
69 #define Excp_type(index) Exceptiontype(Fpu_register[index])
70 #define Excp_instr(index) Instructionfield(Fpu_register[index])
71 #define Clear_excp_register(index) Allexception(Fpu_register[index]) = 0
72 #define Excp_format() \
73 (current_ir >> ((current_ir>>opclass & twobits)==1 ? df : fmt) & twobits)
76 #define Fpu_sgl(index) Fpu_register[index*2]
78 #define Fpu_dblp1(index) Fpu_register[index*2]
79 #define Fpu_dblp2(index) Fpu_register[(index*2)+1]
81 #define Fpu_quadp1(index) Fpu_register[index*2]
82 #define Fpu_quadp2(index) Fpu_register[(index*2)+1]
83 #define Fpu_quadp3(index) Fpu_register[(index*2)+2]
84 #define Fpu_quadp4(index) Fpu_register[(index*2)+3]
88 # define Sgl_decrement(sgl_value) Sall(sgl_value)--
93 # define Dbl_decrement(dbl_valuep1,dbl_valuep2) \
94 if ((Dallp2(dbl_valuep2)--) == 0) Dallp1(dbl_valuep1)--
98 #define update_trap_counts(Fpu_register, aflags, bflags, trap_counts) { \
99 aflags=(Fpu_register[0])>>27; \
100 Fpu_register[0] |= bflags; \
104 decode_fpu(
unsigned int Fpu_register[],
unsigned int trap_counts[])
106 unsigned int current_ir, excp;
107 int target, exception_index = 1;
111 unsigned int excptype;
120 bflags=(Fpu_register[0] & 0xf8000000);
121 Fpu_register[0] &= 0x07ffffff;
148 for (exception_index=1; exception_index<=
MAX_EXCP_REG; exception_index++) {
168 excp =
fpudispatch(current_ir,excptype,0,Fpu_register);
184 Fpu_register[exception_index]);
185 if (excp == UNIMPLEMENTEDEXCEPTION) {
225 if (
Ibit(Fpu_register[exception_index])) inexact =
TRUE;
226 else inexact =
FALSE;
235 if (
Rabit(Fpu_register[exception_index]))
247 if (
Rabit(Fpu_register[exception_index]))
352 printk(
"%s(%d) Unknown FPU exception 0x%x\n", __FILE__,