9 | file,
README,
in this same directory.
14 | frame
and any local variables needed
by the FPSP package.
16 | All FPSP handlers begin
by executing:
21 | fmovem.x fp0-fp3,USER_FP0(a6)
22 | fmove.l
fpsr/
fpcr/fpiar,USER_FPSR(a6)
24 | After initialization,
the stack looks like
this:
26 | A7 ---> +-------------------------------+
30 | +-------------------------------+
32 | | FPSP Local Variables |
36 | +-------------------------------+
37 | A6 ---> | Saved A6 |
38 | +-------------------------------+
48 | On
exit,
the handlers execute:
51 | fmovem.x USER_FP0(a6),fp0-fp3
52 | fmove.l USER_FPSR(a6),
fpsr/
fpcr/fpiar
59 |
type that was generated. Some handlers may omit
the "frestore"
64 | can happen
if the package is entered for an unimplemented float
65 | instruction that generates (say) an underflow. Alternatively,
66 | a second fsave frame can be pushed onto the stack and the
67 | handler exit code will reload the new frame and discard the old.
69 | The registers d0, d1, a0, a1 and fp0-fp3 are always saved and
70 | restored from the "local variable" area and can be used as
71 | temporaries. If a routine needs to change any
72 | of these registers, it should modify the saved copy and let
73 | the handler exit code restore the value.
75 |----------------------------------------------------------------------
77 | Local Variables on the stack
79 .set LOCAL_SIZE,192 | bytes needed for local variables
80 .set LV,-LOCAL_SIZE | convenient base value
82 .set USER_DA,LV+0 | save space for D0-D1,A0-A1
83 .set USER_D0,LV+0 | saved user D0
84 .set USER_D1,LV+4 | saved user D1
85 .set USER_A0,LV+8 | saved user A0
86 .set USER_A1,LV+12 | saved user A1
87 .set USER_FP0,LV+16 | saved user FP0
88 .set USER_FP1,LV+28 | saved user FP1
89 .set USER_FP2,LV+40 | saved user FP2
90 .set USER_FP3,LV+52 | saved user FP3
91 .set USER_FPCR,LV+64 | saved user FPCR
92 .set FPCR_ENABLE,USER_FPCR+2 | FPCR exception enable
93 .set FPCR_MODE,USER_FPCR+3 | FPCR rounding mode control
94 .set USER_FPSR,LV+68 | saved user FPSR
95 .set FPSR_CC,USER_FPSR+0 | FPSR condition code
96 .set FPSR_QBYTE,USER_FPSR+1 | FPSR quotient
97 .set FPSR_EXCEPT,USER_FPSR+2 | FPSR exception
98 .set FPSR_AEXCEPT,USER_FPSR+3 | FPSR accrued exception
99 .set USER_FPIAR,LV+72 | saved user FPIAR
100 .set FP_SCR1,LV+76 | room for a temporary float value
101 .set FP_SCR2,LV+92 | room for a temporary float value
102 .set L_SCR1,LV+108 | room for a temporary long value
103 .set L_SCR2,LV+112 | room for a temporary long value
104 .set STORE_FLG,LV+116
105 .set BINDEC_FLG,LV+117 | used in bindec
106 .set DNRM_FLG,LV+118 | used in res_func
107 .set RES_FLG,LV+119 | used in res_func
108 .set DY_MO_FLG,LV+120 | dyadic/monadic flag
109 .set UFLG_TMP,LV+121 | temporary for uflag errata
110 .set CU_ONLY,LV+122 | cu-only flag
111 .set VER_TMP,LV+123 | temp holding for version number
112 .set L_SCR3,LV+124 | room for a temporary long value
113 .set FP_SCR3,LV+128 | room for a temporary float value
114 .set FP_SCR4,LV+144 | room for a temporary float value
115 .set FP_SCR5,LV+160 | room for a temporary float value
118 |NEXT equ LV+192 ;need to increase LOCAL_SIZE
120 |--------------------------------------------------------------------------
125 | words of
a busy frame are
the same
as the unimplemented frame.
127 .set CU_SAVEPC,LV-92 | micro-
pc for CU (1
byte)
128 .set FPR_DIRTY_BITS,LV-91 | fpr
dirty bits
132 .set WBTEMP_HI,WBTEMP+4 | wbtemp mantissa [63:32] (4
bytes)
133 .
set WBTEMP_LO,WBTEMP+8 | wbtemp mantissa [31:00] (4
bytes)
144 .set NMNEXC,LV-44 | NMNEXC (unsup,snan
bits only)
145 .set nmn_unsup_bit,1 |
146 .set nmn_snan_bit,0 |
148 .set NMCEXC,LV-43 | NMNEXC & NMCEXC
159 .set WBTEMP_GRS,LV-40 |
alias wbtemp guard, round, sticky
163 .set denorm_bit,7 |
bit determines
if denorm
or unnorm
165 .set wbtemp66_bit,2 | wbtemp mantissa
bit #66
166 .set wbtemp1_bit,1 | wbtemp mantissa
bit #1
167 .set wbtemp0_bit,0 | wbtemp mantissa
bit #0
169 .set STICKY,LV-39 | holds sticky
bit
173 .set kfact_bit,12 | distinguishes
static/
dynamic k-factor
174 | ;on packed move outs. NOTE:
this
175 | ;equate only works when CMDREG1B
is in
186 .set WB_BYTE,LV-31 | holds WBTE15
bit (1
byte)
199 .set FPTEMP,LV-24 | fptemp (12
bytes)
201 .set FPTEMP_HI,FPTEMP+4 | fptemp mantissa [63:32] (4
bytes)
202 .
set FPTEMP_LO,FPTEMP+8 | fptemp mantissa [31:00] (4
bytes)
206 .set ETEMP,LV-12 | etemp (12
bytes)
208 .set ETEMP_HI,ETEMP+4 | etemp mantissa [63:32] (4
bytes)
209 .
set ETEMP_LO,ETEMP+8 | etemp mantissa [31:00] (4
bytes)
218 |--------------------------------------------------------------------------
222 .set neg_bit,3 | negative
result
224 .set inf_bit,1 | infinity
result
229 .set bsun_bit,7 |
branch on unordered
230 .set snan_bit,6 | signalling nan
233 .set unfl_bit,3 | underflow
235 .set inex2_bit,1 | inexact
result 2
236 .set inex1_bit,0 | inexact
result 1
240 .set aunfl_bit,5 | accrued underflow
242 .set ainex_bit,3 | accrued inexact
246 .set neg_mask,0x08000000
247 .set z_mask,0x04000000
248 .set inf_mask,0x02000000
249 .set nan_mask,0x01000000
251 .set bsun_mask,0x00008000 |
252 .set snan_mask,0x00004000
253 .set operr_mask,0x00002000
254 .set ovfl_mask,0x00001000
255 .set unfl_mask,0x00000800
256 .set dz_mask,0x00000400
257 .set inex2_mask,0x00000200
258 .set inex1_mask,0x00000100
261 .set aovfl_mask,0x00000040 | accrued
overflow
262 .set aunfl_mask,0x00000020 | accrued underflow
264 .set ainex_mask,0x00000008 | accrued inexact
268 .set dzinf_mask,inf_mask+dz_mask+adz_mask
269 .set opnan_mask,nan_mask+operr_mask+aiop_mask
270 .set nzi_mask,0x01ffffff | clears
N,
Z,
and I
271 .set unfinx_mask,unfl_mask+inex2_mask+aunfl_mask+ainex_mask
272 .set unf2inx_mask,unfl_mask+inex2_mask+ainex_mask
273 .set ovfinx_mask,ovfl_mask+inex2_mask+aovfl_mask+ainex_mask
274 .set inx1a_mask,inex1_mask+ainex_mask
275 .set inx2a_mask,inex2_mask+ainex_mask
276 .set snaniop_mask,nan_mask+snan_mask+aiop_mask
277 .set naniop_mask,nan_mask+aiop_mask
278 .set neginf_mask,neg_mask+inf_mask
279 .set infaiop_mask,inf_mask+aiop_mask
280 .set negz_mask,neg_mask+z_mask
281 .set opaop_mask,operr_mask+aiop_mask
282 .set unfl_inx_mask,unfl_mask+aunfl_mask+ainex_mask
283 .set ovfl_inx_mask,ovfl_mask+aovfl_mask+ainex_mask
285 |--------------------------------------------------------------------------
289 .set x_mode,0x00 | round to extended
290 .set s_mode,0x40 | round to single
291 .set d_mode,0x80 | round to
double
293 .set rn_mode,0x00 | round nearest
294 .set rz_mode,0x10 | round to
zero
295 .set rm_mode,0x20 | round to minus infinity
296 .set rp_mode,0x30 | round to plus infinity
298 |--------------------------------------------------------------------------
300 | Miscellaneous equates
302 .set signan_bit,6 | signalling nan
bit in mantissa
305 .set rnd_stky_bit,29 | round/sticky
bit of mantissa
313 .set LOCAL_GRS,12 |
valid ONLY
for FP_SCR1, FP_SCR2
316 .set norm_tag,0x00 |
tag bits in {7:5} position
329 .set BUSY_SIZE,100 |
size of
busy frame
330 .set BUSY_FRAME,LV-BUSY_SIZE |
start of
busy frame
332 .set UNIMP_40_SIZE,44 |
size of orig unimp frame
333 .set UNIMP_41_SIZE,52 |
size of
rev unimp frame
335 .set IDLE_SIZE,4 |
size of
idle frame
336 .set IDLE_FRAME,LV-IDLE_SIZE |
start of
idle frame
341 .set FLINE_VEC,0x002C | real
F-
line
342 .set UNIMP_VEC,0x202C | unimplemented
345 .set dbl_thresh,0x3C01
346 .set sgl_thresh,0x3F81