xref: /OK3568_Linux_fs/kernel/arch/m68k/fpsp040/fpsp.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun |
2*4882a593Smuzhiyun |	fpsp.h 3.3 3.3
3*4882a593Smuzhiyun |
4*4882a593Smuzhiyun 
5*4882a593Smuzhiyun |		Copyright (C) Motorola, Inc. 1990
6*4882a593Smuzhiyun |			All Rights Reserved
7*4882a593Smuzhiyun |
8*4882a593Smuzhiyun |       For details on the license for this file, please see the
9*4882a593Smuzhiyun |       file, README, in this same directory.
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun |	fpsp.h --- stack frame offsets during FPSP exception handling
12*4882a593Smuzhiyun |
13*4882a593Smuzhiyun |	These equates are used to access the exception frame, the fsave
14*4882a593Smuzhiyun |	frame and any local variables needed by the FPSP package.
15*4882a593Smuzhiyun |
16*4882a593Smuzhiyun |	All FPSP handlers begin by executing:
17*4882a593Smuzhiyun |
18*4882a593Smuzhiyun |		link	a6,#-LOCAL_SIZE
19*4882a593Smuzhiyun |		fsave	-(a7)
20*4882a593Smuzhiyun |		movem.l	d0-d1/a0-a1,USER_DA(a6)
21*4882a593Smuzhiyun |		fmovem.x fp0-fp3,USER_FP0(a6)
22*4882a593Smuzhiyun |		fmove.l	fpsr/fpcr/fpiar,USER_FPSR(a6)
23*4882a593Smuzhiyun |
24*4882a593Smuzhiyun |	After initialization, the stack looks like this:
25*4882a593Smuzhiyun |
26*4882a593Smuzhiyun |	A7 --->	+-------------------------------+
27*4882a593Smuzhiyun |		|				|
28*4882a593Smuzhiyun |		|	FPU fsave area		|
29*4882a593Smuzhiyun |		|				|
30*4882a593Smuzhiyun |		+-------------------------------+
31*4882a593Smuzhiyun |		|				|
32*4882a593Smuzhiyun |		|	FPSP Local Variables	|
33*4882a593Smuzhiyun |		|	     including		|
34*4882a593Smuzhiyun |		|	  saved registers	|
35*4882a593Smuzhiyun |		|				|
36*4882a593Smuzhiyun |		+-------------------------------+
37*4882a593Smuzhiyun |	A6 --->	|	Saved A6		|
38*4882a593Smuzhiyun |		+-------------------------------+
39*4882a593Smuzhiyun |		|				|
40*4882a593Smuzhiyun |		|	Exception Frame		|
41*4882a593Smuzhiyun |		|				|
42*4882a593Smuzhiyun |		|				|
43*4882a593Smuzhiyun |
44*4882a593Smuzhiyun |	Positive offsets from A6 refer to the exception frame.  Negative
45*4882a593Smuzhiyun |	offsets refer to the Local Variable area and the fsave area.
46*4882a593Smuzhiyun |	The fsave frame is also accessible from the top via A7.
47*4882a593Smuzhiyun |
48*4882a593Smuzhiyun |	On exit, the handlers execute:
49*4882a593Smuzhiyun |
50*4882a593Smuzhiyun |		movem.l	USER_DA(a6),d0-d1/a0-a1
51*4882a593Smuzhiyun |		fmovem.x USER_FP0(a6),fp0-fp3
52*4882a593Smuzhiyun |		fmove.l	USER_FPSR(a6),fpsr/fpcr/fpiar
53*4882a593Smuzhiyun |		frestore (a7)+
54*4882a593Smuzhiyun |		unlk	a6
55*4882a593Smuzhiyun |
56*4882a593Smuzhiyun |	and then either "bra fpsp_done" if the exception was completely
57*4882a593Smuzhiyun |	handled	by the package, or "bra real_xxxx" which is an external
58*4882a593Smuzhiyun |	label to a routine that will process a real exception of the
59*4882a593Smuzhiyun |	type that was generated.  Some handlers may omit the "frestore"
60*4882a593Smuzhiyun |	if the FPU state after the exception is idle.
61*4882a593Smuzhiyun |
62*4882a593Smuzhiyun |	Sometimes the exception handler will transform the fsave area
63*4882a593Smuzhiyun |	because it needs to report an exception back to the user.  This
64*4882a593Smuzhiyun |	can happen if the package is entered for an unimplemented float
65*4882a593Smuzhiyun |	instruction that generates (say) an underflow.  Alternatively,
66*4882a593Smuzhiyun |	a second fsave frame can be pushed onto the stack and the
67*4882a593Smuzhiyun |	handler	exit code will reload the new frame and discard the old.
68*4882a593Smuzhiyun |
69*4882a593Smuzhiyun |	The registers d0, d1, a0, a1 and fp0-fp3 are always saved and
70*4882a593Smuzhiyun |	restored from the "local variable" area and can be used as
71*4882a593Smuzhiyun |	temporaries.  If a routine needs to change any
72*4882a593Smuzhiyun |	of these registers, it should modify the saved copy and let
73*4882a593Smuzhiyun |	the handler exit code restore the value.
74*4882a593Smuzhiyun |
75*4882a593Smuzhiyun |----------------------------------------------------------------------
76*4882a593Smuzhiyun |
77*4882a593Smuzhiyun |	Local Variables on the stack
78*4882a593Smuzhiyun |
79*4882a593Smuzhiyun 	.set	LOCAL_SIZE,192		| bytes needed for local variables
80*4882a593Smuzhiyun 	.set	LV,-LOCAL_SIZE	| convenient base value
81*4882a593Smuzhiyun |
82*4882a593Smuzhiyun 	.set	USER_DA,LV+0		| save space for D0-D1,A0-A1
83*4882a593Smuzhiyun 	.set	USER_D0,LV+0		| saved user D0
84*4882a593Smuzhiyun 	.set	USER_D1,LV+4		| saved user D1
85*4882a593Smuzhiyun 	.set	USER_A0,LV+8		| saved user A0
86*4882a593Smuzhiyun 	.set	USER_A1,LV+12		| saved user A1
87*4882a593Smuzhiyun 	.set	USER_FP0,LV+16		| saved user FP0
88*4882a593Smuzhiyun 	.set	USER_FP1,LV+28		| saved user FP1
89*4882a593Smuzhiyun 	.set	USER_FP2,LV+40		| saved user FP2
90*4882a593Smuzhiyun 	.set	USER_FP3,LV+52		| saved user FP3
91*4882a593Smuzhiyun 	.set	USER_FPCR,LV+64		| saved user FPCR
92*4882a593Smuzhiyun 	.set	FPCR_ENABLE,USER_FPCR+2	|	FPCR exception enable
93*4882a593Smuzhiyun 	.set	FPCR_MODE,USER_FPCR+3	|	FPCR rounding mode control
94*4882a593Smuzhiyun 	.set	USER_FPSR,LV+68		| saved user FPSR
95*4882a593Smuzhiyun 	.set	FPSR_CC,USER_FPSR+0	|	FPSR condition code
96*4882a593Smuzhiyun 	.set	FPSR_QBYTE,USER_FPSR+1	|	FPSR quotient
97*4882a593Smuzhiyun 	.set	FPSR_EXCEPT,USER_FPSR+2	|	FPSR exception
98*4882a593Smuzhiyun 	.set	FPSR_AEXCEPT,USER_FPSR+3	|	FPSR accrued exception
99*4882a593Smuzhiyun 	.set	USER_FPIAR,LV+72		| saved user FPIAR
100*4882a593Smuzhiyun 	.set	FP_SCR1,LV+76		| room for a temporary float value
101*4882a593Smuzhiyun 	.set	FP_SCR2,LV+92		| room for a temporary float value
102*4882a593Smuzhiyun 	.set	L_SCR1,LV+108		| room for a temporary long value
103*4882a593Smuzhiyun 	.set	L_SCR2,LV+112		| room for a temporary long value
104*4882a593Smuzhiyun 	.set	STORE_FLG,LV+116
105*4882a593Smuzhiyun 	.set	BINDEC_FLG,LV+117		| used in bindec
106*4882a593Smuzhiyun 	.set	DNRM_FLG,LV+118		| used in res_func
107*4882a593Smuzhiyun 	.set	RES_FLG,LV+119		| used in res_func
108*4882a593Smuzhiyun 	.set	DY_MO_FLG,LV+120		| dyadic/monadic flag
109*4882a593Smuzhiyun 	.set	UFLG_TMP,LV+121		| temporary for uflag errata
110*4882a593Smuzhiyun 	.set	CU_ONLY,LV+122		| cu-only flag
111*4882a593Smuzhiyun 	.set	VER_TMP,LV+123		| temp holding for version number
112*4882a593Smuzhiyun 	.set	L_SCR3,LV+124		| room for a temporary long value
113*4882a593Smuzhiyun 	.set	FP_SCR3,LV+128		| room for a temporary float value
114*4882a593Smuzhiyun 	.set	FP_SCR4,LV+144		| room for a temporary float value
115*4882a593Smuzhiyun 	.set	FP_SCR5,LV+160		| room for a temporary float value
116*4882a593Smuzhiyun 	.set	FP_SCR6,LV+176
117*4882a593Smuzhiyun |
118*4882a593Smuzhiyun |NEXT		equ	LV+192		;need to increase LOCAL_SIZE
119*4882a593Smuzhiyun |
120*4882a593Smuzhiyun |--------------------------------------------------------------------------
121*4882a593Smuzhiyun |
122*4882a593Smuzhiyun |	fsave offsets and bit definitions
123*4882a593Smuzhiyun |
124*4882a593Smuzhiyun |	Offsets are defined from the end of an fsave because the last 10
125*4882a593Smuzhiyun |	words of a busy frame are the same as the unimplemented frame.
126*4882a593Smuzhiyun |
127*4882a593Smuzhiyun 	.set	CU_SAVEPC,LV-92		| micro-pc for CU (1 byte)
128*4882a593Smuzhiyun 	.set	FPR_DIRTY_BITS,LV-91		| fpr dirty bits
129*4882a593Smuzhiyun |
130*4882a593Smuzhiyun 	.set	WBTEMP,LV-76		| write back temp (12 bytes)
131*4882a593Smuzhiyun 	.set	WBTEMP_EX,WBTEMP		| wbtemp sign and exponent (2 bytes)
132*4882a593Smuzhiyun 	.set	WBTEMP_HI,WBTEMP+4	| wbtemp mantissa [63:32] (4 bytes)
133*4882a593Smuzhiyun 	.set	WBTEMP_LO,WBTEMP+8	| wbtemp mantissa [31:00] (4 bytes)
134*4882a593Smuzhiyun |
135*4882a593Smuzhiyun 	.set	WBTEMP_SGN,WBTEMP+2	| used to store sign
136*4882a593Smuzhiyun |
137*4882a593Smuzhiyun 	.set	FPSR_SHADOW,LV-64		| fpsr shadow reg
138*4882a593Smuzhiyun |
139*4882a593Smuzhiyun 	.set	FPIARCU,LV-60		| Instr. addr. reg. for CU (4 bytes)
140*4882a593Smuzhiyun |
141*4882a593Smuzhiyun 	.set	CMDREG2B,LV-52		| cmd reg for machine 2
142*4882a593Smuzhiyun 	.set	CMDREG3B,LV-48		| cmd reg for E3 exceptions (2 bytes)
143*4882a593Smuzhiyun |
144*4882a593Smuzhiyun 	.set	NMNEXC,LV-44		| NMNEXC (unsup,snan bits only)
145*4882a593Smuzhiyun 	.set	nmn_unsup_bit,1	|
146*4882a593Smuzhiyun 	.set	nmn_snan_bit,0	|
147*4882a593Smuzhiyun |
148*4882a593Smuzhiyun 	.set	NMCEXC,LV-43		| NMNEXC & NMCEXC
149*4882a593Smuzhiyun 	.set	nmn_operr_bit,7
150*4882a593Smuzhiyun 	.set	nmn_ovfl_bit,6
151*4882a593Smuzhiyun 	.set	nmn_unfl_bit,5
152*4882a593Smuzhiyun 	.set	nmc_unsup_bit,4
153*4882a593Smuzhiyun 	.set	nmc_snan_bit,3
154*4882a593Smuzhiyun 	.set	nmc_operr_bit,2
155*4882a593Smuzhiyun 	.set	nmc_ovfl_bit,1
156*4882a593Smuzhiyun 	.set	nmc_unfl_bit,0
157*4882a593Smuzhiyun |
158*4882a593Smuzhiyun 	.set	STAG,LV-40		| source tag (1 byte)
159*4882a593Smuzhiyun 	.set	WBTEMP_GRS,LV-40		| alias wbtemp guard, round, sticky
160*4882a593Smuzhiyun 	.set	guard_bit,1		| guard bit is bit number 1
161*4882a593Smuzhiyun 	.set	round_bit,0		| round bit is bit number 0
162*4882a593Smuzhiyun 	.set	stag_mask,0xE0		| upper 3 bits are source tag type
163*4882a593Smuzhiyun 	.set	denorm_bit,7		| bit determines if denorm or unnorm
164*4882a593Smuzhiyun 	.set	etemp15_bit,4		| etemp exponent bit #15
165*4882a593Smuzhiyun 	.set	wbtemp66_bit,2		| wbtemp mantissa bit #66
166*4882a593Smuzhiyun 	.set	wbtemp1_bit,1		| wbtemp mantissa bit #1
167*4882a593Smuzhiyun 	.set	wbtemp0_bit,0		| wbtemp mantissa bit #0
168*4882a593Smuzhiyun |
169*4882a593Smuzhiyun 	.set	STICKY,LV-39		| holds sticky bit
170*4882a593Smuzhiyun 	.set	sticky_bit,7
171*4882a593Smuzhiyun |
172*4882a593Smuzhiyun 	.set	CMDREG1B,LV-36		| cmd reg for E1 exceptions (2 bytes)
173*4882a593Smuzhiyun 	.set	kfact_bit,12		| distinguishes static/dynamic k-factor
174*4882a593Smuzhiyun |					;on packed move outs.  NOTE: this
175*4882a593Smuzhiyun |					;equate only works when CMDREG1B is in
176*4882a593Smuzhiyun |					;a register.
177*4882a593Smuzhiyun |
178*4882a593Smuzhiyun 	.set	CMDWORD,LV-35		| command word in cmd1b
179*4882a593Smuzhiyun 	.set	direction_bit,5		| bit 0 in opclass
180*4882a593Smuzhiyun 	.set	size_bit2,12		| bit 2 in size field
181*4882a593Smuzhiyun |
182*4882a593Smuzhiyun 	.set	DTAG,LV-32		| dest tag (1 byte)
183*4882a593Smuzhiyun 	.set	dtag_mask,0xE0		| upper 3 bits are dest type tag
184*4882a593Smuzhiyun 	.set	fptemp15_bit,4		| fptemp exponent bit #15
185*4882a593Smuzhiyun |
186*4882a593Smuzhiyun 	.set	WB_BYTE,LV-31		| holds WBTE15 bit (1 byte)
187*4882a593Smuzhiyun 	.set	wbtemp15_bit,4		| wbtemp exponent bit #15
188*4882a593Smuzhiyun |
189*4882a593Smuzhiyun 	.set	E_BYTE,LV-28		| holds E1 and E3 bits (1 byte)
190*4882a593Smuzhiyun 	.set	E1,2		| which bit is E1 flag
191*4882a593Smuzhiyun 	.set	E3,1		| which bit is E3 flag
192*4882a593Smuzhiyun 	.set	SFLAG,0		| which bit is S flag
193*4882a593Smuzhiyun |
194*4882a593Smuzhiyun 	.set	T_BYTE,LV-27		| holds T and U bits (1 byte)
195*4882a593Smuzhiyun 	.set	XFLAG,7		| which bit is X flag
196*4882a593Smuzhiyun 	.set	UFLAG,5		| which bit is U flag
197*4882a593Smuzhiyun 	.set	TFLAG,4		| which bit is T flag
198*4882a593Smuzhiyun |
199*4882a593Smuzhiyun 	.set	FPTEMP,LV-24		| fptemp (12 bytes)
200*4882a593Smuzhiyun 	.set	FPTEMP_EX,FPTEMP		| fptemp sign and exponent (2 bytes)
201*4882a593Smuzhiyun 	.set	FPTEMP_HI,FPTEMP+4	| fptemp mantissa [63:32] (4 bytes)
202*4882a593Smuzhiyun 	.set	FPTEMP_LO,FPTEMP+8	| fptemp mantissa [31:00] (4 bytes)
203*4882a593Smuzhiyun |
204*4882a593Smuzhiyun 	.set	FPTEMP_SGN,FPTEMP+2	| used to store sign
205*4882a593Smuzhiyun |
206*4882a593Smuzhiyun 	.set	ETEMP,LV-12		| etemp (12 bytes)
207*4882a593Smuzhiyun 	.set	ETEMP_EX,ETEMP		| etemp sign and exponent (2 bytes)
208*4882a593Smuzhiyun 	.set	ETEMP_HI,ETEMP+4		| etemp mantissa [63:32] (4 bytes)
209*4882a593Smuzhiyun 	.set	ETEMP_LO,ETEMP+8		| etemp mantissa [31:00] (4 bytes)
210*4882a593Smuzhiyun |
211*4882a593Smuzhiyun 	.set	ETEMP_SGN,ETEMP+2		| used to store sign
212*4882a593Smuzhiyun |
213*4882a593Smuzhiyun 	.set	EXC_SR,4		| exception frame status register
214*4882a593Smuzhiyun 	.set	EXC_PC,6		| exception frame program counter
215*4882a593Smuzhiyun 	.set	EXC_VEC,10		| exception frame vector (format+vector#)
216*4882a593Smuzhiyun 	.set	EXC_EA,12		| exception frame effective address
217*4882a593Smuzhiyun |
218*4882a593Smuzhiyun |--------------------------------------------------------------------------
219*4882a593Smuzhiyun |
220*4882a593Smuzhiyun |	FPSR/FPCR bits
221*4882a593Smuzhiyun |
222*4882a593Smuzhiyun 	.set	neg_bit,3	|  negative result
223*4882a593Smuzhiyun 	.set	z_bit,2	|  zero result
224*4882a593Smuzhiyun 	.set	inf_bit,1	|  infinity result
225*4882a593Smuzhiyun 	.set	nan_bit,0	|  not-a-number result
226*4882a593Smuzhiyun |
227*4882a593Smuzhiyun 	.set	q_sn_bit,7	|  sign bit of quotient byte
228*4882a593Smuzhiyun |
229*4882a593Smuzhiyun 	.set	bsun_bit,7	|  branch on unordered
230*4882a593Smuzhiyun 	.set	snan_bit,6	|  signalling nan
231*4882a593Smuzhiyun 	.set	operr_bit,5	|  operand error
232*4882a593Smuzhiyun 	.set	ovfl_bit,4	|  overflow
233*4882a593Smuzhiyun 	.set	unfl_bit,3	|  underflow
234*4882a593Smuzhiyun 	.set	dz_bit,2	|  divide by zero
235*4882a593Smuzhiyun 	.set	inex2_bit,1	|  inexact result 2
236*4882a593Smuzhiyun 	.set	inex1_bit,0	|  inexact result 1
237*4882a593Smuzhiyun |
238*4882a593Smuzhiyun 	.set	aiop_bit,7	|  accrued illegal operation
239*4882a593Smuzhiyun 	.set	aovfl_bit,6	|  accrued overflow
240*4882a593Smuzhiyun 	.set	aunfl_bit,5	|  accrued underflow
241*4882a593Smuzhiyun 	.set	adz_bit,4	|  accrued divide by zero
242*4882a593Smuzhiyun 	.set	ainex_bit,3	|  accrued inexact
243*4882a593Smuzhiyun |
244*4882a593Smuzhiyun |	FPSR individual bit masks
245*4882a593Smuzhiyun |
246*4882a593Smuzhiyun 	.set	neg_mask,0x08000000
247*4882a593Smuzhiyun 	.set	z_mask,0x04000000
248*4882a593Smuzhiyun 	.set	inf_mask,0x02000000
249*4882a593Smuzhiyun 	.set	nan_mask,0x01000000
250*4882a593Smuzhiyun |
251*4882a593Smuzhiyun 	.set	bsun_mask,0x00008000	|
252*4882a593Smuzhiyun 	.set	snan_mask,0x00004000
253*4882a593Smuzhiyun 	.set	operr_mask,0x00002000
254*4882a593Smuzhiyun 	.set	ovfl_mask,0x00001000
255*4882a593Smuzhiyun 	.set	unfl_mask,0x00000800
256*4882a593Smuzhiyun 	.set	dz_mask,0x00000400
257*4882a593Smuzhiyun 	.set	inex2_mask,0x00000200
258*4882a593Smuzhiyun 	.set	inex1_mask,0x00000100
259*4882a593Smuzhiyun |
260*4882a593Smuzhiyun 	.set	aiop_mask,0x00000080	|  accrued illegal operation
261*4882a593Smuzhiyun 	.set	aovfl_mask,0x00000040	|  accrued overflow
262*4882a593Smuzhiyun 	.set	aunfl_mask,0x00000020	|  accrued underflow
263*4882a593Smuzhiyun 	.set	adz_mask,0x00000010	|  accrued divide by zero
264*4882a593Smuzhiyun 	.set	ainex_mask,0x00000008	|  accrued inexact
265*4882a593Smuzhiyun |
266*4882a593Smuzhiyun |	FPSR combinations used in the FPSP
267*4882a593Smuzhiyun |
268*4882a593Smuzhiyun 	.set	dzinf_mask,inf_mask+dz_mask+adz_mask
269*4882a593Smuzhiyun 	.set	opnan_mask,nan_mask+operr_mask+aiop_mask
270*4882a593Smuzhiyun 	.set	nzi_mask,0x01ffffff	|  clears N, Z, and I
271*4882a593Smuzhiyun 	.set	unfinx_mask,unfl_mask+inex2_mask+aunfl_mask+ainex_mask
272*4882a593Smuzhiyun 	.set	unf2inx_mask,unfl_mask+inex2_mask+ainex_mask
273*4882a593Smuzhiyun 	.set	ovfinx_mask,ovfl_mask+inex2_mask+aovfl_mask+ainex_mask
274*4882a593Smuzhiyun 	.set	inx1a_mask,inex1_mask+ainex_mask
275*4882a593Smuzhiyun 	.set	inx2a_mask,inex2_mask+ainex_mask
276*4882a593Smuzhiyun 	.set	snaniop_mask,nan_mask+snan_mask+aiop_mask
277*4882a593Smuzhiyun 	.set	naniop_mask,nan_mask+aiop_mask
278*4882a593Smuzhiyun 	.set	neginf_mask,neg_mask+inf_mask
279*4882a593Smuzhiyun 	.set	infaiop_mask,inf_mask+aiop_mask
280*4882a593Smuzhiyun 	.set	negz_mask,neg_mask+z_mask
281*4882a593Smuzhiyun 	.set	opaop_mask,operr_mask+aiop_mask
282*4882a593Smuzhiyun 	.set	unfl_inx_mask,unfl_mask+aunfl_mask+ainex_mask
283*4882a593Smuzhiyun 	.set	ovfl_inx_mask,ovfl_mask+aovfl_mask+ainex_mask
284*4882a593Smuzhiyun |
285*4882a593Smuzhiyun |--------------------------------------------------------------------------
286*4882a593Smuzhiyun |
287*4882a593Smuzhiyun |	FPCR rounding modes
288*4882a593Smuzhiyun |
289*4882a593Smuzhiyun 	.set	x_mode,0x00	|  round to extended
290*4882a593Smuzhiyun 	.set	s_mode,0x40	|  round to single
291*4882a593Smuzhiyun 	.set	d_mode,0x80	|  round to double
292*4882a593Smuzhiyun |
293*4882a593Smuzhiyun 	.set	rn_mode,0x00	|  round nearest
294*4882a593Smuzhiyun 	.set	rz_mode,0x10	|  round to zero
295*4882a593Smuzhiyun 	.set	rm_mode,0x20	|  round to minus infinity
296*4882a593Smuzhiyun 	.set	rp_mode,0x30	|  round to plus infinity
297*4882a593Smuzhiyun |
298*4882a593Smuzhiyun |--------------------------------------------------------------------------
299*4882a593Smuzhiyun |
300*4882a593Smuzhiyun |	Miscellaneous equates
301*4882a593Smuzhiyun |
302*4882a593Smuzhiyun 	.set	signan_bit,6	|  signalling nan bit in mantissa
303*4882a593Smuzhiyun 	.set	sign_bit,7
304*4882a593Smuzhiyun |
305*4882a593Smuzhiyun 	.set	rnd_stky_bit,29	|  round/sticky bit of mantissa
306*4882a593Smuzhiyun |				this can only be used if in a data register
307*4882a593Smuzhiyun 	.set	sx_mask,0x01800000 |  set s and x bits in word $48
308*4882a593Smuzhiyun |
309*4882a593Smuzhiyun 	.set	LOCAL_EX,0
310*4882a593Smuzhiyun 	.set	LOCAL_SGN,2
311*4882a593Smuzhiyun 	.set	LOCAL_HI,4
312*4882a593Smuzhiyun 	.set	LOCAL_LO,8
313*4882a593Smuzhiyun 	.set	LOCAL_GRS,12	|  valid ONLY for FP_SCR1, FP_SCR2
314*4882a593Smuzhiyun |
315*4882a593Smuzhiyun |
316*4882a593Smuzhiyun 	.set	norm_tag,0x00	|  tag bits in {7:5} position
317*4882a593Smuzhiyun 	.set	zero_tag,0x20
318*4882a593Smuzhiyun 	.set	inf_tag,0x40
319*4882a593Smuzhiyun 	.set	nan_tag,0x60
320*4882a593Smuzhiyun 	.set	dnrm_tag,0x80
321*4882a593Smuzhiyun |
322*4882a593Smuzhiyun |	fsave sizes and formats
323*4882a593Smuzhiyun |
324*4882a593Smuzhiyun 	.set	VER_4,0x40		|  fpsp compatible version numbers
325*4882a593Smuzhiyun |					are in the $40s {$40-$4f}
326*4882a593Smuzhiyun 	.set	VER_40,0x40		|  original version number
327*4882a593Smuzhiyun 	.set	VER_41,0x41		|  revision version number
328*4882a593Smuzhiyun |
329*4882a593Smuzhiyun 	.set	BUSY_SIZE,100		|  size of busy frame
330*4882a593Smuzhiyun 	.set	BUSY_FRAME,LV-BUSY_SIZE	|  start of busy frame
331*4882a593Smuzhiyun |
332*4882a593Smuzhiyun 	.set	UNIMP_40_SIZE,44		|  size of orig unimp frame
333*4882a593Smuzhiyun 	.set	UNIMP_41_SIZE,52		|  size of rev unimp frame
334*4882a593Smuzhiyun |
335*4882a593Smuzhiyun 	.set	IDLE_SIZE,4		|  size of idle frame
336*4882a593Smuzhiyun 	.set	IDLE_FRAME,LV-IDLE_SIZE	|  start of idle frame
337*4882a593Smuzhiyun |
338*4882a593Smuzhiyun |	exception vectors
339*4882a593Smuzhiyun |
340*4882a593Smuzhiyun 	.set	TRACE_VEC,0x2024		|  trace trap
341*4882a593Smuzhiyun 	.set	FLINE_VEC,0x002C		|  real F-line
342*4882a593Smuzhiyun 	.set	UNIMP_VEC,0x202C		|  unimplemented
343*4882a593Smuzhiyun 	.set	INEX_VEC,0x00C4
344*4882a593Smuzhiyun |
345*4882a593Smuzhiyun 	.set	dbl_thresh,0x3C01
346*4882a593Smuzhiyun 	.set	sgl_thresh,0x3F81
347*4882a593Smuzhiyun |
348