1 #ifndef _ASM_MATH_EMU_H
2 #define _ASM_MATH_EMU_H
5 #include <linux/linkage.h>
10 #define FPSR_AEXC_INEX 3
11 #define FPSR_AEXC_DZ 4
12 #define FPSR_AEXC_UNFL 5
13 #define FPSR_AEXC_OVFL 6
14 #define FPSR_AEXC_IOP 7
17 #define FPSR_EXC_INEX1 8
18 #define FPSR_EXC_INEX2 9
19 #define FPSR_EXC_DZ 10
20 #define FPSR_EXC_UNFL 11
21 #define FPSR_EXC_OVFL 12
22 #define FPSR_EXC_OPERR 13
23 #define FPSR_EXC_SNAN 14
24 #define FPSR_EXC_BSUN 15
27 #define FPSR_QUOTIENT(fpsr) (*((signed char *) &(fpsr) + 1))
30 #define FPSR_CC_NAN 24
31 #define FPSR_CC_INF 25
33 #define FPSR_CC_NEG 27
39 #define FPCR_ROUND_RN 0
40 #define FPCR_ROUND_RZ 1
41 #define FPCR_ROUND_RM 2
42 #define FPCR_ROUND_RP 3
45 #define FPCR_PRECISION_X 0
46 #define FPCR_PRECISION_S 1
47 #define FPCR_PRECISION_D 2
60 #define PMDECODE (1<<PDECODE)
61 #define PMEXECUTE (1<<PEXECUTE)
62 #define PMCONV (1<<PCONV)
63 #define PMNORM (1<<PNORM)
64 #define PMREGISTER (1<<PREGISTER)
65 #define PMINSTR (1<<PINSTR)
66 #define PMUNIMPL (1<<PUNIMPL)
67 #define PMMOVEM (1<<PMOVEM)
71 #include <linux/kernel.h>
72 #include <linux/sched.h>
75 unsigned long long m64;
80 unsigned long long m64[2];
106 extern unsigned int fp_debugprint;
108 #define dprint(bit, fmt, args...) ({ \
109 if (fp_debugprint & (1 << (bit))) \
110 printk(fmt, ## args); \
113 #define dprint(bit, fmt, args...)
116 #define uprint(str) ({ \
117 static int __count = 3; \
120 printk("You just hit an unimplemented " \
121 "fpu instruction (%s)\n", str); \
122 printk("Please report this to ....\n"); \
127 #define FPDATA ((struct fp_data *)current->thread.fp)
134 #define FPD_FPREG (TASK_THREAD+THREAD_FPREG+0)
135 #define FPD_FPCR (TASK_THREAD+THREAD_FPREG+96)
136 #define FPD_FPSR (TASK_THREAD+THREAD_FPREG+100)
137 #define FPD_FPIAR (TASK_THREAD+THREAD_FPREG+104)
138 #define FPD_PREC (TASK_THREAD+THREAD_FPREG+108)
139 #define FPD_RND (TASK_THREAD+THREAD_FPREG+110)
140 #define FPD_TEMPFP1 (TASK_THREAD+THREAD_FPREG+112)
141 #define FPD_TEMPFP2 (TASK_THREAD+THREAD_FPREG+124)
142 #define FPD_SIZEOF (TASK_THREAD+THREAD_FPREG+136)
148 #define FPS_DO (PT_D0)
149 #define FPS_D1 (PT_D1)
150 #define FPS_D2 (PT_D2)
151 #define FPS_A0 (PT_A0)
152 #define FPS_A1 (PT_A1)
153 #define FPS_A2 (PT_A2)
154 #define FPS_SR (PT_SR)
155 #define FPS_PC (PT_PC)
156 #define FPS_EA (PT_PC+6)
157 #define FPS_PC2 (PT_PC+10)
169 .macro fp_get_pc
dest
170 move.l (FPS_PC+4,%
sp),\dest
174 move.l \src,(FPS_PC+4,%
sp)
179 addq.l #
\s,%
sp@(FPS_PC+4)
197 .Lu1\@: moves\size \src,\dest
201 .Lu2\@: move.l \addr,%
a0
213 .Lu1\@: moves\size \src,\dest
218 .Lu3\@: move.l \addr,%
a0
222 .section __ex_table,
"a"
232 movestack (\nr-1),\arg2,\arg3,\arg4,\arg5
249 btst %
d0,fp_debugprint+((31-\bit)/8)
251 btst #\bit,fp_debugprint+((31-\bit)/8)
258 lea ((\nr+1)*4,%
sp),%
sp