1~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
3M68000 Hi-Performance Microprocessor Division
4M68060 Software Package
5Production Release P1.00 -- October 10, 1994
6
7M68060 Software Package Copyright © 1993, 1994 Motorola Inc. All rights reserved.
8
9THE SOFTWARE is provided on an "AS IS" basis and without warranty.
10To the maximum extent permitted by applicable law,
11MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
12INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
13and any warranty against infringement with regard to the SOFTWARE
14(INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
15
16To the maximum extent permitted by applicable law,
17IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
18(INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
19BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS)
20ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
21Motorola assumes no responsibility for the maintenance and support of the SOFTWARE.
22
23You are hereby granted a copyright license to use, modify, and distribute the SOFTWARE
24so long as this entire notice is retained without alteration in any modified and/or
25redistributed versions, and that such modified versions are clearly identified as such.
26No licenses are granted by implication, estoppel or otherwise under any patents
27or trademarks of Motorola, Inc.
28~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43set _off_bsun, 0x00
44set _off_snan, 0x04
45set _off_operr, 0x08
46set _off_ovfl, 0x0c
47set _off_unfl, 0x10
48set _off_dz, 0x14
49set _off_inex, 0x18
50set _off_fline, 0x1c
51set _off_fpu_dis, 0x20
52set _off_trap, 0x24
53set _off_trace, 0x28
54set _off_access, 0x2c
55set _off_done, 0x30
56
57set _off_imr, 0x40
58set _off_dmr, 0x44
59set _off_dmw, 0x48
60set _off_irw, 0x4c
61set _off_irl, 0x50
62set _off_drb, 0x54
63set _off_drw, 0x58
64set _off_drl, 0x5c
65set _off_dwb, 0x60
66set _off_dww, 0x64
67set _off_dwl, 0x68
68
69_060FPSP_TABLE:
70
71
72
73
74 bra.l _fpsp_snan
75 short 0x0000
76 bra.l _fpsp_operr
77 short 0x0000
78 bra.l _fpsp_ovfl
79 short 0x0000
80 bra.l _fpsp_unfl
81 short 0x0000
82 bra.l _fpsp_dz
83 short 0x0000
84 bra.l _fpsp_inex
85 short 0x0000
86 bra.l _fpsp_fline
87 short 0x0000
88 bra.l _fpsp_unsupp
89 short 0x0000
90 bra.l _fpsp_effadd
91 short 0x0000
92
93 space 56
94
95
96 global _fpsp_done
97_fpsp_done:
98 mov.l %d0,-(%sp)
99 mov.l (_060FPSP_TABLE-0x80+_off_done,%pc),%d0
100 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
101 mov.l 0x4(%sp),%d0
102 rtd &0x4
103
104 global _real_ovfl
105_real_ovfl:
106 mov.l %d0,-(%sp)
107 mov.l (_060FPSP_TABLE-0x80+_off_ovfl,%pc),%d0
108 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
109 mov.l 0x4(%sp),%d0
110 rtd &0x4
111
112 global _real_unfl
113_real_unfl:
114 mov.l %d0,-(%sp)
115 mov.l (_060FPSP_TABLE-0x80+_off_unfl,%pc),%d0
116 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
117 mov.l 0x4(%sp),%d0
118 rtd &0x4
119
120 global _real_inex
121_real_inex:
122 mov.l %d0,-(%sp)
123 mov.l (_060FPSP_TABLE-0x80+_off_inex,%pc),%d0
124 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
125 mov.l 0x4(%sp),%d0
126 rtd &0x4
127
128 global _real_bsun
129_real_bsun:
130 mov.l %d0,-(%sp)
131 mov.l (_060FPSP_TABLE-0x80+_off_bsun,%pc),%d0
132 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
133 mov.l 0x4(%sp),%d0
134 rtd &0x4
135
136 global _real_operr
137_real_operr:
138 mov.l %d0,-(%sp)
139 mov.l (_060FPSP_TABLE-0x80+_off_operr,%pc),%d0
140 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
141 mov.l 0x4(%sp),%d0
142 rtd &0x4
143
144 global _real_snan
145_real_snan:
146 mov.l %d0,-(%sp)
147 mov.l (_060FPSP_TABLE-0x80+_off_snan,%pc),%d0
148 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
149 mov.l 0x4(%sp),%d0
150 rtd &0x4
151
152 global _real_dz
153_real_dz:
154 mov.l %d0,-(%sp)
155 mov.l (_060FPSP_TABLE-0x80+_off_dz,%pc),%d0
156 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
157 mov.l 0x4(%sp),%d0
158 rtd &0x4
159
160 global _real_fline
161_real_fline:
162 mov.l %d0,-(%sp)
163 mov.l (_060FPSP_TABLE-0x80+_off_fline,%pc),%d0
164 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
165 mov.l 0x4(%sp),%d0
166 rtd &0x4
167
168 global _real_fpu_disabled
169_real_fpu_disabled:
170 mov.l %d0,-(%sp)
171 mov.l (_060FPSP_TABLE-0x80+_off_fpu_dis,%pc),%d0
172 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
173 mov.l 0x4(%sp),%d0
174 rtd &0x4
175
176 global _real_trap
177_real_trap:
178 mov.l %d0,-(%sp)
179 mov.l (_060FPSP_TABLE-0x80+_off_trap,%pc),%d0
180 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
181 mov.l 0x4(%sp),%d0
182 rtd &0x4
183
184 global _real_trace
185_real_trace:
186 mov.l %d0,-(%sp)
187 mov.l (_060FPSP_TABLE-0x80+_off_trace,%pc),%d0
188 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
189 mov.l 0x4(%sp),%d0
190 rtd &0x4
191
192 global _real_access
193_real_access:
194 mov.l %d0,-(%sp)
195 mov.l (_060FPSP_TABLE-0x80+_off_access,%pc),%d0
196 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
197 mov.l 0x4(%sp),%d0
198 rtd &0x4
199
200
201
202 global _imem_read
203_imem_read:
204 mov.l %d0,-(%sp)
205 mov.l (_060FPSP_TABLE-0x80+_off_imr,%pc),%d0
206 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
207 mov.l 0x4(%sp),%d0
208 rtd &0x4
209
210 global _dmem_read
211_dmem_read:
212 mov.l %d0,-(%sp)
213 mov.l (_060FPSP_TABLE-0x80+_off_dmr,%pc),%d0
214 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
215 mov.l 0x4(%sp),%d0
216 rtd &0x4
217
218 global _dmem_write
219_dmem_write:
220 mov.l %d0,-(%sp)
221 mov.l (_060FPSP_TABLE-0x80+_off_dmw,%pc),%d0
222 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
223 mov.l 0x4(%sp),%d0
224 rtd &0x4
225
226 global _imem_read_word
227_imem_read_word:
228 mov.l %d0,-(%sp)
229 mov.l (_060FPSP_TABLE-0x80+_off_irw,%pc),%d0
230 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
231 mov.l 0x4(%sp),%d0
232 rtd &0x4
233
234 global _imem_read_long
235_imem_read_long:
236 mov.l %d0,-(%sp)
237 mov.l (_060FPSP_TABLE-0x80+_off_irl,%pc),%d0
238 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
239 mov.l 0x4(%sp),%d0
240 rtd &0x4
241
242 global _dmem_read_byte
243_dmem_read_byte:
244 mov.l %d0,-(%sp)
245 mov.l (_060FPSP_TABLE-0x80+_off_drb,%pc),%d0
246 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
247 mov.l 0x4(%sp),%d0
248 rtd &0x4
249
250 global _dmem_read_word
251_dmem_read_word:
252 mov.l %d0,-(%sp)
253 mov.l (_060FPSP_TABLE-0x80+_off_drw,%pc),%d0
254 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
255 mov.l 0x4(%sp),%d0
256 rtd &0x4
257
258 global _dmem_read_long
259_dmem_read_long:
260 mov.l %d0,-(%sp)
261 mov.l (_060FPSP_TABLE-0x80+_off_drl,%pc),%d0
262 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
263 mov.l 0x4(%sp),%d0
264 rtd &0x4
265
266 global _dmem_write_byte
267_dmem_write_byte:
268 mov.l %d0,-(%sp)
269 mov.l (_060FPSP_TABLE-0x80+_off_dwb,%pc),%d0
270 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
271 mov.l 0x4(%sp),%d0
272 rtd &0x4
273
274 global _dmem_write_word
275_dmem_write_word:
276 mov.l %d0,-(%sp)
277 mov.l (_060FPSP_TABLE-0x80+_off_dww,%pc),%d0
278 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
279 mov.l 0x4(%sp),%d0
280 rtd &0x4
281
282 global _dmem_write_long
283_dmem_write_long:
284 mov.l %d0,-(%sp)
285 mov.l (_060FPSP_TABLE-0x80+_off_dwl,%pc),%d0
286 pea.l (_060FPSP_TABLE-0x80,%pc,%d0)
287 mov.l 0x4(%sp),%d0
288 rtd &0x4
289
290
291
292
293
294
295set LOCAL_SIZE, 192
296set LV, -LOCAL_SIZE
297
298set EXC_SR, 0x4
299set EXC_PC, 0x6
300set EXC_VOFF, 0xa
301set EXC_EA, 0xc
302
303set EXC_FP, 0x0
304
305set EXC_AREGS, -68
306set EXC_DREGS, -100
307set EXC_FPREGS, -36
308
309set EXC_A7, EXC_AREGS+(7*4)
310set OLD_A7, EXC_AREGS+(6*4)
311set EXC_A6, EXC_AREGS+(6*4)
312set EXC_A5, EXC_AREGS+(5*4)
313set EXC_A4, EXC_AREGS+(4*4)
314set EXC_A3, EXC_AREGS+(3*4)
315set EXC_A2, EXC_AREGS+(2*4)
316set EXC_A1, EXC_AREGS+(1*4)
317set EXC_A0, EXC_AREGS+(0*4)
318set EXC_D7, EXC_DREGS+(7*4)
319set EXC_D6, EXC_DREGS+(6*4)
320set EXC_D5, EXC_DREGS+(5*4)
321set EXC_D4, EXC_DREGS+(4*4)
322set EXC_D3, EXC_DREGS+(3*4)
323set EXC_D2, EXC_DREGS+(2*4)
324set EXC_D1, EXC_DREGS+(1*4)
325set EXC_D0, EXC_DREGS+(0*4)
326
327set EXC_FP0, EXC_FPREGS+(0*12)
328set EXC_FP1, EXC_FPREGS+(1*12)
329set EXC_FP2, EXC_FPREGS+(2*12)
330
331set FP_SCR1, LV+80
332set FP_SCR1_EX, FP_SCR1+0
333set FP_SCR1_SGN, FP_SCR1+2
334set FP_SCR1_HI, FP_SCR1+4
335set FP_SCR1_LO, FP_SCR1+8
336
337set FP_SCR0, LV+68
338set FP_SCR0_EX, FP_SCR0+0
339set FP_SCR0_SGN, FP_SCR0+2
340set FP_SCR0_HI, FP_SCR0+4
341set FP_SCR0_LO, FP_SCR0+8
342
343set FP_DST, LV+56
344set FP_DST_EX, FP_DST+0
345set FP_DST_SGN, FP_DST+2
346set FP_DST_HI, FP_DST+4
347set FP_DST_LO, FP_DST+8
348
349set FP_SRC, LV+44
350set FP_SRC_EX, FP_SRC+0
351set FP_SRC_SGN, FP_SRC+2
352set FP_SRC_HI, FP_SRC+4
353set FP_SRC_LO, FP_SRC+8
354
355set USER_FPIAR, LV+40
356
357set USER_FPSR, LV+36
358set FPSR_CC, USER_FPSR+0
359set FPSR_QBYTE, USER_FPSR+1
360set FPSR_EXCEPT, USER_FPSR+2
361set FPSR_AEXCEPT, USER_FPSR+3
362
363set USER_FPCR, LV+32
364set FPCR_ENABLE, USER_FPCR+2
365set FPCR_MODE, USER_FPCR+3
366
367set L_SCR3, LV+28
368set L_SCR2, LV+24
369set L_SCR1, LV+20
370
371set STORE_FLG, LV+19
372
373set EXC_TEMP2, LV+24
374set EXC_TEMP, LV+16
375
376set DTAG, LV+15
377set STAG, LV+14
378
379set SPCOND_FLG, LV+10
380
381set EXC_CC, LV+8
382set EXC_EXTWPTR, LV+4
383set EXC_EXTWORD, LV+2
384set EXC_CMDREG, LV+2
385set EXC_OPWORD, LV+0
386
387
388
389
390
391set FTEMP, 0
392set FTEMP_EX, 0
393set FTEMP_SGN, 2
394set FTEMP_HI, 4
395set FTEMP_LO, 8
396set FTEMP_GRS, 12
397
398set LOCAL, 0
399set LOCAL_EX, 0
400set LOCAL_SGN, 2
401set LOCAL_HI, 4
402set LOCAL_LO, 8
403set LOCAL_GRS, 12
404
405set DST, 0
406set DST_EX, 0
407set DST_HI, 4
408set DST_LO, 8
409
410set SRC, 0
411set SRC_EX, 0
412set SRC_HI, 4
413set SRC_LO, 8
414
415set SGL_LO, 0x3f81
416set SGL_HI, 0x407e
417set DBL_LO, 0x3c01
418set DBL_HI, 0x43fe
419set EXT_LO, 0x0
420set EXT_HI, 0x7ffe
421
422set EXT_BIAS, 0x3fff
423set SGL_BIAS, 0x007f
424set DBL_BIAS, 0x03ff
425
426set NORM, 0x00
427set ZERO, 0x01
428set INF, 0x02
429set QNAN, 0x03
430set DENORM, 0x04
431set SNAN, 0x05
432set UNNORM, 0x06
433
434
435
436
437set neg_bit, 0x3
438set z_bit, 0x2
439set inf_bit, 0x1
440set nan_bit, 0x0
441
442set q_sn_bit, 0x7
443
444set bsun_bit, 7
445set snan_bit, 6
446set operr_bit, 5
447set ovfl_bit, 4
448set unfl_bit, 3
449set dz_bit, 2
450set inex2_bit, 1
451set inex1_bit, 0
452
453set aiop_bit, 7
454set aovfl_bit, 6
455set aunfl_bit, 5
456set adz_bit, 4
457set ainex_bit, 3
458
459
460
461
462set neg_mask, 0x08000000
463set inf_mask, 0x02000000
464set z_mask, 0x04000000
465set nan_mask, 0x01000000
466
467set neg_bmask, 0x08
468set inf_bmask, 0x02
469set z_bmask, 0x04
470set nan_bmask, 0x01
471
472set bsun_mask, 0x00008000
473set snan_mask, 0x00004000
474set operr_mask, 0x00002000
475set ovfl_mask, 0x00001000
476set unfl_mask, 0x00000800
477set dz_mask, 0x00000400
478set inex2_mask, 0x00000200
479set inex1_mask, 0x00000100
480
481set aiop_mask, 0x00000080
482set aovfl_mask, 0x00000040
483set aunfl_mask, 0x00000020
484set adz_mask, 0x00000010
485set ainex_mask, 0x00000008
486
487
488
489
490set dzinf_mask, inf_mask+dz_mask+adz_mask
491set opnan_mask, nan_mask+operr_mask+aiop_mask
492set nzi_mask, 0x01ffffff
493set unfinx_mask, unfl_mask+inex2_mask+aunfl_mask+ainex_mask
494set unf2inx_mask, unfl_mask+inex2_mask+ainex_mask
495set ovfinx_mask, ovfl_mask+inex2_mask+aovfl_mask+ainex_mask
496set inx1a_mask, inex1_mask+ainex_mask
497set inx2a_mask, inex2_mask+ainex_mask
498set snaniop_mask, nan_mask+snan_mask+aiop_mask
499set snaniop2_mask, snan_mask+aiop_mask
500set naniop_mask, nan_mask+aiop_mask
501set neginf_mask, neg_mask+inf_mask
502set infaiop_mask, inf_mask+aiop_mask
503set negz_mask, neg_mask+z_mask
504set opaop_mask, operr_mask+aiop_mask
505set unfl_inx_mask, unfl_mask+aunfl_mask+ainex_mask
506set ovfl_inx_mask, ovfl_mask+aovfl_mask+ainex_mask
507
508
509
510
511set rnd_stky_bit, 29
512
513set sign_bit, 0x7
514set signan_bit, 0x6
515
516set sgl_thresh, 0x3f81
517set dbl_thresh, 0x3c01
518
519set x_mode, 0x0
520set s_mode, 0x4
521set d_mode, 0x8
522
523set rn_mode, 0x0
524set rz_mode, 0x1
525set rm_mode, 0x2
526set rp_mode, 0x3
527
528set mantissalen, 64
529
530set BYTE, 1
531set WORD, 2
532set LONG, 4
533
534set BSUN_VEC, 0xc0
535set INEX_VEC, 0xc4
536set DZ_VEC, 0xc8
537set UNFL_VEC, 0xcc
538set OPERR_VEC, 0xd0
539set OVFL_VEC, 0xd4
540set SNAN_VEC, 0xd8
541
542
543
544
545set ftrapcc_flg, 0x01
546set fbsun_flg, 0x02
547set mia7_flg, 0x04
548set mda7_flg, 0x08
549set fmovm_flg, 0x40
550set immed_flg, 0x80
551
552set ftrapcc_bit, 0x0
553set fbsun_bit, 0x1
554set mia7_bit, 0x2
555set mda7_bit, 0x3
556set immed_bit, 0x7
557
558
559
560
561set FMUL_OP, 0x0
562set FDIV_OP, 0x1
563set FADD_OP, 0x2
564set FMOV_OP, 0x3
565
566
567
568
569T1: long 0x40C62D38,0xD3D64634
570T2: long 0x3D6F90AE,0xB1E75CC7
571
572PI: long 0x40000000,0xC90FDAA2,0x2168C235,0x00000000
573PIBY2: long 0x3FFF0000,0xC90FDAA2,0x2168C235,0x00000000
574
575TWOBYPI:
576 long 0x3FE45F30,0x6DC9C883
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636 global _fpsp_ovfl
637_fpsp_ovfl:
638
639
640
641 link.w %a6,&-LOCAL_SIZE
642
643 fsave FP_SRC(%a6)
644
645 movm.l &0x0303,EXC_DREGS(%a6)
646 fmovm.l %fpcr,%fpsr,%fpiar,USER_FPCR(%a6)
647 fmovm.x &0xc0,EXC_FPREGS(%a6)
648
649
650 mov.l USER_FPIAR(%a6),EXC_EXTWPTR(%a6)
651 mov.l EXC_EXTWPTR(%a6),%a0
652 addq.l &0x4,EXC_EXTWPTR(%a6)
653 bsr.l _imem_read_long
654 mov.l %d0,EXC_OPWORD(%a6)
655
656
657
658 btst &0x5,EXC_CMDREG(%a6)
659 bne.w fovfl_out
660
661
662 lea FP_SRC(%a6),%a0
663 bsr.l fix_skewed_ops
664
665
666
667 lea FP_SRC(%a6),%a0
668 bsr.l set_tag_x
669 mov.b %d0,STAG(%a6)
670
671
672
673
674 btst &0x5,1+EXC_CMDREG(%a6)
675 beq.b fovfl_extract
676
677 bfextu EXC_CMDREG(%a6){&6:&3},%d0
678 bsr.l load_fpn2
679
680 lea FP_DST(%a6),%a0
681 bsr.l set_tag_x
682 cmpi.b %d0,&UNNORM
683 bne.b fovfl_op2_done
684 bsr.l unnorm_fix
685fovfl_op2_done:
686 mov.b %d0,DTAG(%a6)
687
688fovfl_extract:
689
690
691
692
693
694
695
696
697 clr.l %d0
698 mov.b FPCR_MODE(%a6),%d0
699
700 mov.b 1+EXC_CMDREG(%a6),%d1
701 andi.w &0x007f,%d1
702
703 andi.l &0x00ff01ff,USER_FPSR(%a6)
704
705 fmov.l &0x0,%fpcr
706 fmov.l &0x0,%fpsr
707
708 lea FP_SRC(%a6),%a0
709 lea FP_DST(%a6),%a1
710
711
712 mov.l (tbl_unsupp.l,%pc,%d1.w*4),%d1
713 jsr (tbl_unsupp.l,%pc,%d1.l*1)
714
715
716
717
718
719 bfextu EXC_CMDREG(%a6){&6:&3},%d0
720 bsr.l store_fpreg
721
722
723
724
725 btst &ovfl_bit,FPCR_ENABLE(%a6)
726 bne.b fovfl_ovfl_on
727
728 btst &inex2_bit,FPCR_ENABLE(%a6)
729 bne.b fovfl_inex_on
730
731 fmovm.x EXC_FPREGS(%a6),&0xc0
732 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
733 movm.l EXC_DREGS(%a6),&0x0303
734
735 unlk %a6
736
737 bra.l _fpsp_done
738
739
740
741fovfl_ovfl_on:
742 fmovm.x &0x40,FP_SRC(%a6)
743
744 mov.w &0xe005,2+FP_SRC(%a6)
745
746 fmovm.x EXC_FPREGS(%a6),&0xc0
747 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
748 movm.l EXC_DREGS(%a6),&0x0303
749
750 frestore FP_SRC(%a6)
751
752 unlk %a6
753
754 bra.l _real_ovfl
755
756
757
758fovfl_inex_on:
759
760 fmovm.x &0x40,FP_SRC(%a6)
761
762 mov.b &0xc4,1+EXC_VOFF(%a6)
763 mov.w &0xe001,2+FP_SRC(%a6)
764
765 fmovm.x EXC_FPREGS(%a6),&0xc0
766 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
767 movm.l EXC_DREGS(%a6),&0x0303
768
769 frestore FP_SRC(%a6)
770
771 unlk %a6
772
773 bra.l _real_inex
774
775
776fovfl_out:
777
778
779
780
781
782
783
784 mov.b &NORM,STAG(%a6)
785
786 clr.l %d0
787 mov.b FPCR_MODE(%a6),%d0
788
789 and.l &0xffff00ff,USER_FPSR(%a6)
790
791 fmov.l &0x0,%fpcr
792 fmov.l &0x0,%fpsr
793
794 lea FP_SRC(%a6),%a0
795
796 bsr.l fout
797
798 btst &ovfl_bit,FPCR_ENABLE(%a6)
799 bne.w fovfl_ovfl_on
800
801 btst &inex2_bit,FPCR_ENABLE(%a6)
802 bne.w fovfl_inex_on
803
804 fmovm.x EXC_FPREGS(%a6),&0xc0
805 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
806 movm.l EXC_DREGS(%a6),&0x0303
807
808 unlk %a6
809
810
811 btst &0x7,(%sp)
812 beq.l _fpsp_done
813
814 fmov.l %fpiar,0x8(%sp)
815 mov.w &0x2024,0x6(%sp)
816 bra.l _real_trace
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876 global _fpsp_unfl
877_fpsp_unfl:
878
879
880
881 link.w %a6,&-LOCAL_SIZE
882
883 fsave FP_SRC(%a6)
884
885 movm.l &0x0303,EXC_DREGS(%a6)
886 fmovm.l %fpcr,%fpsr,%fpiar,USER_FPCR(%a6)
887 fmovm.x &0xc0,EXC_FPREGS(%a6)
888
889
890 mov.l USER_FPIAR(%a6),EXC_EXTWPTR(%a6)
891 mov.l EXC_EXTWPTR(%a6),%a0
892 addq.l &0x4,EXC_EXTWPTR(%a6)
893 bsr.l _imem_read_long
894 mov.l %d0,EXC_OPWORD(%a6)
895
896
897
898 btst &0x5,EXC_CMDREG(%a6)
899 bne.w funfl_out
900
901
902 lea FP_SRC(%a6),%a0
903 bsr.l fix_skewed_ops
904
905 lea FP_SRC(%a6),%a0
906 bsr.l set_tag_x
907 mov.b %d0,STAG(%a6)
908
909
910
911
912 btst &0x5,1+EXC_CMDREG(%a6)
913 beq.b funfl_extract
914
915
916
917 btst &0x4,1+EXC_CMDREG(%a6)
918 bne.b funfl_extract
919
920 bfextu EXC_CMDREG(%a6){&6:&3},%d0
921 bsr.l load_fpn2
922
923 lea FP_DST(%a6),%a0
924 bsr.l set_tag_x
925 cmpi.b %d0,&UNNORM
926 bne.b funfl_op2_done
927 bsr.l unnorm_fix
928funfl_op2_done:
929 mov.b %d0,DTAG(%a6)
930
931funfl_extract:
932
933
934
935
936
937
938
939
940 clr.l %d0
941 mov.b FPCR_MODE(%a6),%d0
942
943 mov.b 1+EXC_CMDREG(%a6),%d1
944 andi.w &0x007f,%d1
945
946 andi.l &0x00ff01ff,USER_FPSR(%a6)
947
948 fmov.l &0x0,%fpcr
949 fmov.l &0x0,%fpsr
950
951 lea FP_SRC(%a6),%a0
952 lea FP_DST(%a6),%a1
953
954
955 mov.l (tbl_unsupp.l,%pc,%d1.w*4),%d1
956 jsr (tbl_unsupp.l,%pc,%d1.l*1)
957
958 bfextu EXC_CMDREG(%a6){&6:&3},%d0
959 bsr.l store_fpreg
960
961
962
963
964
965
966
967
968
969
970
971
972
973 btst &unfl_bit,FPCR_ENABLE(%a6)
974 bne.b funfl_unfl_on
975
976funfl_chkinex:
977 btst &inex2_bit,FPCR_ENABLE(%a6)
978 bne.b funfl_inex_on
979
980funfl_exit:
981 fmovm.x EXC_FPREGS(%a6),&0xc0
982 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
983 movm.l EXC_DREGS(%a6),&0x0303
984
985 unlk %a6
986
987 bra.l _fpsp_done
988
989
990
991
992funfl_unfl_on:
993
994
995
996
997
998
999
1000 btst &unfl_bit,FPSR_EXCEPT(%a6)
1001 beq.w funfl_chkinex
1002
1003funfl_unfl_on2:
1004 fmovm.x &0x40,FP_SRC(%a6)
1005
1006 mov.w &0xe003,2+FP_SRC(%a6)
1007
1008 fmovm.x EXC_FPREGS(%a6),&0xc0
1009 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
1010 movm.l EXC_DREGS(%a6),&0x0303
1011
1012 frestore FP_SRC(%a6)
1013
1014 unlk %a6
1015
1016 bra.l _real_unfl
1017
1018
1019
1020funfl_inex_on:
1021
1022
1023
1024
1025
1026
1027
1028
1029 btst &inex2_bit,FPSR_EXCEPT(%a6)
1030 beq.w funfl_exit
1031
1032funfl_inex_on2:
1033
1034 fmovm.x &0x40,FP_SRC(%a6)
1035
1036 mov.b &0xc4,1+EXC_VOFF(%a6)
1037 mov.w &0xe001,2+FP_SRC(%a6)
1038
1039 fmovm.x EXC_FPREGS(%a6),&0xc0
1040 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
1041 movm.l EXC_DREGS(%a6),&0x0303
1042
1043 frestore FP_SRC(%a6)
1044
1045 unlk %a6
1046
1047 bra.l _real_inex
1048
1049
1050funfl_out:
1051
1052
1053
1054
1055
1056
1057
1058 mov.b &NORM,STAG(%a6)
1059
1060 clr.l %d0
1061 mov.b FPCR_MODE(%a6),%d0
1062
1063 and.l &0xffff00ff,USER_FPSR(%a6)
1064
1065 fmov.l &0x0,%fpcr
1066 fmov.l &0x0,%fpsr
1067
1068 lea FP_SRC(%a6),%a0
1069
1070 bsr.l fout
1071
1072 btst &unfl_bit,FPCR_ENABLE(%a6)
1073 bne.w funfl_unfl_on2
1074
1075 btst &inex2_bit,FPCR_ENABLE(%a6)
1076 bne.w funfl_inex_on2
1077
1078 fmovm.x EXC_FPREGS(%a6),&0xc0
1079 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
1080 movm.l EXC_DREGS(%a6),&0x0303
1081
1082 unlk %a6
1083
1084
1085 btst &0x7,(%sp)
1086 beq.l _fpsp_done
1087
1088 fmov.l %fpiar,0x8(%sp)
1089 mov.w &0x2024,0x6(%sp)
1090 bra.l _real_trace
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203 global _fpsp_unsupp
1204_fpsp_unsupp:
1205
1206 link.w %a6,&-LOCAL_SIZE
1207
1208 fsave FP_SRC(%a6)
1209
1210 movm.l &0x0303,EXC_DREGS(%a6)
1211 fmovm.l %fpcr,%fpsr,%fpiar,USER_FPCR(%a6)
1212 fmovm.x &0xc0,EXC_FPREGS(%a6)
1213
1214 btst &0x5,EXC_SR(%a6)
1215 bne.b fu_s
1216fu_u:
1217 mov.l %usp,%a0
1218 mov.l %a0,EXC_A7(%a6)
1219 bra.b fu_cont
1220
1221
1222
1223fu_s:
1224 lea 0x4+EXC_EA(%a6),%a0
1225 mov.l %a0,EXC_A7(%a6)
1226
1227fu_cont:
1228
1229
1230
1231
1232 mov.l USER_FPIAR(%a6),EXC_EXTWPTR(%a6)
1233 mov.l EXC_EXTWPTR(%a6),%a0
1234 addq.l &0x4,EXC_EXTWPTR(%a6)
1235 bsr.l _imem_read_long
1236 mov.l %d0,EXC_OPWORD(%a6)
1237
1238
1239
1240 clr.b SPCOND_FLG(%a6)
1241
1242
1243
1244 btst &0x5,EXC_CMDREG(%a6)
1245 bne.w fu_out
1246
1247
1248 bfextu EXC_CMDREG(%a6){&0:&6},%d0
1249 cmpi.b %d0,&0x13
1250 beq.w fu_in_pack
1251
1252
1253
1254
1255 andi.l &0x00ff00ff,USER_FPSR(%a6)
1256
1257 fmov.l &0x0,%fpcr
1258 fmov.l &0x0,%fpsr
1259
1260
1261
1262
1263 lea FP_SRC(%a6),%a0
1264 bsr.l fix_skewed_ops
1265
1266
1267
1268
1269 lea FP_SRC(%a6),%a0
1270 bsr.l set_tag_x
1271 cmpi.b %d0,&UNNORM
1272 bne.b fu_op2
1273 bsr.l unnorm_fix
1274
1275fu_op2:
1276 mov.b %d0,STAG(%a6)
1277
1278 bfextu EXC_CMDREG(%a6){&6:&3},%d0
1279
1280
1281
1282 btst &0x5,1+EXC_CMDREG(%a6)
1283 beq.b fu_extract
1284 cmpi.b 1+EXC_CMDREG(%a6),&0x3a
1285 beq.b fu_extract
1286
1287 bsr.l load_fpn2
1288
1289 lea FP_DST(%a6),%a0
1290 bsr.l set_tag_x
1291 cmpi.b %d0,&UNNORM
1292 bne.b fu_op2_done
1293 bsr.l unnorm_fix
1294fu_op2_done:
1295 mov.b %d0,DTAG(%a6)
1296
1297fu_extract:
1298 clr.l %d0
1299 mov.b FPCR_MODE(%a6),%d0
1300
1301 bfextu 1+EXC_CMDREG(%a6){&1:&7},%d1
1302
1303 lea FP_SRC(%a6),%a0
1304 lea FP_DST(%a6),%a1
1305
1306 mov.l (tbl_unsupp.l,%pc,%d1.l*4),%d1
1307 jsr (tbl_unsupp.l,%pc,%d1.l*1)
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323 mov.b FPCR_ENABLE(%a6),%d0
1324 bne.b fu_in_ena
1325
1326fu_in_cont:
1327
1328 mov.b 1+EXC_CMDREG(%a6),%d0
1329 andi.b &0x38,%d0
1330 cmpi.b %d0,&0x38
1331 beq.b fu_in_exit
1332
1333 bfextu EXC_CMDREG(%a6){&6:&3},%d0
1334 bsr.l store_fpreg
1335
1336fu_in_exit:
1337
1338 fmovm.x EXC_FPREGS(%a6),&0xc0
1339 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
1340 movm.l EXC_DREGS(%a6),&0x0303
1341
1342 unlk %a6
1343
1344 bra.l _fpsp_done
1345
1346fu_in_ena:
1347 and.b FPSR_EXCEPT(%a6),%d0
1348 bfffo %d0{&24:&8},%d0
1349 bne.b fu_in_exc
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361 btst &ovfl_bit,FPSR_EXCEPT(%a6)
1362 beq.b fu_in_cont
1363
1364fu_in_ovflchk:
1365 btst &inex2_bit,FPCR_ENABLE(%a6)
1366 beq.b fu_in_cont
1367 bra.w fu_in_exc_ovfl
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384fu_in_exc:
1385 subi.l &24,%d0
1386 cmpi.b %d0,&0x6
1387 bne.b fu_in_exc_exit
1388
1389
1390 btst &unfl_bit,FPSR_EXCEPT(%a6)
1391 bne.w fu_in_exc_unfl
1392 btst &ovfl_bit,FPSR_EXCEPT(%a6)
1393 bne.w fu_in_exc_ovfl
1394
1395
1396
1397
1398fu_in_exc_exit:
1399 mov.l %d0,-(%sp)
1400 bsr.l funimp_skew
1401 mov.l (%sp)+,%d0
1402
1403 mov.w (tbl_except.b,%pc,%d0.w*2),2+FP_SRC(%a6)
1404
1405 fmovm.x EXC_FPREGS(%a6),&0xc0
1406 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
1407 movm.l EXC_DREGS(%a6),&0x0303
1408
1409 frestore FP_SRC(%a6)
1410
1411 unlk %a6
1412
1413 bra.l _fpsp_done
1414
1415tbl_except:
1416 short 0xe000,0xe006,0xe004,0xe005
1417 short 0xe003,0xe002,0xe001,0xe001
1418
1419fu_in_exc_unfl:
1420 mov.w &0x4,%d0
1421 bra.b fu_in_exc_exit
1422fu_in_exc_ovfl:
1423 mov.w &0x03,%d0
1424 bra.b fu_in_exc_exit
1425
1426
1427
1428
1429
1430 global fix_skewed_ops
1431fix_skewed_ops:
1432 bfextu EXC_CMDREG(%a6){&0:&6},%d0
1433 cmpi.b %d0,&0x11
1434 beq.b fso_sgl
1435 cmpi.b %d0,&0x15
1436 beq.b fso_dbl
1437 rts
1438
1439fso_sgl:
1440 mov.w LOCAL_EX(%a0),%d0
1441 andi.w &0x7fff,%d0
1442 cmpi.w %d0,&0x3f80
1443 beq.b fso_sgl_dnrm_zero
1444 cmpi.w %d0,&0x407f
1445 beq.b fso_infnan
1446 rts
1447
1448fso_sgl_dnrm_zero:
1449 andi.l &0x7fffffff,LOCAL_HI(%a0)
1450 beq.b fso_zero
1451fso_sgl_dnrm:
1452
1453 bsr.l norm
1454 neg.w %d0
1455 addi.w &0x3f81,%d0
1456 andi.w &0x8000,LOCAL_EX(%a0)
1457 or.w %d0,LOCAL_EX(%a0)
1458 rts
1459
1460fso_zero:
1461 andi.w &0x8000,LOCAL_EX(%a0)
1462 rts
1463
1464fso_infnan:
1465 andi.b &0x7f,LOCAL_HI(%a0)
1466 ori.w &0x7fff,LOCAL_EX(%a0)
1467 rts
1468
1469fso_dbl:
1470 mov.w LOCAL_EX(%a0),%d0
1471 andi.w &0x7fff,%d0
1472 cmpi.w %d0,&0x3c00
1473 beq.b fso_dbl_dnrm_zero
1474 cmpi.w %d0,&0x43ff
1475 beq.b fso_infnan
1476 rts
1477
1478fso_dbl_dnrm_zero:
1479 andi.l &0x7fffffff,LOCAL_HI(%a0)
1480 bne.b fso_dbl_dnrm
1481 tst.l LOCAL_LO(%a0)
1482 beq.b fso_zero
1483fso_dbl_dnrm:
1484
1485 bsr.l norm
1486 neg.w %d0
1487 addi.w &0x3c01,%d0
1488 andi.w &0x8000,LOCAL_EX(%a0)
1489 or.w %d0,LOCAL_EX(%a0)
1490 rts
1491
1492
1493
1494
1495
1496
1497fu_out:
1498
1499
1500 bfextu EXC_CMDREG(%a6){&3:&3},%d0
1501 cmpi.b %d0,&0x3
1502 beq.w fu_out_pack
1503 cmpi.b %d0,&0x7
1504 beq.w fu_out_pack
1505
1506
1507
1508
1509
1510 and.l &0xffff00ff,USER_FPSR(%a6)
1511
1512 fmov.l &0x0,%fpcr
1513 fmov.l &0x0,%fpsr
1514
1515
1516
1517 mov.w FP_SRC_EX(%a6),%d0
1518 andi.w &0x7fff,%d0
1519 beq.b fu_out_denorm
1520
1521 lea FP_SRC(%a6),%a0
1522 bsr.l unnorm_fix
1523
1524 mov.b %d0,STAG(%a6)
1525
1526 bra.b fu_out_cont
1527fu_out_denorm:
1528 mov.b &DENORM,STAG(%a6)
1529fu_out_cont:
1530
1531 clr.l %d0
1532 mov.b FPCR_MODE(%a6),%d0
1533
1534 lea FP_SRC(%a6),%a0
1535
1536 mov.l (%a6),EXC_A6(%a6)
1537 bsr.l fout
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551 mov.b FPCR_ENABLE(%a6),%d0
1552 bne.w fu_out_ena
1553
1554fu_out_done:
1555
1556 mov.l EXC_A6(%a6),(%a6)
1557
1558
1559
1560
1561
1562
1563 btst &0x5,EXC_SR(%a6)
1564 bne.b fu_out_done_s
1565
1566 mov.l EXC_A7(%a6),%a0
1567 mov.l %a0,%usp
1568
1569fu_out_done_cont:
1570 fmovm.x EXC_FPREGS(%a6),&0xc0
1571 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
1572 movm.l EXC_DREGS(%a6),&0x0303
1573
1574 unlk %a6
1575
1576 btst &0x7,(%sp)
1577 bne.b fu_out_trace
1578
1579 bra.l _fpsp_done
1580
1581
1582
1583fu_out_done_s:
1584 cmpi.b SPCOND_FLG(%a6),&mda7_flg
1585 bne.b fu_out_done_cont
1586
1587
1588
1589
1590
1591
1592 fmovm.x &0x80,FP_SRC(%a6)
1593
1594 fmovm.x EXC_FPREGS(%a6),&0xc0
1595 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
1596 movm.l EXC_DREGS(%a6),&0x0303
1597
1598 mov.l (%a6),%a6
1599
1600 mov.l LOCAL_SIZE+EXC_SR(%sp),LOCAL_SIZE+EXC_SR-0xc(%sp)
1601 mov.l LOCAL_SIZE+2+EXC_PC(%sp),LOCAL_SIZE+2+EXC_PC-0xc(%sp)
1602
1603
1604 mov.l LOCAL_SIZE+FP_SRC_EX(%sp),LOCAL_SIZE+EXC_SR+0x0(%sp)
1605 mov.l LOCAL_SIZE+FP_SRC_HI(%sp),LOCAL_SIZE+EXC_SR+0x4(%sp)
1606 mov.l LOCAL_SIZE+FP_SRC_LO(%sp),LOCAL_SIZE+EXC_SR+0x8(%sp)
1607
1608 add.l &LOCAL_SIZE-0x8,%sp
1609
1610 btst &0x7,(%sp)
1611 bne.b fu_out_trace
1612
1613 bra.l _fpsp_done
1614
1615fu_out_ena:
1616 and.b FPSR_EXCEPT(%a6),%d0
1617 bfffo %d0{&24:&8},%d0
1618 bne.b fu_out_exc
1619
1620
1621
1622
1623 btst &ovfl_bit,FPSR_EXCEPT(%a6)
1624 beq.w fu_out_done
1625
1626fu_out_ovflchk:
1627 btst &inex2_bit,FPCR_ENABLE(%a6)
1628 beq.w fu_out_done
1629 bra.w fu_inex
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649fu_out_trace:
1650 mov.w &0x2024,0x6(%sp)
1651 fmov.l %fpiar,0x8(%sp)
1652 bra.l _real_trace
1653
1654
1655fu_out_exc:
1656 subi.l &24,%d0
1657
1658
1659
1660 mov.w (tbl_fu_out.b,%pc,%d0.w*2),%d0
1661 jmp (tbl_fu_out.b,%pc,%d0.w*1)
1662
1663 swbeg &0x8
1664tbl_fu_out:
1665 short tbl_fu_out - tbl_fu_out
1666 short tbl_fu_out - tbl_fu_out
1667 short fu_operr - tbl_fu_out
1668 short fu_ovfl - tbl_fu_out
1669 short fu_unfl - tbl_fu_out
1670 short tbl_fu_out - tbl_fu_out
1671 short fu_inex - tbl_fu_out
1672 short tbl_fu_out - tbl_fu_out
1673
1674
1675
1676fu_snan:
1677 fmovm.x EXC_FPREGS(%a6),&0xc0
1678 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
1679 movm.l EXC_DREGS(%a6),&0x0303
1680
1681 mov.w &0x30d8,EXC_VOFF(%a6)
1682 mov.w &0xe006,2+FP_SRC(%a6)
1683
1684 frestore FP_SRC(%a6)
1685
1686 unlk %a6
1687
1688
1689 bra.l _real_snan
1690
1691fu_operr:
1692 fmovm.x EXC_FPREGS(%a6),&0xc0
1693 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
1694 movm.l EXC_DREGS(%a6),&0x0303
1695
1696 mov.w &0x30d0,EXC_VOFF(%a6)
1697 mov.w &0xe004,2+FP_SRC(%a6)
1698
1699 frestore FP_SRC(%a6)
1700
1701 unlk %a6
1702
1703
1704 bra.l _real_operr
1705
1706fu_ovfl:
1707 fmovm.x &0x40,FP_SRC(%a6)
1708
1709 fmovm.x EXC_FPREGS(%a6),&0xc0
1710 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
1711 movm.l EXC_DREGS(%a6),&0x0303
1712
1713 mov.w &0x30d4,EXC_VOFF(%a6)
1714 mov.w &0xe005,2+FP_SRC(%a6)
1715
1716 frestore FP_SRC(%a6)
1717
1718 unlk %a6
1719
1720 bra.l _real_ovfl
1721
1722
1723
1724
1725
1726fu_unfl:
1727 mov.l EXC_A6(%a6),(%a6)
1728
1729 btst &0x5,EXC_SR(%a6)
1730 bne.w fu_unfl_s
1731
1732 mov.l EXC_A7(%a6),%a0
1733 mov.l %a0,%usp
1734
1735fu_unfl_cont:
1736 fmovm.x &0x40,FP_SRC(%a6)
1737
1738 fmovm.x EXC_FPREGS(%a6),&0xc0
1739 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
1740 movm.l EXC_DREGS(%a6),&0x0303
1741
1742 mov.w &0x30cc,EXC_VOFF(%a6)
1743 mov.w &0xe003,2+FP_SRC(%a6)
1744
1745 frestore FP_SRC(%a6)
1746
1747 unlk %a6
1748
1749 bra.l _real_unfl
1750
1751fu_unfl_s:
1752 cmpi.b SPCOND_FLG(%a6),&mda7_flg
1753 bne.b fu_unfl_cont
1754
1755
1756
1757
1758
1759 fmovm.x &0x80,FP_SRC(%a6)
1760 fmovm.x &0x40,FP_DST(%a6)
1761
1762 fmovm.x EXC_FPREGS(%a6),&0xc0
1763 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
1764 movm.l EXC_DREGS(%a6),&0x0303
1765
1766 mov.w &0x30cc,EXC_VOFF(%a6)
1767 mov.w &0xe003,2+FP_DST(%a6)
1768
1769 frestore FP_DST(%a6)
1770
1771 mov.l (%a6),%a6
1772
1773 mov.l LOCAL_SIZE+EXC_SR(%sp),LOCAL_SIZE+EXC_SR-0xc(%sp)
1774 mov.l LOCAL_SIZE+2+EXC_PC(%sp),LOCAL_SIZE+2+EXC_PC-0xc(%sp)
1775 mov.l LOCAL_SIZE+EXC_EA(%sp),LOCAL_SIZE+EXC_EA-0xc(%sp)
1776
1777
1778 mov.l LOCAL_SIZE+FP_SRC_EX(%sp),LOCAL_SIZE+EXC_SR+0x0(%sp)
1779 mov.l LOCAL_SIZE+FP_SRC_HI(%sp),LOCAL_SIZE+EXC_SR+0x4(%sp)
1780 mov.l LOCAL_SIZE+FP_SRC_LO(%sp),LOCAL_SIZE+EXC_SR+0x8(%sp)
1781
1782 add.l &LOCAL_SIZE-0x8,%sp
1783
1784 bra.l _real_unfl
1785
1786
1787fu_inex:
1788 fmovm.x &0x40,FP_SRC(%a6)
1789
1790 fmovm.x EXC_FPREGS(%a6),&0xc0
1791 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
1792 movm.l EXC_DREGS(%a6),&0x0303
1793
1794 mov.w &0x30c4,EXC_VOFF(%a6)
1795 mov.w &0xe001,2+FP_SRC(%a6)
1796
1797 frestore FP_SRC(%a6)
1798
1799 unlk %a6
1800
1801
1802 bra.l _real_inex
1803
1804
1805
1806fu_in_pack:
1807
1808
1809
1810
1811 andi.l &0x0ff00ff,USER_FPSR(%a6)
1812
1813 fmov.l &0x0,%fpcr
1814 fmov.l &0x0,%fpsr
1815
1816 bsr.l get_packed
1817
1818 lea FP_SRC(%a6),%a0
1819 bsr.l set_tag_x
1820
1821 mov.b %d0,STAG(%a6)
1822
1823 bfextu EXC_CMDREG(%a6){&6:&3},%d0
1824
1825
1826
1827 btst &0x5,1+EXC_CMDREG(%a6)
1828 beq.b fu_extract_p
1829 cmpi.b 1+EXC_CMDREG(%a6),&0x3a
1830 beq.b fu_extract_p
1831
1832 bsr.l load_fpn2
1833
1834 lea FP_DST(%a6),%a0
1835 bsr.l set_tag_x
1836 cmpi.b %d0,&UNNORM
1837 bne.b fu_op2_done_p
1838 bsr.l unnorm_fix
1839fu_op2_done_p:
1840 mov.b %d0,DTAG(%a6)
1841
1842fu_extract_p:
1843 clr.l %d0
1844 mov.b FPCR_MODE(%a6),%d0
1845
1846 bfextu 1+EXC_CMDREG(%a6){&1:&7},%d1
1847
1848 lea FP_SRC(%a6),%a0
1849 lea FP_DST(%a6),%a1
1850
1851 mov.l (tbl_unsupp.l,%pc,%d1.l*4),%d1
1852 jsr (tbl_unsupp.l,%pc,%d1.l*1)
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868 mov.b FPCR_ENABLE(%a6),%d0
1869 bne.w fu_in_ena_p
1870
1871fu_in_cont_p:
1872
1873 mov.b 1+EXC_CMDREG(%a6),%d0
1874 andi.b &0x38,%d0
1875 cmpi.b %d0,&0x38
1876 beq.b fu_in_exit_p
1877
1878 bfextu EXC_CMDREG(%a6){&6:&3},%d0
1879 bsr.l store_fpreg
1880
1881fu_in_exit_p:
1882
1883 btst &0x5,EXC_SR(%a6)
1884 bne.w fu_in_exit_s_p
1885
1886 mov.l EXC_A7(%a6),%a0
1887 mov.l %a0,%usp
1888
1889fu_in_exit_cont_p:
1890 fmovm.x EXC_FPREGS(%a6),&0xc0
1891 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
1892 movm.l EXC_DREGS(%a6),&0x0303
1893
1894 unlk %a6
1895
1896 btst &0x7,(%sp)
1897 bne.w fu_trace_p
1898
1899 bra.l _fpsp_done
1900
1901
1902
1903
1904fu_in_exit_s_p:
1905 btst &mia7_bit,SPCOND_FLG(%a6)
1906 beq.b fu_in_exit_cont_p
1907
1908 fmovm.x EXC_FPREGS(%a6),&0xc0
1909 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
1910 movm.l EXC_DREGS(%a6),&0x0303
1911
1912 unlk %a6
1913
1914
1915 mov.l 0x4(%sp),0x10(%sp)
1916 mov.l 0x0(%sp),0xc(%sp)
1917 add.l &0xc,%sp
1918
1919 btst &0x7,(%sp)
1920 bne.w fu_trace_p
1921
1922 bra.l _fpsp_done
1923
1924fu_in_ena_p:
1925 and.b FPSR_EXCEPT(%a6),%d0
1926 bfffo %d0{&24:&8},%d0
1927 bne.b fu_in_exc_p
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939 btst &ovfl_bit,FPSR_EXCEPT(%a6)
1940 beq.w fu_in_cont_p
1941
1942fu_in_ovflchk_p:
1943 btst &inex2_bit,FPCR_ENABLE(%a6)
1944 beq.w fu_in_cont_p
1945 bra.w fu_in_exc_ovfl_p
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962fu_in_exc_p:
1963 subi.l &24,%d0
1964 cmpi.b %d0,&0x6
1965 blt.b fu_in_exc_exit_p
1966
1967
1968 btst &unfl_bit,FPSR_EXCEPT(%a6)
1969 bne.w fu_in_exc_unfl_p
1970 btst &ovfl_bit,FPSR_EXCEPT(%a6)
1971 bne.w fu_in_exc_ovfl_p
1972
1973
1974
1975
1976
1977
1978
1979fu_in_exc_exit_p:
1980 btst &0x5,EXC_SR(%a6)
1981 bne.w fu_in_exc_exit_s_p
1982
1983 mov.l EXC_A7(%a6),%a0
1984 mov.l %a0,%usp
1985
1986fu_in_exc_exit_cont_p:
1987 mov.w (tbl_except_p.b,%pc,%d0.w*2),2+FP_SRC(%a6)
1988
1989 fmovm.x EXC_FPREGS(%a6),&0xc0
1990 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
1991 movm.l EXC_DREGS(%a6),&0x0303
1992
1993 frestore FP_SRC(%a6)
1994
1995 unlk %a6
1996
1997 btst &0x7,(%sp)
1998 bne.w fu_trace_p
1999
2000 bra.l _fpsp_done
2001
2002tbl_except_p:
2003 short 0xe000,0xe006,0xe004,0xe005
2004 short 0xe003,0xe002,0xe001,0xe001
2005
2006fu_in_exc_ovfl_p:
2007 mov.w &0x3,%d0
2008 bra.w fu_in_exc_exit_p
2009
2010fu_in_exc_unfl_p:
2011 mov.w &0x4,%d0
2012 bra.w fu_in_exc_exit_p
2013
2014fu_in_exc_exit_s_p:
2015 btst &mia7_bit,SPCOND_FLG(%a6)
2016 beq.b fu_in_exc_exit_cont_p
2017
2018 mov.w (tbl_except_p.b,%pc,%d0.w*2),2+FP_SRC(%a6)
2019
2020 fmovm.x EXC_FPREGS(%a6),&0xc0
2021 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
2022 movm.l EXC_DREGS(%a6),&0x0303
2023
2024 frestore FP_SRC(%a6)
2025
2026 unlk %a6
2027
2028
2029 mov.l 0x4(%sp),0x10(%sp)
2030 mov.l 0x0(%sp),0xc(%sp)
2031 add.l &0xc,%sp
2032
2033 btst &0x7,(%sp)
2034 bne.b fu_trace_p
2035
2036 bra.l _fpsp_done
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055fu_trace_p:
2056 mov.w &0x2024,0x6(%sp)
2057 fmov.l %fpiar,0x8(%sp)
2058
2059 bra.l _real_trace
2060
2061
2062
2063fu_out_pack:
2064
2065
2066
2067
2068
2069 and.l &0xffff00ff,USER_FPSR(%a6)
2070
2071 fmov.l &0x0,%fpcr
2072 fmov.l &0x0,%fpsr
2073
2074 bfextu EXC_CMDREG(%a6){&6:&3},%d0
2075 bsr.l load_fpn1
2076
2077
2078
2079 lea FP_SRC(%a6),%a0
2080 bsr.l set_tag_x
2081 cmpi.b %d0,&UNNORM
2082 bne.b fu_op2_p
2083 bsr.l unnorm_fix
2084
2085fu_op2_p:
2086 mov.b %d0,STAG(%a6)
2087
2088 clr.l %d0
2089 mov.b FPCR_MODE(%a6),%d0
2090
2091 lea FP_SRC(%a6),%a0
2092
2093 mov.l (%a6),EXC_A6(%a6)
2094 bsr.l fout
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108 mov.b FPCR_ENABLE(%a6),%d0
2109 bne.w fu_out_ena_p
2110
2111fu_out_exit_p:
2112 mov.l EXC_A6(%a6),(%a6)
2113
2114 btst &0x5,EXC_SR(%a6)
2115 bne.b fu_out_exit_s_p
2116
2117 mov.l EXC_A7(%a6),%a0
2118 mov.l %a0,%usp
2119
2120fu_out_exit_cont_p:
2121 fmovm.x EXC_FPREGS(%a6),&0xc0
2122 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
2123 movm.l EXC_DREGS(%a6),&0x0303
2124
2125 unlk %a6
2126
2127 btst &0x7,(%sp)
2128 bne.w fu_trace_p
2129
2130 bra.l _fpsp_done
2131
2132
2133
2134
2135fu_out_exit_s_p:
2136 btst &mda7_bit,SPCOND_FLG(%a6)
2137 beq.b fu_out_exit_cont_p
2138
2139 fmovm.x EXC_FPREGS(%a6),&0xc0
2140 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
2141 movm.l EXC_DREGS(%a6),&0x0303
2142
2143 mov.l (%a6),%a6
2144
2145 mov.l LOCAL_SIZE+EXC_SR(%sp),LOCAL_SIZE+EXC_SR-0xc(%sp)
2146 mov.l LOCAL_SIZE+2+EXC_PC(%sp),LOCAL_SIZE+2+EXC_PC-0xc(%sp)
2147
2148
2149 mov.l LOCAL_SIZE+FP_DST_EX(%sp),LOCAL_SIZE+EXC_SR+0x0(%sp)
2150 mov.l LOCAL_SIZE+FP_DST_HI(%sp),LOCAL_SIZE+EXC_SR+0x4(%sp)
2151 mov.l LOCAL_SIZE+FP_DST_LO(%sp),LOCAL_SIZE+EXC_SR+0x8(%sp)
2152
2153 add.l &LOCAL_SIZE-0x8,%sp
2154
2155 btst &0x7,(%sp)
2156 bne.w fu_trace_p
2157
2158 bra.l _fpsp_done
2159
2160fu_out_ena_p:
2161 and.b FPSR_EXCEPT(%a6),%d0
2162 bfffo %d0{&24:&8},%d0
2163 beq.w fu_out_exit_p
2164
2165 mov.l EXC_A6(%a6),(%a6)
2166
2167
2168
2169fu_out_exc_p:
2170 cmpi.b %d0,&0x1a
2171 bgt.w fu_inex_p2
2172 beq.w fu_operr_p
2173
2174fu_snan_p:
2175 btst &0x5,EXC_SR(%a6)
2176 bne.b fu_snan_s_p
2177
2178 mov.l EXC_A7(%a6),%a0
2179 mov.l %a0,%usp
2180 bra.w fu_snan
2181
2182fu_snan_s_p:
2183 cmpi.b SPCOND_FLG(%a6),&mda7_flg
2184 bne.w fu_snan
2185
2186
2187
2188
2189 fmovm.x EXC_FPREGS(%a6),&0xc0
2190 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
2191 movm.l EXC_DREGS(%a6),&0x0303
2192
2193 mov.w &0x30d8,EXC_VOFF(%a6)
2194 mov.w &0xe006,2+FP_SRC(%a6)
2195
2196 frestore FP_SRC(%a6)
2197
2198 mov.l (%a6),%a6
2199
2200 mov.l LOCAL_SIZE+EXC_SR(%sp),LOCAL_SIZE+EXC_SR-0xc(%sp)
2201 mov.l LOCAL_SIZE+2+EXC_PC(%sp),LOCAL_SIZE+2+EXC_PC-0xc(%sp)
2202 mov.l LOCAL_SIZE+EXC_EA(%sp),LOCAL_SIZE+EXC_EA-0xc(%sp)
2203
2204
2205 mov.l LOCAL_SIZE+FP_DST_EX(%sp),LOCAL_SIZE+0x4(%sp)
2206 mov.l LOCAL_SIZE+FP_DST_HI(%sp),LOCAL_SIZE+0x8(%sp)
2207 mov.l LOCAL_SIZE+FP_DST_LO(%sp),LOCAL_SIZE+0xc(%sp)
2208
2209 add.l &LOCAL_SIZE-0x8,%sp
2210
2211
2212 bra.l _real_snan
2213
2214fu_operr_p:
2215 btst &0x5,EXC_SR(%a6)
2216 bne.w fu_operr_p_s
2217
2218 mov.l EXC_A7(%a6),%a0
2219 mov.l %a0,%usp
2220 bra.w fu_operr
2221
2222fu_operr_p_s:
2223 cmpi.b SPCOND_FLG(%a6),&mda7_flg
2224 bne.w fu_operr
2225
2226
2227
2228
2229 fmovm.x EXC_FPREGS(%a6),&0xc0
2230 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
2231 movm.l EXC_DREGS(%a6),&0x0303
2232
2233 mov.w &0x30d0,EXC_VOFF(%a6)
2234 mov.w &0xe004,2+FP_SRC(%a6)
2235
2236 frestore FP_SRC(%a6)
2237
2238 mov.l (%a6),%a6
2239
2240 mov.l LOCAL_SIZE+EXC_SR(%sp),LOCAL_SIZE+EXC_SR-0xc(%sp)
2241 mov.l LOCAL_SIZE+2+EXC_PC(%sp),LOCAL_SIZE+2+EXC_PC-0xc(%sp)
2242 mov.l LOCAL_SIZE+EXC_EA(%sp),LOCAL_SIZE+EXC_EA-0xc(%sp)
2243
2244
2245 mov.l LOCAL_SIZE+FP_DST_EX(%sp),LOCAL_SIZE+0x4(%sp)
2246 mov.l LOCAL_SIZE+FP_DST_HI(%sp),LOCAL_SIZE+0x8(%sp)
2247 mov.l LOCAL_SIZE+FP_DST_LO(%sp),LOCAL_SIZE+0xc(%sp)
2248
2249 add.l &LOCAL_SIZE-0x8,%sp
2250
2251
2252 bra.l _real_operr
2253
2254fu_inex_p2:
2255 btst &0x5,EXC_SR(%a6)
2256 bne.w fu_inex_s_p2
2257
2258 mov.l EXC_A7(%a6),%a0
2259 mov.l %a0,%usp
2260 bra.w fu_inex
2261
2262fu_inex_s_p2:
2263 cmpi.b SPCOND_FLG(%a6),&mda7_flg
2264 bne.w fu_inex
2265
2266
2267
2268
2269 fmovm.x EXC_FPREGS(%a6),&0xc0
2270 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
2271 movm.l EXC_DREGS(%a6),&0x0303
2272
2273 mov.w &0x30c4,EXC_VOFF(%a6)
2274 mov.w &0xe001,2+FP_SRC(%a6)
2275
2276 frestore FP_SRC(%a6)
2277
2278 mov.l (%a6),%a6
2279
2280 mov.l LOCAL_SIZE+EXC_SR(%sp),LOCAL_SIZE+EXC_SR-0xc(%sp)
2281 mov.l LOCAL_SIZE+2+EXC_PC(%sp),LOCAL_SIZE+2+EXC_PC-0xc(%sp)
2282 mov.l LOCAL_SIZE+EXC_EA(%sp),LOCAL_SIZE+EXC_EA-0xc(%sp)
2283
2284
2285 mov.l LOCAL_SIZE+FP_DST_EX(%sp),LOCAL_SIZE+0x4(%sp)
2286 mov.l LOCAL_SIZE+FP_DST_HI(%sp),LOCAL_SIZE+0x8(%sp)
2287 mov.l LOCAL_SIZE+FP_DST_LO(%sp),LOCAL_SIZE+0xc(%sp)
2288
2289 add.l &LOCAL_SIZE-0x8,%sp
2290
2291
2292 bra.l _real_inex
2293
2294
2295
2296
2297
2298
2299
2300
2301 global funimp_skew
2302funimp_skew:
2303 bfextu EXC_EXTWORD(%a6){&3:&3},%d0
2304 cmpi.b %d0,&0x1
2305 beq.b funimp_skew_sgl
2306 cmpi.b %d0,&0x5
2307 beq.b funimp_skew_dbl
2308 rts
2309
2310funimp_skew_sgl:
2311 mov.w FP_SRC_EX(%a6),%d0
2312 andi.w &0x7fff,%d0
2313 beq.b funimp_skew_sgl_not
2314 cmpi.w %d0,&0x3f80
2315 bgt.b funimp_skew_sgl_not
2316 neg.w %d0
2317 addi.w &0x3f81,%d0
2318 mov.l FP_SRC_HI(%a6),%d1
2319 lsr.l %d0,%d1
2320 bset &31,%d1
2321 mov.l %d1,FP_SRC_HI(%a6)
2322 andi.w &0x8000,FP_SRC_EX(%a6)
2323 ori.w &0x3f80,FP_SRC_EX(%a6)
2324funimp_skew_sgl_not:
2325 rts
2326
2327funimp_skew_dbl:
2328 mov.w FP_SRC_EX(%a6),%d0
2329 andi.w &0x7fff,%d0
2330 beq.b funimp_skew_dbl_not
2331 cmpi.w %d0,&0x3c00
2332 bgt.b funimp_skew_dbl_not
2333
2334 tst.b FP_SRC_EX(%a6)
2335 smi.b 0x2+FP_SRC(%a6)
2336 mov.w %d0,FP_SRC_EX(%a6)
2337 clr.l %d0
2338 lea FP_SRC(%a6),%a0
2339 mov.w &0x3c01,%d1
2340 bsr.l dnrm_lp
2341 mov.w &0x3c00,%d0
2342 tst.b 0x2+FP_SRC(%a6)
2343 beq.b fss_dbl_denorm_done
2344 bset &15,%d0
2345fss_dbl_denorm_done:
2346 bset &0x7,FP_SRC_HI(%a6)
2347 mov.w %d0,FP_SRC_EX(%a6)
2348funimp_skew_dbl_not:
2349 rts
2350
2351
2352 global _mem_write2
2353_mem_write2:
2354 btst &0x5,EXC_SR(%a6)
2355 beq.l _dmem_write
2356 mov.l 0x0(%a0),FP_DST_EX(%a6)
2357 mov.l 0x4(%a0),FP_DST_HI(%a6)
2358 mov.l 0x8(%a0),FP_DST_LO(%a6)
2359 clr.l %d1
2360 rts
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452 global _fpsp_effadd
2453_fpsp_effadd:
2454
2455
2456
2457
2458 mov.l %d0,-(%sp)
2459 movc %pcr,%d0
2460 btst &0x1,%d0
2461 bne.w iea_disabled
2462 mov.l (%sp)+,%d0
2463
2464 link %a6,&-LOCAL_SIZE
2465
2466 movm.l &0x0303,EXC_DREGS(%a6)
2467 fmovm.l %fpcr,%fpsr,%fpiar,USER_FPCR(%a6)
2468 fmovm.x &0xc0,EXC_FPREGS(%a6)
2469
2470
2471 mov.l EXC_PC(%a6),EXC_EXTWPTR(%a6)
2472
2473 mov.l EXC_EXTWPTR(%a6),%a0
2474 addq.l &0x4,EXC_EXTWPTR(%a6)
2475 bsr.l _imem_read_long
2476 mov.l %d0,EXC_OPWORD(%a6)
2477
2478
2479
2480 tst.w %d0
2481 bmi.w iea_fmovm
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502iea_op:
2503 andi.l &0x00ff00ff,USER_FPSR(%a6)
2504
2505 btst &0xa,%d0
2506 bne.b iea_op_pack
2507
2508
2509 mov.l EXC_EXTWPTR(%a6),%a0
2510 lea FP_SRC(%a6),%a1
2511 mov.l &0xc,%d0
2512 bsr.l _imem_read
2513
2514 tst.l %d1
2515 bne.w iea_iacc
2516
2517 bra.b iea_op_setsrc
2518
2519iea_op_pack:
2520
2521 mov.l EXC_EXTWPTR(%a6),%a0
2522 lea FP_SRC(%a6),%a1
2523 mov.l &0xc,%d0
2524 bsr.l _imem_read
2525
2526 tst.l %d1
2527 bne.w iea_iacc
2528
2529
2530 bfextu FP_SRC(%a6){&1:&15},%d0
2531 cmpi.w %d0,&0x7fff
2532 beq.b iea_op_setsrc
2533
2534
2535
2536 mov.b 3+FP_SRC(%a6),%d0
2537 andi.b &0x0f,%d0
2538 bne.b iea_op_gp_not_spec
2539 tst.l FP_SRC_HI(%a6)
2540 bne.b iea_op_gp_not_spec
2541 tst.l FP_SRC_LO(%a6)
2542 beq.b iea_op_setsrc
2543iea_op_gp_not_spec:
2544 lea FP_SRC(%a6),%a0
2545 bsr.l decbin
2546 fmovm.x &0x80,FP_SRC(%a6)
2547
2548iea_op_setsrc:
2549 addi.l &0xc,EXC_EXTWPTR(%a6)
2550
2551
2552 lea FP_SRC(%a6),%a0
2553 bsr.l set_tag_x
2554 mov.b %d0,STAG(%a6)
2555 cmpi.b %d0,&UNNORM
2556 bne.b iea_op_getdst
2557 bsr.l unnorm_fix
2558 mov.b %d0,STAG(%a6)
2559iea_op_getdst:
2560 clr.b STORE_FLG(%a6)
2561
2562 btst &0x5,1+EXC_CMDREG(%a6)
2563 beq.b iea_op_extract
2564 btst &0x4,1+EXC_CMDREG(%a6)
2565 bne.b iea_op_spec
2566
2567iea_op_loaddst:
2568 bfextu EXC_CMDREG(%a6){&6:&3},%d0
2569 bsr.l load_fpn2
2570
2571 lea FP_DST(%a6),%a0
2572 bsr.l set_tag_x
2573 mov.b %d0,DTAG(%a6)
2574 cmpi.b %d0,&UNNORM
2575 bne.b iea_op_extract
2576 bsr.l unnorm_fix
2577 mov.b %d0,DTAG(%a6)
2578 bra.b iea_op_extract
2579
2580
2581iea_op_spec:
2582 btst &0x3,1+EXC_CMDREG(%a6)
2583 beq.b iea_op_extract
2584
2585
2586 st STORE_FLG(%a6)
2587 btst &0x1,1+EXC_CMDREG(%a6)
2588 beq.b iea_op_loaddst
2589
2590iea_op_extract:
2591 clr.l %d0
2592 mov.b FPCR_MODE(%a6),%d0
2593
2594 mov.b 1+EXC_CMDREG(%a6),%d1
2595 andi.w &0x007f,%d1
2596
2597 fmov.l &0x0,%fpcr
2598 fmov.l &0x0,%fpsr
2599
2600 lea FP_SRC(%a6),%a0
2601 lea FP_DST(%a6),%a1
2602
2603 mov.l (tbl_unsupp.l,%pc,%d1.w*4),%d1
2604 jsr (tbl_unsupp.l,%pc,%d1.l*1)
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620 mov.b FPCR_ENABLE(%a6),%d0
2621 bne.b iea_op_ena
2622
2623
2624
2625iea_op_save:
2626 tst.b STORE_FLG(%a6)
2627 bne.b iea_op_exit1
2628
2629iea_op_store:
2630 bfextu EXC_CMDREG(%a6){&6:&3},%d0
2631 bsr.l store_fpreg
2632
2633iea_op_exit1:
2634 mov.l EXC_PC(%a6),USER_FPIAR(%a6)
2635 mov.l EXC_EXTWPTR(%a6),EXC_PC(%a6)
2636
2637 fmovm.x EXC_FPREGS(%a6),&0xc0
2638 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
2639 movm.l EXC_DREGS(%a6),&0x0303
2640
2641 unlk %a6
2642
2643 btst &0x7,(%sp)
2644 bne.w iea_op_trace
2645
2646 bra.l _fpsp_done
2647
2648iea_op_ena:
2649 and.b FPSR_EXCEPT(%a6),%d0
2650 bfffo %d0{&24:&8},%d0
2651 bne.b iea_op_exc
2652
2653
2654
2655 btst &ovfl_bit,FPSR_EXCEPT(%a6)
2656 beq.b iea_op_save
2657
2658iea_op_ovfl:
2659 btst &inex2_bit,FPCR_ENABLE(%a6)
2660 beq.b iea_op_store
2661 bra.b iea_op_exc_ovfl
2662
2663
2664
2665iea_op_exc:
2666 subi.l &24,%d0
2667 cmpi.b %d0,&0x6
2668 bne.b iea_op_exc_force
2669
2670
2671
2672
2673 btst &ovfl_bit,FPSR_EXCEPT(%a6)
2674 bne.b iea_op_exc_ovfl
2675 btst &unfl_bit,FPSR_EXCEPT(%a6)
2676 bne.b iea_op_exc_unfl
2677
2678iea_op_exc_force:
2679 mov.w (tbl_iea_except.b,%pc,%d0.w*2),2+FP_SRC(%a6)
2680 bra.b iea_op_exit2
2681
2682tbl_iea_except:
2683 short 0xe002, 0xe006, 0xe004, 0xe005
2684 short 0xe003, 0xe002, 0xe001, 0xe001
2685
2686iea_op_exc_ovfl:
2687 mov.w &0xe005,2+FP_SRC(%a6)
2688 bra.b iea_op_exit2
2689
2690iea_op_exc_unfl:
2691 mov.w &0xe003,2+FP_SRC(%a6)
2692
2693iea_op_exit2:
2694 mov.l EXC_PC(%a6),USER_FPIAR(%a6)
2695 mov.l EXC_EXTWPTR(%a6),EXC_PC(%a6)
2696
2697 fmovm.x EXC_FPREGS(%a6),&0xc0
2698 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
2699 movm.l EXC_DREGS(%a6),&0x0303
2700
2701 frestore FP_SRC(%a6)
2702
2703 unlk %a6
2704
2705 btst &0x7,(%sp)
2706 bne.b iea_op_trace
2707
2708 bra.l _fpsp_done
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727iea_op_trace:
2728 mov.l (%sp),-(%sp)
2729 mov.w 0x8(%sp),0x4(%sp)
2730 mov.w &0x2024,0x6(%sp)
2731 fmov.l %fpiar,0x8(%sp)
2732
2733 bra.l _real_trace
2734
2735
2736iea_fmovm:
2737 btst &14,%d0
2738 beq.w iea_fmovm_ctrl
2739
2740iea_fmovm_data:
2741
2742 btst &0x5,EXC_SR(%a6)
2743 bne.b iea_fmovm_data_s
2744
2745iea_fmovm_data_u:
2746 mov.l %usp,%a0
2747 mov.l %a0,EXC_A7(%a6)
2748 bsr.l fmovm_dynamic
2749 mov.l EXC_A7(%a6),%a0
2750 mov.l %a0,%usp
2751 bra.w iea_fmovm_exit
2752
2753iea_fmovm_data_s:
2754 clr.b SPCOND_FLG(%a6)
2755 lea 0x2+EXC_VOFF(%a6),%a0
2756 mov.l %a0,EXC_A7(%a6)
2757 bsr.l fmovm_dynamic
2758
2759 cmpi.b SPCOND_FLG(%a6),&mda7_flg
2760 beq.w iea_fmovm_data_predec
2761 cmpi.b SPCOND_FLG(%a6),&mia7_flg
2762 bne.w iea_fmovm_exit
2763
2764
2765
2766
2767
2768iea_fmovm_data_postinc:
2769 btst &0x7,EXC_SR(%a6)
2770 bne.b iea_fmovm_data_pi_trace
2771
2772 mov.w EXC_SR(%a6),(EXC_SR,%a6,%d0)
2773 mov.l EXC_EXTWPTR(%a6),(EXC_PC,%a6,%d0)
2774 mov.w &0x00f0,(EXC_VOFF,%a6,%d0)
2775
2776 lea (EXC_SR,%a6,%d0),%a0
2777 mov.l %a0,EXC_SR(%a6)
2778
2779 fmovm.x EXC_FP0(%a6),&0xc0
2780 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
2781 movm.l EXC_DREGS(%a6),&0x0303
2782
2783 unlk %a6
2784 mov.l (%sp)+,%sp
2785 bra.l _fpsp_done
2786
2787iea_fmovm_data_pi_trace:
2788 mov.w EXC_SR(%a6),(EXC_SR-0x4,%a6,%d0)
2789 mov.l EXC_EXTWPTR(%a6),(EXC_PC-0x4,%a6,%d0)
2790 mov.w &0x2024,(EXC_VOFF-0x4,%a6,%d0)
2791 mov.l EXC_PC(%a6),(EXC_VOFF+0x2-0x4,%a6,%d0)
2792
2793 lea (EXC_SR-0x4,%a6,%d0),%a0
2794 mov.l %a0,EXC_SR(%a6)
2795
2796 fmovm.x EXC_FP0(%a6),&0xc0
2797 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
2798 movm.l EXC_DREGS(%a6),&0x0303
2799
2800 unlk %a6
2801 mov.l (%sp)+,%sp
2802 bra.l _real_trace
2803
2804
2805iea_fmovm_data_predec:
2806 mov.b %d1,EXC_VOFF(%a6)
2807 mov.b %d0,0x1+EXC_VOFF(%a6)
2808
2809 fmovm.x EXC_FP0(%a6),&0xc0
2810 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
2811 movm.l EXC_DREGS(%a6),&0x0303
2812
2813 mov.l (%a6),-(%sp)
2814 mov.l %d0,-(%sp)
2815 mov.l %d1,-(%sp)
2816 mov.l EXC_EXTWPTR(%a6),-(%sp)
2817
2818 clr.l %d0
2819 mov.b 0x1+EXC_VOFF(%a6),%d0
2820 neg.l %d0
2821
2822 btst &0x7,EXC_SR(%a6)
2823 beq.b iea_fmovm_data_p2
2824
2825 mov.w EXC_SR(%a6),(EXC_SR-0x4,%a6,%d0)
2826 mov.l EXC_PC(%a6),(EXC_VOFF-0x2,%a6,%d0)
2827 mov.l (%sp)+,(EXC_PC-0x4,%a6,%d0)
2828 mov.w &0x2024,(EXC_VOFF-0x4,%a6,%d0)
2829
2830 pea (%a6,%d0)
2831 bra.b iea_fmovm_data_p3
2832
2833iea_fmovm_data_p2:
2834 mov.w EXC_SR(%a6),(EXC_SR,%a6,%d0)
2835 mov.l (%sp)+,(EXC_PC,%a6,%d0)
2836 mov.w &0x00f0,(EXC_VOFF,%a6,%d0)
2837
2838 pea (0x4,%a6,%d0)
2839
2840iea_fmovm_data_p3:
2841 clr.l %d1
2842 mov.b EXC_VOFF(%a6),%d1
2843
2844 tst.b %d1
2845 bpl.b fm_1
2846 fmovm.x &0x80,(0x4+0x8,%a6,%d0)
2847 addi.l &0xc,%d0
2848fm_1:
2849 lsl.b &0x1,%d1
2850 bpl.b fm_2
2851 fmovm.x &0x40,(0x4+0x8,%a6,%d0)
2852 addi.l &0xc,%d0
2853fm_2:
2854 lsl.b &0x1,%d1
2855 bpl.b fm_3
2856 fmovm.x &0x20,(0x4+0x8,%a6,%d0)
2857 addi.l &0xc,%d0
2858fm_3:
2859 lsl.b &0x1,%d1
2860 bpl.b fm_4
2861 fmovm.x &0x10,(0x4+0x8,%a6,%d0)
2862 addi.l &0xc,%d0
2863fm_4:
2864 lsl.b &0x1,%d1
2865 bpl.b fm_5
2866 fmovm.x &0x08,(0x4+0x8,%a6,%d0)
2867 addi.l &0xc,%d0
2868fm_5:
2869 lsl.b &0x1,%d1
2870 bpl.b fm_6
2871 fmovm.x &0x04,(0x4+0x8,%a6,%d0)
2872 addi.l &0xc,%d0
2873fm_6:
2874 lsl.b &0x1,%d1
2875 bpl.b fm_7
2876 fmovm.x &0x02,(0x4+0x8,%a6,%d0)
2877 addi.l &0xc,%d0
2878fm_7:
2879 lsl.b &0x1,%d1
2880 bpl.b fm_end
2881 fmovm.x &0x01,(0x4+0x8,%a6,%d0)
2882fm_end:
2883 mov.l 0x4(%sp),%d1
2884 mov.l 0x8(%sp),%d0
2885 mov.l 0xc(%sp),%a6
2886 mov.l (%sp)+,%sp
2887
2888 btst &0x7,(%sp)
2889 beq.l _fpsp_done
2890 bra.l _real_trace
2891
2892
2893iea_fmovm_ctrl:
2894
2895 bsr.l fmovm_ctrl
2896
2897iea_fmovm_exit:
2898 fmovm.x EXC_FPREGS(%a6),&0xc0
2899 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
2900 movm.l EXC_DREGS(%a6),&0x0303
2901
2902 btst &0x7,EXC_SR(%a6)
2903 bne.b iea_fmovm_trace
2904
2905 mov.l EXC_EXTWPTR(%a6),EXC_PC(%a6)
2906
2907 unlk %a6
2908
2909 bra.l _fpsp_done
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933iea_fmovm_trace:
2934 mov.l (%a6),%a6
2935 mov.w EXC_SR+LOCAL_SIZE(%sp),0x0+LOCAL_SIZE(%sp)
2936 mov.l EXC_PC+LOCAL_SIZE(%sp),0x8+LOCAL_SIZE(%sp)
2937 mov.l EXC_EXTWPTR+LOCAL_SIZE(%sp),0x2+LOCAL_SIZE(%sp)
2938 mov.w &0x2024,0x6+LOCAL_SIZE(%sp)
2939 add.l &LOCAL_SIZE,%sp
2940
2941 bra.l _real_trace
2942
2943
2944
2945
2946
2947
2948
2949
2950iea_disabled:
2951 mov.l (%sp)+,%d0
2952
2953 link %a6,&-LOCAL_SIZE
2954
2955 movm.l &0x0303,EXC_DREGS(%a6)
2956
2957
2958 mov.l EXC_PC(%a6),EXC_EXTWPTR(%a6)
2959 mov.l EXC_EXTWPTR(%a6),%a0
2960 addq.l &0x4,EXC_EXTWPTR(%a6)
2961 bsr.l _imem_read_long
2962 mov.l %d0,EXC_OPWORD(%a6)
2963
2964 tst.w %d0
2965 bmi.b iea_dis_fmovm
2966
2967
2968iea_dis_immed:
2969 mov.l &0x10,%d0
2970 bra.b iea_dis_cont
2971iea_dis_fmovm:
2972 btst &0xe,%d0
2973 bne.b iea_dis_fmovm_data
2974
2975 bfextu %d0{&19:&3},%d1
2976 mov.l &0xc,%d0
2977 cmpi.b %d1,&0x7
2978 bne.b iea_dis_cont
2979 addq.l &0x4,%d0
2980 bra.b iea_dis_cont
2981
2982
2983
2984
2985iea_dis_fmovm_data:
2986 clr.l %d0
2987 bsr.l fmovm_calc_ea
2988 mov.l EXC_EXTWPTR(%a6),%d0
2989 sub.l EXC_PC(%a6),%d0
2990iea_dis_cont:
2991 mov.w %d0,EXC_VOFF(%a6)
2992
2993 movm.l EXC_DREGS(%a6),&0x0303
2994
2995 unlk %a6
2996
2997
2998
2999
3000 subq.l &0x8,%sp
3001 mov.l %d0,-(%sp)
3002 mov.w 0xc(%sp),0x4(%sp)
3003 mov.l 0xe(%sp),0x6(%sp)
3004 clr.l %d0
3005 mov.w 0x12(%sp),%d0
3006 mov.l 0x6(%sp),0x10(%sp)
3007 add.l %d0,0x6(%sp)
3008 mov.w &0x402c,0xa(%sp)
3009 mov.l (%sp)+,%d0
3010
3011 bra.l _real_fpu_disabled
3012
3013
3014
3015iea_iacc:
3016 movc %pcr,%d0
3017 btst &0x1,%d0
3018 bne.b iea_iacc_cont
3019 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
3020 fmovm.x EXC_FPREGS(%a6),&0xc0
3021iea_iacc_cont:
3022 movm.l EXC_DREGS(%a6),&0x0303
3023
3024 unlk %a6
3025
3026 subq.w &0x8,%sp
3027 mov.l 0x8(%sp),(%sp)
3028 mov.w 0xc(%sp),0x4(%sp)
3029 mov.w &0x4008,0x6(%sp)
3030 mov.l 0x2(%sp),0x8(%sp)
3031 mov.l &0x09428001,0xc(%sp)
3032
3033iea_acc_done:
3034 btst &0x5,(%sp)
3035 beq.b iea_acc_done2
3036 bset &0x2,0xd(%sp)
3037
3038iea_acc_done2:
3039 bra.l _real_access
3040
3041iea_dacc:
3042 lea -LOCAL_SIZE(%a6),%sp
3043
3044 movc %pcr,%d1
3045 btst &0x1,%d1
3046 bne.b iea_dacc_cont
3047 fmovm.x EXC_FPREGS(%a6),&0xc0
3048 fmovm.l LOCAL_SIZE+USER_FPCR(%sp),%fpcr,%fpsr,%fpiar
3049iea_dacc_cont:
3050 mov.l (%a6),%a6
3051
3052 mov.l 0x4+LOCAL_SIZE(%sp),-0x8+0x4+LOCAL_SIZE(%sp)
3053 mov.w 0x8+LOCAL_SIZE(%sp),-0x8+0x8+LOCAL_SIZE(%sp)
3054 mov.w &0x4008,-0x8+0xa+LOCAL_SIZE(%sp)
3055 mov.l %a0,-0x8+0xc+LOCAL_SIZE(%sp)
3056 mov.w %d0,-0x8+0x10+LOCAL_SIZE(%sp)
3057 mov.w &0x0001,-0x8+0x12+LOCAL_SIZE(%sp)
3058
3059 movm.l LOCAL_SIZE+EXC_DREGS(%sp),&0x0303
3060 add.w &LOCAL_SIZE-0x4,%sp
3061
3062 bra.b iea_acc_done
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106 global _fpsp_operr
3107_fpsp_operr:
3108
3109 link.w %a6,&-LOCAL_SIZE
3110
3111 fsave FP_SRC(%a6)
3112
3113 movm.l &0x0303,EXC_DREGS(%a6)
3114 fmovm.l %fpcr,%fpsr,%fpiar,USER_FPCR(%a6)
3115 fmovm.x &0xc0,EXC_FPREGS(%a6)
3116
3117
3118 mov.l USER_FPIAR(%a6),EXC_EXTWPTR(%a6)
3119
3120 mov.l EXC_EXTWPTR(%a6),%a0
3121 addq.l &0x4,EXC_EXTWPTR(%a6)
3122 bsr.l _imem_read_long
3123 mov.l %d0,EXC_OPWORD(%a6)
3124
3125
3126
3127 btst &13,%d0
3128 bne.b foperr_out
3129
3130
3131
3132
3133
3134
3135 lea FP_SRC(%a6),%a0
3136 bsr.l fix_skewed_ops
3137
3138foperr_exit:
3139 fmovm.x EXC_FPREGS(%a6),&0xc0
3140 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
3141 movm.l EXC_DREGS(%a6),&0x0303
3142
3143 frestore FP_SRC(%a6)
3144
3145 unlk %a6
3146 bra.l _real_operr
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165foperr_out:
3166
3167 mov.w FP_SRC_EX(%a6),%d1
3168 andi.w &0x7fff,%d1
3169 cmpi.w %d1,&0x7fff
3170 bne.b foperr_out_not_qnan
3171
3172 tst.l FP_SRC_LO(%a6)
3173 bne.b foperr_out_qnan
3174 mov.l FP_SRC_HI(%a6),%d1
3175 andi.l &0x7fffffff,%d1
3176 beq.b foperr_out_not_qnan
3177foperr_out_qnan:
3178 mov.l FP_SRC_HI(%a6),L_SCR1(%a6)
3179 bra.b foperr_out_jmp
3180
3181foperr_out_not_qnan:
3182 mov.l &0x7fffffff,%d1
3183 tst.b FP_SRC_EX(%a6)
3184 bpl.b foperr_out_not_qnan2
3185 addq.l &0x1,%d1
3186foperr_out_not_qnan2:
3187 mov.l %d1,L_SCR1(%a6)
3188
3189foperr_out_jmp:
3190 bfextu %d0{&19:&3},%d0
3191 mov.b 1+EXC_OPWORD(%a6),%d1
3192 mov.w (tbl_operr.b,%pc,%d0.w*2),%a0
3193 jmp (tbl_operr.b,%pc,%a0)
3194
3195tbl_operr:
3196 short foperr_out_l - tbl_operr
3197 short tbl_operr - tbl_operr
3198 short tbl_operr - tbl_operr
3199 short foperr_exit - tbl_operr
3200 short foperr_out_w - tbl_operr
3201 short tbl_operr - tbl_operr
3202 short foperr_out_b - tbl_operr
3203 short tbl_operr - tbl_operr
3204
3205foperr_out_b:
3206 mov.b L_SCR1(%a6),%d0
3207 cmpi.b %d1,&0x7
3208 ble.b foperr_out_b_save_dn
3209 mov.l EXC_EA(%a6),%a0
3210 bsr.l _dmem_write_byte
3211
3212 tst.l %d1
3213 bne.l facc_out_b
3214
3215 bra.w foperr_exit
3216foperr_out_b_save_dn:
3217 andi.w &0x0007,%d1
3218 bsr.l store_dreg_b
3219 bra.w foperr_exit
3220
3221foperr_out_w:
3222 mov.w L_SCR1(%a6),%d0
3223 cmpi.b %d1,&0x7
3224 ble.b foperr_out_w_save_dn
3225 mov.l EXC_EA(%a6),%a0
3226 bsr.l _dmem_write_word
3227
3228 tst.l %d1
3229 bne.l facc_out_w
3230
3231 bra.w foperr_exit
3232foperr_out_w_save_dn:
3233 andi.w &0x0007,%d1
3234 bsr.l store_dreg_w
3235 bra.w foperr_exit
3236
3237foperr_out_l:
3238 mov.l L_SCR1(%a6),%d0
3239 cmpi.b %d1,&0x7
3240 ble.b foperr_out_l_save_dn
3241 mov.l EXC_EA(%a6),%a0
3242 bsr.l _dmem_write_long
3243
3244 tst.l %d1
3245 bne.l facc_out_l
3246
3247 bra.w foperr_exit
3248foperr_out_l_save_dn:
3249 andi.w &0x0007,%d1
3250 bsr.l store_dreg_l
3251 bra.w foperr_exit
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302 global _fpsp_snan
3303_fpsp_snan:
3304
3305 link.w %a6,&-LOCAL_SIZE
3306
3307 fsave FP_SRC(%a6)
3308
3309 movm.l &0x0303,EXC_DREGS(%a6)
3310 fmovm.l %fpcr,%fpsr,%fpiar,USER_FPCR(%a6)
3311 fmovm.x &0xc0,EXC_FPREGS(%a6)
3312
3313
3314 mov.l USER_FPIAR(%a6),EXC_EXTWPTR(%a6)
3315
3316 mov.l EXC_EXTWPTR(%a6),%a0
3317 addq.l &0x4,EXC_EXTWPTR(%a6)
3318 bsr.l _imem_read_long
3319 mov.l %d0,EXC_OPWORD(%a6)
3320
3321
3322
3323 btst &13,%d0
3324 bne.w fsnan_out
3325
3326
3327
3328
3329
3330
3331 lea FP_SRC(%a6),%a0
3332 bsr.l fix_skewed_ops
3333
3334fsnan_exit:
3335 fmovm.x EXC_FPREGS(%a6),&0xc0
3336 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
3337 movm.l EXC_DREGS(%a6),&0x0303
3338
3339 frestore FP_SRC(%a6)
3340
3341 unlk %a6
3342 bra.l _real_snan
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358fsnan_out:
3359
3360 bfextu %d0{&19:&3},%d0
3361 mov.b 1+EXC_OPWORD(%a6),%d1
3362 mov.w (tbl_snan.b,%pc,%d0.w*2),%a0
3363 jmp (tbl_snan.b,%pc,%a0)
3364
3365tbl_snan:
3366 short fsnan_out_l - tbl_snan
3367 short fsnan_out_s - tbl_snan
3368 short fsnan_out_x - tbl_snan
3369 short tbl_snan - tbl_snan
3370 short fsnan_out_w - tbl_snan
3371 short fsnan_out_d - tbl_snan
3372 short fsnan_out_b - tbl_snan
3373 short tbl_snan - tbl_snan
3374
3375fsnan_out_b:
3376 mov.b FP_SRC_HI(%a6),%d0
3377 bset &6,%d0
3378 cmpi.b %d1,&0x7
3379 ble.b fsnan_out_b_dn
3380 mov.l EXC_EA(%a6),%a0
3381 bsr.l _dmem_write_byte
3382
3383 tst.l %d1
3384 bne.l facc_out_b
3385
3386 bra.w fsnan_exit
3387fsnan_out_b_dn:
3388 andi.w &0x0007,%d1
3389 bsr.l store_dreg_b
3390 bra.w fsnan_exit
3391
3392fsnan_out_w:
3393 mov.w FP_SRC_HI(%a6),%d0
3394 bset &14,%d0
3395 cmpi.b %d1,&0x7
3396 ble.b fsnan_out_w_dn
3397 mov.l EXC_EA(%a6),%a0
3398 bsr.l _dmem_write_word
3399
3400 tst.l %d1
3401 bne.l facc_out_w
3402
3403 bra.w fsnan_exit
3404fsnan_out_w_dn:
3405 andi.w &0x0007,%d1
3406 bsr.l store_dreg_w
3407 bra.w fsnan_exit
3408
3409fsnan_out_l:
3410 mov.l FP_SRC_HI(%a6),%d0
3411 bset &30,%d0
3412 cmpi.b %d1,&0x7
3413 ble.b fsnan_out_l_dn
3414 mov.l EXC_EA(%a6),%a0
3415 bsr.l _dmem_write_long
3416
3417 tst.l %d1
3418 bne.l facc_out_l
3419
3420 bra.w fsnan_exit
3421fsnan_out_l_dn:
3422 andi.w &0x0007,%d1
3423 bsr.l store_dreg_l
3424 bra.w fsnan_exit
3425
3426fsnan_out_s:
3427 cmpi.b %d1,&0x7
3428 ble.b fsnan_out_d_dn
3429 mov.l FP_SRC_EX(%a6),%d0
3430 andi.l &0x80000000,%d0
3431 ori.l &0x7fc00000,%d0
3432 mov.l FP_SRC_HI(%a6),%d1
3433 lsr.l &0x8,%d1
3434 or.l %d1,%d0
3435 mov.l EXC_EA(%a6),%a0
3436 bsr.l _dmem_write_long
3437
3438 tst.l %d1
3439 bne.l facc_out_l
3440
3441 bra.w fsnan_exit
3442fsnan_out_d_dn:
3443 mov.l FP_SRC_EX(%a6),%d0
3444 andi.l &0x80000000,%d0
3445 ori.l &0x7fc00000,%d0
3446 mov.l %d1,-(%sp)
3447 mov.l FP_SRC_HI(%a6),%d1
3448 lsr.l &0x8,%d1
3449 or.l %d1,%d0
3450 mov.l (%sp)+,%d1
3451 andi.w &0x0007,%d1
3452 bsr.l store_dreg_l
3453 bra.w fsnan_exit
3454
3455fsnan_out_d:
3456 mov.l FP_SRC_EX(%a6),%d0
3457 andi.l &0x80000000,%d0
3458 ori.l &0x7ff80000,%d0
3459 mov.l FP_SRC_HI(%a6),%d1
3460 mov.l %d0,FP_SCR0_EX(%a6)
3461 mov.l &11,%d0
3462 lsr.l %d0,%d1
3463 or.l %d1,FP_SCR0_EX(%a6)
3464 mov.l FP_SRC_HI(%a6),%d1
3465 andi.l &0x000007ff,%d1
3466 ror.l %d0,%d1
3467 mov.l %d1,FP_SCR0_HI(%a6)
3468 mov.l FP_SRC_LO(%a6),%d1
3469 lsr.l %d0,%d1
3470 or.l %d1,FP_SCR0_HI(%a6)
3471 lea FP_SCR0(%a6),%a0
3472 mov.l EXC_EA(%a6),%a1
3473 movq.l &0x8,%d0
3474 bsr.l _dmem_write
3475
3476 tst.l %d1
3477 bne.l facc_out_d
3478
3479 bra.w fsnan_exit
3480
3481
3482
3483
3484fsnan_out_x:
3485 clr.b SPCOND_FLG(%a6)
3486
3487 mov.w FP_SRC_EX(%a6),FP_SCR0_EX(%a6)
3488 clr.w 2+FP_SCR0(%a6)
3489 mov.l FP_SRC_HI(%a6),%d0
3490 bset &30,%d0
3491 mov.l %d0,FP_SCR0_HI(%a6)
3492 mov.l FP_SRC_LO(%a6),FP_SCR0_LO(%a6)
3493
3494 btst &0x5,EXC_SR(%a6)
3495 bne.b fsnan_out_x_s
3496
3497 mov.l %usp,%a0
3498 mov.l %a0,EXC_A7(%a6)
3499 mov.l (%a6),EXC_A6(%a6)
3500
3501 bsr.l _calc_ea_fout
3502 mov.l %a0,%a1
3503 mov.l %a0,EXC_EA(%a6)
3504
3505 mov.l EXC_A7(%a6),%a0
3506 mov.l %a0,%usp
3507 mov.l EXC_A6(%a6),(%a6)
3508
3509fsnan_out_x_save:
3510 lea FP_SCR0(%a6),%a0
3511 movq.l &0xc,%d0
3512 bsr.l _dmem_write
3513
3514 tst.l %d1
3515 bne.l facc_out_x
3516
3517 bra.w fsnan_exit
3518
3519fsnan_out_x_s:
3520 mov.l (%a6),EXC_A6(%a6)
3521
3522 bsr.l _calc_ea_fout
3523 mov.l %a0,%a1
3524 mov.l %a0,EXC_EA(%a6)
3525
3526 mov.l EXC_A6(%a6),(%a6)
3527
3528 cmpi.b SPCOND_FLG(%a6),&mda7_flg
3529 bne.b fsnan_out_x_save
3530
3531
3532 fmovm.x EXC_FPREGS(%a6),&0xc0
3533 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
3534 movm.l EXC_DREGS(%a6),&0x0303
3535
3536 frestore FP_SRC(%a6)
3537
3538 mov.l EXC_A6(%a6),%a6
3539
3540 mov.l LOCAL_SIZE+EXC_SR(%sp),LOCAL_SIZE+EXC_SR-0xc(%sp)
3541 mov.l LOCAL_SIZE+EXC_PC+0x2(%sp),LOCAL_SIZE+EXC_PC+0x2-0xc(%sp)
3542 mov.l LOCAL_SIZE+EXC_EA(%sp),LOCAL_SIZE+EXC_EA-0xc(%sp)
3543
3544 mov.l LOCAL_SIZE+FP_SCR0_EX(%sp),LOCAL_SIZE+EXC_SR(%sp)
3545 mov.l LOCAL_SIZE+FP_SCR0_HI(%sp),LOCAL_SIZE+EXC_PC+0x2(%sp)
3546 mov.l LOCAL_SIZE+FP_SCR0_LO(%sp),LOCAL_SIZE+EXC_EA(%sp)
3547
3548 add.l &LOCAL_SIZE-0x8,%sp
3549
3550 bra.l _real_snan
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594 global _fpsp_inex
3595_fpsp_inex:
3596
3597 link.w %a6,&-LOCAL_SIZE
3598
3599 fsave FP_SRC(%a6)
3600
3601 movm.l &0x0303,EXC_DREGS(%a6)
3602 fmovm.l %fpcr,%fpsr,%fpiar,USER_FPCR(%a6)
3603 fmovm.x &0xc0,EXC_FPREGS(%a6)
3604
3605
3606 mov.l USER_FPIAR(%a6),EXC_EXTWPTR(%a6)
3607
3608 mov.l EXC_EXTWPTR(%a6),%a0
3609 addq.l &0x4,EXC_EXTWPTR(%a6)
3610 bsr.l _imem_read_long
3611 mov.l %d0,EXC_OPWORD(%a6)
3612
3613
3614
3615 btst &13,%d0
3616 bne.w finex_out
3617
3618
3619
3620
3621
3622 bfextu %d0{&19:&3},%d0
3623 bne.b finex_cont
3624 cmpi.w FP_SRC_EX(%a6),&0x401e
3625 bne.b finex_cont
3626 fmov.l &0x0,%fpcr
3627 fmov.l FP_SRC_HI(%a6),%fp0
3628 fmov.x %fp0,FP_SRC(%a6)
3629 mov.w &0xe001,0x2+FP_SRC(%a6)
3630
3631finex_cont:
3632 lea FP_SRC(%a6),%a0
3633 bsr.l fix_skewed_ops
3634
3635
3636
3637
3638
3639
3640 andi.l &0x00ff01ff,USER_FPSR(%a6)
3641
3642 fmov.l &0x0,%fpcr
3643 fmov.l &0x0,%fpsr
3644
3645 bfextu EXC_EXTWORD(%a6){&0:&6},%d1
3646 cmpi.b %d1,&0x17
3647 beq.w finex_fmovcr
3648
3649 lea FP_SRC(%a6),%a0
3650 bsr.l set_tag_x
3651 mov.b %d0,STAG(%a6)
3652
3653
3654
3655
3656 btst &0x5,1+EXC_CMDREG(%a6)
3657 beq.b finex_extract
3658
3659 btst &0x4,1+EXC_CMDREG(%a6)
3660 bne.b finex_extract
3661
3662 bfextu EXC_CMDREG(%a6){&6:&3},%d0
3663 bsr.l load_fpn2
3664
3665 lea FP_DST(%a6),%a0
3666 bsr.l set_tag_x
3667 cmpi.b %d0,&UNNORM
3668 bne.b finex_op2_done
3669 bsr.l unnorm_fix
3670finex_op2_done:
3671 mov.b %d0,DTAG(%a6)
3672
3673finex_extract:
3674 clr.l %d0
3675 mov.b FPCR_MODE(%a6),%d0
3676
3677 mov.b 1+EXC_CMDREG(%a6),%d1
3678 andi.w &0x007f,%d1
3679
3680 lea FP_SRC(%a6),%a0
3681 lea FP_DST(%a6),%a1
3682
3683 mov.l (tbl_unsupp.l,%pc,%d1.w*4),%d1
3684 jsr (tbl_unsupp.l,%pc,%d1.l*1)
3685
3686
3687finex_save:
3688 bfextu EXC_CMDREG(%a6){&6:&3},%d0
3689 bsr.l store_fpreg
3690
3691finex_exit:
3692 fmovm.x EXC_FPREGS(%a6),&0xc0
3693 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
3694 movm.l EXC_DREGS(%a6),&0x0303
3695
3696 frestore FP_SRC(%a6)
3697
3698 unlk %a6
3699 bra.l _real_inex
3700
3701finex_fmovcr:
3702 clr.l %d0
3703 mov.b FPCR_MODE(%a6),%d0
3704 mov.b 1+EXC_CMDREG(%a6),%d1
3705 andi.l &0x0000007f,%d1
3706 bsr.l smovcr
3707 bra.b finex_save
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723finex_out:
3724
3725 mov.b &NORM,STAG(%a6)
3726
3727 clr.l %d0
3728 mov.b FPCR_MODE(%a6),%d0
3729
3730 andi.l &0xffff00ff,USER_FPSR(%a6)
3731
3732 lea FP_SRC(%a6),%a0
3733
3734 bsr.l fout
3735
3736 bra.b finex_exit
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768 global _fpsp_dz
3769_fpsp_dz:
3770
3771 link.w %a6,&-LOCAL_SIZE
3772
3773 fsave FP_SRC(%a6)
3774
3775 movm.l &0x0303,EXC_DREGS(%a6)
3776 fmovm.l %fpcr,%fpsr,%fpiar,USER_FPCR(%a6)
3777 fmovm.x &0xc0,EXC_FPREGS(%a6)
3778
3779
3780 mov.l USER_FPIAR(%a6),EXC_EXTWPTR(%a6)
3781
3782 mov.l EXC_EXTWPTR(%a6),%a0
3783 addq.l &0x4,EXC_EXTWPTR(%a6)
3784 bsr.l _imem_read_long
3785 mov.l %d0,EXC_OPWORD(%a6)
3786
3787
3788
3789
3790
3791
3792
3793 lea FP_SRC(%a6),%a0
3794 bsr.l fix_skewed_ops
3795
3796fdz_exit:
3797 fmovm.x EXC_FPREGS(%a6),&0xc0
3798 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
3799 movm.l EXC_DREGS(%a6),&0x0303
3800
3801 frestore FP_SRC(%a6)
3802
3803 unlk %a6
3804 bra.l _real_dz
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843 global _fpsp_fline
3844_fpsp_fline:
3845
3846
3847
3848 cmpi.w 0x6(%sp),&0x202c
3849 beq.l _fpsp_unimp
3850
3851
3852
3853 cmpi.w 0x6(%sp),&0x402c
3854 beq.l _real_fpu_disabled
3855
3856
3857
3858
3859
3860
3861 link.w %a6,&-LOCAL_SIZE
3862
3863 movm.l &0x0303,EXC_DREGS(%a6)
3864
3865 mov.l EXC_PC(%a6),EXC_EXTWPTR(%a6)
3866 mov.l EXC_EXTWPTR(%a6),%a0
3867 addq.l &0x4,EXC_EXTWPTR(%a6)
3868 bsr.l _imem_read_long
3869
3870 bfextu %d0{&0:&10},%d1
3871 cmpi.w %d1,&0x03c8
3872 bne.b fline_fline
3873
3874 bfextu %d0{&16:&6},%d1
3875 cmpi.b %d1,&0x17
3876 bne.b fline_fline
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886 movc %pcr,%d0
3887 btst &0x1,%d0
3888 beq.b fline_fmovcr
3889
3890 movm.l EXC_DREGS(%a6),&0x0303
3891
3892 unlk %a6
3893
3894 sub.l &0x8,%sp
3895 mov.w 0x8(%sp),(%sp)
3896 mov.l 0xa(%sp),0x2(%sp)
3897 mov.w &0x402c,0x6(%sp)
3898 mov.l 0x2(%sp),0xc(%sp)
3899 addq.l &0x4,0x2(%sp)
3900
3901 bra.l _real_fpu_disabled
3902
3903fline_fmovcr:
3904 movm.l EXC_DREGS(%a6),&0x0303
3905
3906 unlk %a6
3907
3908 fmov.l 0x2(%sp),%fpiar
3909 addq.l &0x4,0x2(%sp)
3910
3911 mov.l (%sp),-(%sp)
3912 mov.l 0x8(%sp),0x4(%sp)
3913 mov.b &0x20,0x6(%sp)
3914
3915 bra.l _fpsp_unimp
3916
3917fline_fline:
3918 movm.l EXC_DREGS(%a6),&0x0303
3919
3920 unlk %a6
3921
3922 bra.l _real_fline
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016 global _fpsp_unimp
4017_fpsp_unimp:
4018
4019 link.w %a6,&-LOCAL_SIZE
4020
4021 movm.l &0x0303,EXC_DREGS(%a6)
4022 fmovm.l %fpcr,%fpsr,%fpiar,USER_FPCR(%a6)
4023 fmovm.x &0xc0,EXC_FPREGS(%a6)
4024
4025 btst &0x5,EXC_SR(%a6)
4026 bne.b funimp_s
4027
4028
4029funimp_u:
4030 mov.l %usp,%a0
4031 mov.l %a0,EXC_A7(%a6)
4032 bra.b funimp_cont
4033
4034
4035
4036funimp_s:
4037 lea 4+EXC_EA(%a6),%a0
4038 mov.l %a0,EXC_A7(%a6)
4039 mov.l %a0,OLD_A7(%a6)
4040
4041funimp_cont:
4042
4043
4044 mov.l USER_FPIAR(%a6),EXC_EXTWPTR(%a6)
4045
4046 mov.l EXC_EXTWPTR(%a6),%a0
4047 addq.l &0x4,EXC_EXTWPTR(%a6)
4048 bsr.l _imem_read_long
4049 mov.l %d0,EXC_OPWORD(%a6)
4050
4051
4052
4053 fmov.l &0x0,%fpcr
4054 fmov.l &0x0,%fpsr
4055
4056 clr.b SPCOND_FLG(%a6)
4057
4058
4059
4060
4061
4062 btst &22,%d0
4063 bne.w funimp_misc
4064
4065
4066
4067
4068funimp_gen:
4069
4070 clr.b STORE_FLG(%a6)
4071
4072
4073 andi.l &0x00ff00ff,USER_FPSR(%a6)
4074
4075 bfextu %d0{&16:&6},%d1
4076 cmpi.b %d1,&0x17
4077 beq.w funimp_fmovcr
4078
4079funimp_gen_op:
4080 bsr.l _load_fop
4081
4082 clr.l %d0
4083 mov.b FPCR_MODE(%a6),%d0
4084
4085 mov.b 1+EXC_CMDREG(%a6),%d1
4086 andi.w &0x003f,%d1
4087 lsl.w &0x3,%d1
4088 or.b STAG(%a6),%d1
4089
4090 lea FP_DST(%a6),%a1
4091 lea FP_SRC(%a6),%a0
4092
4093 mov.w (tbl_trans.w,%pc,%d1.w*2),%d1
4094 jsr (tbl_trans.w,%pc,%d1.w*1)
4095
4096funimp_fsave:
4097 mov.b FPCR_ENABLE(%a6),%d0
4098 bne.w funimp_ena
4099
4100funimp_store:
4101 bfextu EXC_CMDREG(%a6){&6:&3},%d0
4102 bsr.l store_fpreg
4103
4104funimp_gen_exit:
4105 fmovm.x EXC_FP0(%a6),&0xc0
4106 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
4107 movm.l EXC_DREGS(%a6),&0x0303
4108
4109funimp_gen_exit_cmp:
4110 cmpi.b SPCOND_FLG(%a6),&mia7_flg
4111 beq.b funimp_gen_exit_a7
4112
4113 cmpi.b SPCOND_FLG(%a6),&mda7_flg
4114 beq.b funimp_gen_exit_a7
4115
4116funimp_gen_exit_cont:
4117 unlk %a6
4118
4119funimp_gen_exit_cont2:
4120 btst &0x7,(%sp)
4121 beq.l _fpsp_done
4122
4123
4124
4125
4126
4127 fsave -(%sp)
4128 fmov.l %fpiar,0x14(%sp)
4129 frestore (%sp)+
4130 mov.w &0x2024,0x6(%sp)
4131 bra.l _real_trace
4132
4133funimp_gen_exit_a7:
4134 btst &0x5,EXC_SR(%a6)
4135 bne.b funimp_gen_exit_a7_s
4136
4137 mov.l %a0,-(%sp)
4138 mov.l EXC_A7(%a6),%a0
4139 mov.l %a0,%usp
4140 mov.l (%sp)+,%a0
4141 bra.b funimp_gen_exit_cont
4142
4143
4144
4145
4146
4147funimp_gen_exit_a7_s:
4148 mov.l %d0,-(%sp)
4149 mov.l EXC_A7(%a6),%d0
4150 sub.l OLD_A7(%a6),%d0
4151 mov.l 0x2+EXC_PC(%a6),(0x2+EXC_PC,%a6,%d0)
4152 mov.l EXC_SR(%a6),(EXC_SR,%a6,%d0)
4153 mov.w %d0,EXC_SR(%a6)
4154 mov.l (%sp)+,%d0
4155
4156 unlk %a6
4157
4158 add.w (%sp),%sp
4159 bra.b funimp_gen_exit_cont2
4160
4161
4162
4163
4164funimp_fmovcr:
4165 clr.l %d0
4166 mov.b FPCR_MODE(%a6),%d0
4167 mov.b 1+EXC_CMDREG(%a6),%d1
4168 andi.l &0x0000007f,%d1
4169 bsr.l smovcr
4170 bra.w funimp_fsave
4171
4172
4173
4174
4175
4176
4177
4178funimp_ena:
4179
4180
4181 and.b FPSR_EXCEPT(%a6),%d0
4182 bfffo %d0{&24:&8},%d0
4183 bne.b funimp_exc
4184
4185
4186
4187
4188 btst &ovfl_bit,FPSR_EXCEPT(%a6)
4189 beq.w funimp_store
4190
4191
4192funimp_ovfl:
4193 btst &inex2_bit,FPCR_ENABLE(%a6)
4194 beq.w funimp_store
4195 bra.b funimp_exc_ovfl
4196
4197
4198
4199funimp_exc:
4200 subi.l &24,%d0
4201 cmpi.b %d0,&0x6
4202 bne.b funimp_exc_force
4203
4204
4205
4206
4207
4208
4209
4210 btst &ovfl_bit,FPSR_EXCEPT(%a6)
4211 bne.b funimp_exc_ovfl
4212 btst &unfl_bit,FPSR_EXCEPT(%a6)
4213 bne.b funimp_exc_unfl
4214
4215
4216
4217
4218funimp_exc_force:
4219 mov.l %d0,-(%sp)
4220 bsr.l funimp_skew
4221 mov.l (%sp)+,%d0
4222 mov.w (tbl_funimp_except.b,%pc,%d0.w*2),2+FP_SRC(%a6)
4223 bra.b funimp_gen_exit2
4224
4225tbl_funimp_except:
4226 short 0xe002, 0xe006, 0xe004, 0xe005
4227 short 0xe003, 0xe002, 0xe001, 0xe001
4228
4229
4230funimp_exc_ovfl:
4231 bsr.l funimp_skew
4232 mov.w &0xe005,2+FP_SRC(%a6)
4233 bra.b funimp_gen_exit2
4234
4235
4236funimp_exc_unfl:
4237 bsr.l funimp_skew
4238 mov.w &0xe003,2+FP_SRC(%a6)
4239
4240
4241
4242funimp_gen_exit2:
4243 fmovm.x EXC_FP0(%a6),&0xc0
4244 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
4245 movm.l EXC_DREGS(%a6),&0x0303
4246
4247 frestore FP_SRC(%a6)
4248
4249 bra.w funimp_gen_exit_cmp
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259funimp_misc:
4260 bfextu %d0{&10:&3},%d1
4261 cmpi.b %d1,&0x1
4262 beq.w funimp_fdbcc
4263 cmpi.b %d1,&0x7
4264 bne.w funimp_fscc
4265 bfextu %d0{&13:&3},%d1
4266 cmpi.b %d1,&0x2
4267 blt.w funimp_fscc
4268
4269
4270
4271
4272
4273
4274funimp_ftrapcc:
4275
4276 bsr.l _ftrapcc
4277
4278 cmpi.b SPCOND_FLG(%a6),&fbsun_flg
4279 beq.w funimp_bsun
4280
4281 cmpi.b SPCOND_FLG(%a6),&ftrapcc_flg
4282 bne.w funimp_done
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299funimp_ftrapcc_tp:
4300 mov.l USER_FPIAR(%a6),EXC_EA(%a6)
4301 mov.w &0x201c,EXC_VOFF(%a6)
4302
4303 fmovm.x EXC_FP0(%a6),&0xc0
4304 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
4305 movm.l EXC_DREGS(%a6),&0x0303
4306
4307 unlk %a6
4308 bra.l _real_trap
4309
4310
4311
4312
4313funimp_fdbcc:
4314
4315 mov.l EXC_EXTWPTR(%a6),%a0
4316 addq.l &0x2,EXC_EXTWPTR(%a6)
4317 bsr.l _imem_read_word
4318
4319 tst.l %d1
4320 bne.w funimp_iacc
4321
4322 ext.l %d0
4323
4324 bsr.l _fdbcc
4325
4326 cmpi.b SPCOND_FLG(%a6),&fbsun_flg
4327 beq.w funimp_bsun
4328
4329 bra.w funimp_done
4330
4331
4332
4333
4334funimp_fscc:
4335
4336 bsr.l _fscc
4337
4338
4339
4340 cmpi.b SPCOND_FLG(%a6),&fbsun_flg
4341 beq.w funimp_bsun
4342
4343 btst &0x5,EXC_SR(%a6)
4344 bne.b funimp_fscc_s
4345
4346funimp_fscc_u:
4347 mov.l EXC_A7(%a6),%a0
4348 mov.l %a0,%usp
4349 bra.w funimp_done
4350
4351
4352
4353
4354
4355
4356
4357
4358funimp_fscc_s:
4359 cmpi.b SPCOND_FLG(%a6),&mda7_flg
4360 bne.w funimp_done
4361
4362 fmovm.x EXC_FP0(%a6),&0xc0
4363 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
4364 movm.l EXC_DREGS(%a6),&0x0303
4365
4366 unlk %a6
4367
4368 btst &0x7,(%sp)
4369 bne.b funimp_fscc_s_trace
4370
4371 subq.l &0x2,%sp
4372 mov.l 0x2(%sp),(%sp)
4373 mov.l 0x6(%sp),0x4(%sp)
4374 bra.l _fpsp_done
4375
4376funimp_fscc_s_trace:
4377 subq.l &0x2,%sp
4378 mov.l 0x2(%sp),(%sp)
4379 mov.w 0x6(%sp),0x4(%sp)
4380 mov.w &0x2024,0x6(%sp)
4381 fmov.l %fpiar,0x8(%sp)
4382
4383 bra.l _real_trace
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403funimp_bsun:
4404 mov.w &0x00c0,2+EXC_EA(%a6)
4405 mov.l USER_FPIAR(%a6),EXC_VOFF(%a6)
4406 mov.w EXC_SR(%a6),2+EXC_PC(%a6)
4407
4408 mov.w &0xe000,2+FP_SRC(%a6)
4409
4410 fmovm.x EXC_FP0(%a6),&0xc0
4411 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
4412 movm.l EXC_DREGS(%a6),&0x0303
4413
4414 frestore FP_SRC(%a6)
4415
4416 unlk %a6
4417
4418 addq.l &0x4,%sp
4419
4420 bra.l _real_bsun
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430funimp_done:
4431 fmovm.x EXC_FP0(%a6),&0xc0
4432 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
4433 movm.l EXC_DREGS(%a6),&0x0303
4434
4435 unlk %a6
4436
4437 btst &0x7,(%sp)
4438 bne.b funimp_trace
4439
4440 bra.l _fpsp_done
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457funimp_trace:
4458 fmov.l %fpiar,0x8(%sp)
4459 mov.b &0x24,0x7(%sp)
4460
4461 bra.l _real_trace
4462
4463
4464
4465 global tbl_trans
4466 swbeg &0x1c0
4467tbl_trans:
4468 short tbl_trans - tbl_trans
4469 short tbl_trans - tbl_trans
4470 short tbl_trans - tbl_trans
4471 short tbl_trans - tbl_trans
4472 short tbl_trans - tbl_trans
4473 short tbl_trans - tbl_trans
4474 short tbl_trans - tbl_trans
4475 short tbl_trans - tbl_trans
4476
4477 short tbl_trans - tbl_trans
4478 short tbl_trans - tbl_trans
4479 short tbl_trans - tbl_trans
4480 short tbl_trans - tbl_trans
4481 short tbl_trans - tbl_trans
4482 short tbl_trans - tbl_trans
4483 short tbl_trans - tbl_trans
4484 short tbl_trans - tbl_trans
4485
4486 short ssinh - tbl_trans
4487 short src_zero - tbl_trans
4488 short src_inf - tbl_trans
4489 short src_qnan - tbl_trans
4490 short ssinhd - tbl_trans
4491 short src_snan - tbl_trans
4492 short tbl_trans - tbl_trans
4493 short tbl_trans - tbl_trans
4494
4495 short tbl_trans - tbl_trans
4496 short tbl_trans - tbl_trans
4497 short tbl_trans - tbl_trans
4498 short tbl_trans - tbl_trans
4499 short tbl_trans - tbl_trans
4500 short tbl_trans - tbl_trans
4501 short tbl_trans - tbl_trans
4502 short tbl_trans - tbl_trans
4503
4504 short tbl_trans - tbl_trans
4505 short tbl_trans - tbl_trans
4506 short tbl_trans - tbl_trans
4507 short tbl_trans - tbl_trans
4508 short tbl_trans - tbl_trans
4509 short tbl_trans - tbl_trans
4510 short tbl_trans - tbl_trans
4511 short tbl_trans - tbl_trans
4512
4513 short tbl_trans - tbl_trans
4514 short tbl_trans - tbl_trans
4515 short tbl_trans - tbl_trans
4516 short tbl_trans - tbl_trans
4517 short tbl_trans - tbl_trans
4518 short tbl_trans - tbl_trans
4519 short tbl_trans - tbl_trans
4520 short tbl_trans - tbl_trans
4521
4522 short slognp1 - tbl_trans
4523 short src_zero - tbl_trans
4524 short sopr_inf - tbl_trans
4525 short src_qnan - tbl_trans
4526 short slognp1d - tbl_trans
4527 short src_snan - tbl_trans
4528 short tbl_trans - tbl_trans
4529 short tbl_trans - tbl_trans
4530
4531 short tbl_trans - tbl_trans
4532 short tbl_trans - tbl_trans
4533 short tbl_trans - tbl_trans
4534 short tbl_trans - tbl_trans
4535 short tbl_trans - tbl_trans
4536 short tbl_trans - tbl_trans
4537 short tbl_trans - tbl_trans
4538 short tbl_trans - tbl_trans
4539
4540 short setoxm1 - tbl_trans
4541 short src_zero - tbl_trans
4542 short setoxm1i - tbl_trans
4543 short src_qnan - tbl_trans
4544 short setoxm1d - tbl_trans
4545 short src_snan - tbl_trans
4546 short tbl_trans - tbl_trans
4547 short tbl_trans - tbl_trans
4548
4549 short stanh - tbl_trans
4550 short src_zero - tbl_trans
4551 short src_one - tbl_trans
4552 short src_qnan - tbl_trans
4553 short stanhd - tbl_trans
4554 short src_snan - tbl_trans
4555 short tbl_trans - tbl_trans
4556 short tbl_trans - tbl_trans
4557
4558 short satan - tbl_trans
4559 short src_zero - tbl_trans
4560 short spi_2 - tbl_trans
4561 short src_qnan - tbl_trans
4562 short satand - tbl_trans
4563 short src_snan - tbl_trans
4564 short tbl_trans - tbl_trans
4565 short tbl_trans - tbl_trans
4566
4567 short tbl_trans - tbl_trans
4568 short tbl_trans - tbl_trans
4569 short tbl_trans - tbl_trans
4570 short tbl_trans - tbl_trans
4571 short tbl_trans - tbl_trans
4572 short tbl_trans - tbl_trans
4573 short tbl_trans - tbl_trans
4574 short tbl_trans - tbl_trans
4575
4576 short sasin - tbl_trans
4577 short src_zero - tbl_trans
4578 short t_operr - tbl_trans
4579 short src_qnan - tbl_trans
4580 short sasind - tbl_trans
4581 short src_snan - tbl_trans
4582 short tbl_trans - tbl_trans
4583 short tbl_trans - tbl_trans
4584
4585 short satanh - tbl_trans
4586 short src_zero - tbl_trans
4587 short t_operr - tbl_trans
4588 short src_qnan - tbl_trans
4589 short satanhd - tbl_trans
4590 short src_snan - tbl_trans
4591 short tbl_trans - tbl_trans
4592 short tbl_trans - tbl_trans
4593
4594 short ssin - tbl_trans
4595 short src_zero - tbl_trans
4596 short t_operr - tbl_trans
4597 short src_qnan - tbl_trans
4598 short ssind - tbl_trans
4599 short src_snan - tbl_trans
4600 short tbl_trans - tbl_trans
4601 short tbl_trans - tbl_trans
4602
4603 short stan - tbl_trans
4604 short src_zero - tbl_trans
4605 short t_operr - tbl_trans
4606 short src_qnan - tbl_trans
4607 short stand - tbl_trans
4608 short src_snan - tbl_trans
4609 short tbl_trans - tbl_trans
4610 short tbl_trans - tbl_trans
4611
4612 short setox - tbl_trans
4613 short ld_pone - tbl_trans
4614 short szr_inf - tbl_trans
4615 short src_qnan - tbl_trans
4616 short setoxd - tbl_trans
4617 short src_snan - tbl_trans
4618 short tbl_trans - tbl_trans
4619 short tbl_trans - tbl_trans
4620
4621 short stwotox - tbl_trans
4622 short ld_pone - tbl_trans
4623 short szr_inf - tbl_trans
4624 short src_qnan - tbl_trans
4625 short stwotoxd - tbl_trans
4626 short src_snan - tbl_trans
4627 short tbl_trans - tbl_trans
4628 short tbl_trans - tbl_trans
4629
4630 short stentox - tbl_trans
4631 short ld_pone - tbl_trans
4632 short szr_inf - tbl_trans
4633 short src_qnan - tbl_trans
4634 short stentoxd - tbl_trans
4635 short src_snan - tbl_trans
4636 short tbl_trans - tbl_trans
4637 short tbl_trans - tbl_trans
4638
4639 short tbl_trans - tbl_trans
4640 short tbl_trans - tbl_trans
4641 short tbl_trans - tbl_trans
4642 short tbl_trans - tbl_trans
4643 short tbl_trans - tbl_trans
4644 short tbl_trans - tbl_trans
4645 short tbl_trans - tbl_trans
4646 short tbl_trans - tbl_trans
4647
4648 short slogn - tbl_trans
4649 short t_dz2 - tbl_trans
4650 short sopr_inf - tbl_trans
4651 short src_qnan - tbl_trans
4652 short slognd - tbl_trans
4653 short src_snan - tbl_trans
4654 short tbl_trans - tbl_trans
4655 short tbl_trans - tbl_trans
4656
4657 short slog10 - tbl_trans
4658 short t_dz2 - tbl_trans
4659 short sopr_inf - tbl_trans
4660 short src_qnan - tbl_trans
4661 short slog10d - tbl_trans
4662 short src_snan - tbl_trans
4663 short tbl_trans - tbl_trans
4664 short tbl_trans - tbl_trans
4665
4666 short slog2 - tbl_trans
4667 short t_dz2 - tbl_trans
4668 short sopr_inf - tbl_trans
4669 short src_qnan - tbl_trans
4670 short slog2d - tbl_trans
4671 short src_snan - tbl_trans
4672 short tbl_trans - tbl_trans
4673 short tbl_trans - tbl_trans
4674
4675 short tbl_trans - tbl_trans
4676 short tbl_trans - tbl_trans
4677 short tbl_trans - tbl_trans
4678 short tbl_trans - tbl_trans
4679 short tbl_trans - tbl_trans
4680 short tbl_trans - tbl_trans
4681 short tbl_trans - tbl_trans
4682 short tbl_trans - tbl_trans
4683
4684 short tbl_trans - tbl_trans
4685 short tbl_trans - tbl_trans
4686 short tbl_trans - tbl_trans
4687 short tbl_trans - tbl_trans
4688 short tbl_trans - tbl_trans
4689 short tbl_trans - tbl_trans
4690 short tbl_trans - tbl_trans
4691 short tbl_trans - tbl_trans
4692
4693 short scosh - tbl_trans
4694 short ld_pone - tbl_trans
4695 short ld_pinf - tbl_trans
4696 short src_qnan - tbl_trans
4697 short scoshd - tbl_trans
4698 short src_snan - tbl_trans
4699 short tbl_trans - tbl_trans
4700 short tbl_trans - tbl_trans
4701
4702 short tbl_trans - tbl_trans
4703 short tbl_trans - tbl_trans
4704 short tbl_trans - tbl_trans
4705 short tbl_trans - tbl_trans
4706 short tbl_trans - tbl_trans
4707 short tbl_trans - tbl_trans
4708 short tbl_trans - tbl_trans
4709 short tbl_trans - tbl_trans
4710
4711 short tbl_trans - tbl_trans
4712 short tbl_trans - tbl_trans
4713 short tbl_trans - tbl_trans
4714 short tbl_trans - tbl_trans
4715 short tbl_trans - tbl_trans
4716 short tbl_trans - tbl_trans
4717 short tbl_trans - tbl_trans
4718 short tbl_trans - tbl_trans
4719
4720 short sacos - tbl_trans
4721 short ld_ppi2 - tbl_trans
4722 short t_operr - tbl_trans
4723 short src_qnan - tbl_trans
4724 short sacosd - tbl_trans
4725 short src_snan - tbl_trans
4726 short tbl_trans - tbl_trans
4727 short tbl_trans - tbl_trans
4728
4729 short scos - tbl_trans
4730 short ld_pone - tbl_trans
4731 short t_operr - tbl_trans
4732 short src_qnan - tbl_trans
4733 short scosd - tbl_trans
4734 short src_snan - tbl_trans
4735 short tbl_trans - tbl_trans
4736 short tbl_trans - tbl_trans
4737
4738 short sgetexp - tbl_trans
4739 short src_zero - tbl_trans
4740 short t_operr - tbl_trans
4741 short src_qnan - tbl_trans
4742 short sgetexpd - tbl_trans
4743 short src_snan - tbl_trans
4744 short tbl_trans - tbl_trans
4745 short tbl_trans - tbl_trans
4746
4747 short sgetman - tbl_trans
4748 short src_zero - tbl_trans
4749 short t_operr - tbl_trans
4750 short src_qnan - tbl_trans
4751 short sgetmand - tbl_trans
4752 short src_snan - tbl_trans
4753 short tbl_trans - tbl_trans
4754 short tbl_trans - tbl_trans
4755
4756 short tbl_trans - tbl_trans
4757 short tbl_trans - tbl_trans
4758 short tbl_trans - tbl_trans
4759 short tbl_trans - tbl_trans
4760 short tbl_trans - tbl_trans
4761 short tbl_trans - tbl_trans
4762 short tbl_trans - tbl_trans
4763 short tbl_trans - tbl_trans
4764
4765 short smod_snorm - tbl_trans
4766 short smod_szero - tbl_trans
4767 short smod_sinf - tbl_trans
4768 short sop_sqnan - tbl_trans
4769 short smod_sdnrm - tbl_trans
4770 short sop_ssnan - tbl_trans
4771 short tbl_trans - tbl_trans
4772 short tbl_trans - tbl_trans
4773
4774 short tbl_trans - tbl_trans
4775 short tbl_trans - tbl_trans
4776 short tbl_trans - tbl_trans
4777 short tbl_trans - tbl_trans
4778 short tbl_trans - tbl_trans
4779 short tbl_trans - tbl_trans
4780 short tbl_trans - tbl_trans
4781 short tbl_trans - tbl_trans
4782
4783 short tbl_trans - tbl_trans
4784 short tbl_trans - tbl_trans
4785 short tbl_trans - tbl_trans
4786 short tbl_trans - tbl_trans
4787 short tbl_trans - tbl_trans
4788 short tbl_trans - tbl_trans
4789 short tbl_trans - tbl_trans
4790 short tbl_trans - tbl_trans
4791
4792 short tbl_trans - tbl_trans
4793 short tbl_trans - tbl_trans
4794 short tbl_trans - tbl_trans
4795 short tbl_trans - tbl_trans
4796 short tbl_trans - tbl_trans
4797 short tbl_trans - tbl_trans
4798 short tbl_trans - tbl_trans
4799 short tbl_trans - tbl_trans
4800
4801 short srem_snorm - tbl_trans
4802 short srem_szero - tbl_trans
4803 short srem_sinf - tbl_trans
4804 short sop_sqnan - tbl_trans
4805 short srem_sdnrm - tbl_trans
4806 short sop_ssnan - tbl_trans
4807 short tbl_trans - tbl_trans
4808 short tbl_trans - tbl_trans
4809
4810 short sscale_snorm - tbl_trans
4811 short sscale_szero - tbl_trans
4812 short sscale_sinf - tbl_trans
4813 short sop_sqnan - tbl_trans
4814 short sscale_sdnrm - tbl_trans
4815 short sop_ssnan - tbl_trans
4816 short tbl_trans - tbl_trans
4817 short tbl_trans - tbl_trans
4818
4819 short tbl_trans - tbl_trans
4820 short tbl_trans - tbl_trans
4821 short tbl_trans - tbl_trans
4822 short tbl_trans - tbl_trans
4823 short tbl_trans - tbl_trans
4824 short tbl_trans - tbl_trans
4825 short tbl_trans - tbl_trans
4826 short tbl_trans - tbl_trans
4827
4828 short tbl_trans - tbl_trans
4829 short tbl_trans - tbl_trans
4830 short tbl_trans - tbl_trans
4831 short tbl_trans - tbl_trans
4832 short tbl_trans - tbl_trans
4833 short tbl_trans - tbl_trans
4834 short tbl_trans - tbl_trans
4835 short tbl_trans - tbl_trans
4836
4837 short tbl_trans - tbl_trans
4838 short tbl_trans - tbl_trans
4839 short tbl_trans - tbl_trans
4840 short tbl_trans - tbl_trans
4841 short tbl_trans - tbl_trans
4842 short tbl_trans - tbl_trans
4843 short tbl_trans - tbl_trans
4844 short tbl_trans - tbl_trans
4845
4846 short tbl_trans - tbl_trans
4847 short tbl_trans - tbl_trans
4848 short tbl_trans - tbl_trans
4849 short tbl_trans - tbl_trans
4850 short tbl_trans - tbl_trans
4851 short tbl_trans - tbl_trans
4852 short tbl_trans - tbl_trans
4853 short tbl_trans - tbl_trans
4854
4855 short tbl_trans - tbl_trans
4856 short tbl_trans - tbl_trans
4857 short tbl_trans - tbl_trans
4858 short tbl_trans - tbl_trans
4859 short tbl_trans - tbl_trans
4860 short tbl_trans - tbl_trans
4861 short tbl_trans - tbl_trans
4862 short tbl_trans - tbl_trans
4863
4864 short tbl_trans - tbl_trans
4865 short tbl_trans - tbl_trans
4866 short tbl_trans - tbl_trans
4867 short tbl_trans - tbl_trans
4868 short tbl_trans - tbl_trans
4869 short tbl_trans - tbl_trans
4870 short tbl_trans - tbl_trans
4871 short tbl_trans - tbl_trans
4872
4873 short tbl_trans - tbl_trans
4874 short tbl_trans - tbl_trans
4875 short tbl_trans - tbl_trans
4876 short tbl_trans - tbl_trans
4877 short tbl_trans - tbl_trans
4878 short tbl_trans - tbl_trans
4879 short tbl_trans - tbl_trans
4880 short tbl_trans - tbl_trans
4881
4882 short tbl_trans - tbl_trans
4883 short tbl_trans - tbl_trans
4884 short tbl_trans - tbl_trans
4885 short tbl_trans - tbl_trans
4886 short tbl_trans - tbl_trans
4887 short tbl_trans - tbl_trans
4888 short tbl_trans - tbl_trans
4889 short tbl_trans - tbl_trans
4890
4891 short tbl_trans - tbl_trans
4892 short tbl_trans - tbl_trans
4893 short tbl_trans - tbl_trans
4894 short tbl_trans - tbl_trans
4895 short tbl_trans - tbl_trans
4896 short tbl_trans - tbl_trans
4897 short tbl_trans - tbl_trans
4898 short tbl_trans - tbl_trans
4899
4900 short ssincos - tbl_trans
4901 short ssincosz - tbl_trans
4902 short ssincosi - tbl_trans
4903 short ssincosqnan - tbl_trans
4904 short ssincosd - tbl_trans
4905 short ssincossnan - tbl_trans
4906 short tbl_trans - tbl_trans
4907 short tbl_trans - tbl_trans
4908
4909 short ssincos - tbl_trans
4910 short ssincosz - tbl_trans
4911 short ssincosi - tbl_trans
4912 short ssincosqnan - tbl_trans
4913 short ssincosd - tbl_trans
4914 short ssincossnan - tbl_trans
4915 short tbl_trans - tbl_trans
4916 short tbl_trans - tbl_trans
4917
4918 short ssincos - tbl_trans
4919 short ssincosz - tbl_trans
4920 short ssincosi - tbl_trans
4921 short ssincosqnan - tbl_trans
4922 short ssincosd - tbl_trans
4923 short ssincossnan - tbl_trans
4924 short tbl_trans - tbl_trans
4925 short tbl_trans - tbl_trans
4926
4927 short ssincos - tbl_trans
4928 short ssincosz - tbl_trans
4929 short ssincosi - tbl_trans
4930 short ssincosqnan - tbl_trans
4931 short ssincosd - tbl_trans
4932 short ssincossnan - tbl_trans
4933 short tbl_trans - tbl_trans
4934 short tbl_trans - tbl_trans
4935
4936 short ssincos - tbl_trans
4937 short ssincosz - tbl_trans
4938 short ssincosi - tbl_trans
4939 short ssincosqnan - tbl_trans
4940 short ssincosd - tbl_trans
4941 short ssincossnan - tbl_trans
4942 short tbl_trans - tbl_trans
4943 short tbl_trans - tbl_trans
4944
4945 short ssincos - tbl_trans
4946 short ssincosz - tbl_trans
4947 short ssincosi - tbl_trans
4948 short ssincosqnan - tbl_trans
4949 short ssincosd - tbl_trans
4950 short ssincossnan - tbl_trans
4951 short tbl_trans - tbl_trans
4952 short tbl_trans - tbl_trans
4953
4954 short ssincos - tbl_trans
4955 short ssincosz - tbl_trans
4956 short ssincosi - tbl_trans
4957 short ssincosqnan - tbl_trans
4958 short ssincosd - tbl_trans
4959 short ssincossnan - tbl_trans
4960 short tbl_trans - tbl_trans
4961 short tbl_trans - tbl_trans
4962
4963 short ssincos - tbl_trans
4964 short ssincosz - tbl_trans
4965 short ssincosi - tbl_trans
4966 short ssincosqnan - tbl_trans
4967 short ssincosd - tbl_trans
4968 short ssincossnan - tbl_trans
4969 short tbl_trans - tbl_trans
4970 short tbl_trans - tbl_trans
4971
4972
4973
4974
4975
4976
4977funimp_iacc:
4978 movm.l EXC_DREGS(%a6),&0x0303
4979 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
4980 fmovm.x EXC_FPREGS(%a6),&0xc0
4981
4982 mov.l USER_FPIAR(%a6),EXC_PC(%a6)
4983
4984 unlk %a6
4985
4986 mov.l (%sp),-(%sp)
4987 mov.w 0x8(%sp),0x4(%sp)
4988 mov.w &0x4008,0x6(%sp)
4989 mov.l 0x2(%sp),0x8(%sp)
4990 mov.l &0x09428001,0xc(%sp)
4991
4992 btst &0x5,(%sp)
4993 beq.b funimp_iacc_end
4994 bset &0x2,0xd(%sp)
4995
4996funimp_iacc_end:
4997 bra.l _real_access
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085SINA7: long 0xBD6AAA77,0xCCC994F5
5086SINA6: long 0x3DE61209,0x7AAE8DA1
5087SINA5: long 0xBE5AE645,0x2A118AE4
5088SINA4: long 0x3EC71DE3,0xA5341531
5089SINA3: long 0xBF2A01A0,0x1A018B59,0x00000000,0x00000000
5090SINA2: long 0x3FF80000,0x88888888,0x888859AF,0x00000000
5091SINA1: long 0xBFFC0000,0xAAAAAAAA,0xAAAAAA99,0x00000000
5092
5093COSB8: long 0x3D2AC4D0,0xD6011EE3
5094COSB7: long 0xBDA9396F,0x9F45AC19
5095COSB6: long 0x3E21EED9,0x0612C972
5096COSB5: long 0xBE927E4F,0xB79D9FCF
5097COSB4: long 0x3EFA01A0,0x1A01D423,0x00000000,0x00000000
5098COSB3: long 0xBFF50000,0xB60B60B6,0x0B61D438,0x00000000
5099COSB2: long 0x3FFA0000,0xAAAAAAAA,0xAAAAAB5E
5100COSB1: long 0xBF000000
5101
5102 set INARG,FP_SCR0
5103
5104 set X,FP_SCR0
5105
5106 set XFRAC,X+4
5107
5108 set RPRIME,FP_SCR0
5109 set SPRIME,FP_SCR1
5110
5111 set POSNEG1,L_SCR1
5112 set TWOTO63,L_SCR1
5113
5114 set ENDFLAG,L_SCR2
5115 set INT,L_SCR2
5116
5117 set ADJN,L_SCR3
5118
5119
5120 global ssin
5121ssin:
5122 mov.l &0,ADJN(%a6)
5123 bra.b SINBGN
5124
5125
5126 global scos
5127scos:
5128 mov.l &1,ADJN(%a6)
5129
5130
5131SINBGN:
5132
5133
5134 fmov.x (%a0),%fp0
5135 fmov.x %fp0,X(%a6)
5136
5137
5138 mov.l (%a0),%d1
5139 mov.w 4(%a0),%d1
5140 and.l &0x7FFFFFFF,%d1
5141
5142 cmpi.l %d1,&0x3FD78000
5143 bge.b SOK1
5144 bra.w SINSM
5145
5146SOK1:
5147 cmp.l %d1,&0x4004BC7E
5148 blt.b SINMAIN
5149 bra.w SREDUCEX
5150
5151
5152
5153SINMAIN:
5154 fmov.x %fp0,%fp1
5155 fmul.d TWOBYPI(%pc),%fp1
5156
5157 lea PITBL+0x200(%pc),%a1
5158
5159 fmov.l %fp1,INT(%a6)
5160
5161 mov.l INT(%a6),%d1
5162 asl.l &4,%d1
5163 add.l %d1,%a1
5164
5165
5166
5167 fsub.x (%a1)+,%fp0
5168 fsub.s (%a1),%fp0
5169
5170SINCONT:
5171
5172
5173
5174 mov.l INT(%a6),%d1
5175 add.l ADJN(%a6),%d1
5176 ror.l &1,%d1
5177 cmp.l %d1,&0
5178 blt.w COSPOLY
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188SINPOLY:
5189 fmovm.x &0x0c,-(%sp)
5190
5191 fmov.x %fp0,X(%a6)
5192 fmul.x %fp0,%fp0
5193
5194 fmov.d SINA7(%pc),%fp3
5195 fmov.d SINA6(%pc),%fp2
5196
5197 fmov.x %fp0,%fp1
5198 fmul.x %fp1,%fp1
5199
5200 ror.l &1,%d1
5201 and.l &0x80000000,%d1
5202
5203 eor.l %d1,X(%a6)
5204
5205 fmul.x %fp1,%fp3
5206 fmul.x %fp1,%fp2
5207
5208 fadd.d SINA5(%pc),%fp3
5209 fadd.d SINA4(%pc),%fp2
5210
5211 fmul.x %fp1,%fp3
5212 fmul.x %fp1,%fp2
5213
5214 fadd.d SINA3(%pc),%fp3
5215 fadd.x SINA2(%pc),%fp2
5216
5217 fmul.x %fp3,%fp1
5218
5219 fmul.x %fp0,%fp2
5220 fadd.x SINA1(%pc),%fp1
5221 fmul.x X(%a6),%fp0
5222
5223 fadd.x %fp2,%fp1
5224
5225 fmul.x %fp1,%fp0
5226
5227 fmovm.x (%sp)+,&0x30
5228
5229 fmov.l %d0,%fpcr
5230 fadd.x X(%a6),%fp0
5231 bra t_inx2
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242COSPOLY:
5243 fmovm.x &0x0c,-(%sp)
5244
5245 fmul.x %fp0,%fp0
5246
5247 fmov.d COSB8(%pc),%fp2
5248 fmov.d COSB7(%pc),%fp3
5249
5250 fmov.x %fp0,%fp1
5251 fmul.x %fp1,%fp1
5252
5253 fmov.x %fp0,X(%a6)
5254 ror.l &1,%d1
5255 and.l &0x80000000,%d1
5256
5257
5258 fmul.x %fp1,%fp2
5259
5260 eor.l %d1,X(%a6)
5261 and.l &0x80000000,%d1
5262
5263 fmul.x %fp1,%fp3
5264
5265 or.l &0x3F800000,%d1
5266 mov.l %d1,POSNEG1(%a6)
5267
5268 fadd.d COSB6(%pc),%fp2
5269 fadd.d COSB5(%pc),%fp3
5270
5271 fmul.x %fp1,%fp2
5272 fmul.x %fp1,%fp3
5273
5274 fadd.d COSB4(%pc),%fp2
5275 fadd.x COSB3(%pc),%fp3
5276
5277 fmul.x %fp1,%fp2
5278 fmul.x %fp3,%fp1
5279
5280 fadd.x COSB2(%pc),%fp2
5281 fadd.s COSB1(%pc),%fp1
5282
5283 fmul.x %fp2,%fp0
5284
5285 fadd.x %fp1,%fp0
5286
5287 fmul.x X(%a6),%fp0
5288
5289 fmovm.x (%sp)+,&0x30
5290
5291 fmov.l %d0,%fpcr
5292 fadd.s POSNEG1(%a6),%fp0
5293 bra t_inx2
5294
5295
5296
5297
5298
5299
5300SINBORS:
5301 cmp.l %d1,&0x3FFF8000
5302 bgt.l SREDUCEX
5303
5304SINSM:
5305 mov.l ADJN(%a6),%d1
5306 cmp.l %d1,&0
5307 bgt.b COSTINY
5308
5309
5310
5311SINTINY:
5312
5313
5314 fmov.l %d0,%fpcr
5315 mov.b &FMOV_OP,%d1
5316 fmov.x X(%a6),%fp0
5317 bra t_catch
5318
5319COSTINY:
5320 fmov.s &0x3F800000,%fp0
5321 fmov.l %d0,%fpcr
5322 fadd.s &0x80800000,%fp0
5323 bra t_pinx2
5324
5325
5326 global ssind
5327
5328ssind:
5329 bra t_extdnrm
5330
5331
5332 global scosd
5333
5334scosd:
5335 fmov.s &0x3F800000,%fp0
5336 bra t_pinx2
5337
5338
5339
5340 global ssincos
5341ssincos:
5342
5343 mov.l &4,ADJN(%a6)
5344
5345 fmov.x (%a0),%fp0
5346 fmov.x %fp0,X(%a6)
5347
5348 mov.l (%a0),%d1
5349 mov.w 4(%a0),%d1
5350 and.l &0x7FFFFFFF,%d1
5351
5352 cmp.l %d1,&0x3FD78000
5353 bge.b SCOK1
5354 bra.w SCSM
5355
5356SCOK1:
5357 cmp.l %d1,&0x4004BC7E
5358 blt.b SCMAIN
5359 bra.w SREDUCEX
5360
5361
5362
5363
5364SCMAIN:
5365 fmov.x %fp0,%fp1
5366
5367 fmul.d TWOBYPI(%pc),%fp1
5368
5369 lea PITBL+0x200(%pc),%a1
5370
5371 fmov.l %fp1,INT(%a6)
5372
5373 mov.l INT(%a6),%d1
5374 asl.l &4,%d1
5375 add.l %d1,%a1
5376
5377 fsub.x (%a1)+,%fp0
5378 fsub.s (%a1),%fp0
5379
5380SCCONT:
5381
5382
5383 mov.l INT(%a6),%d1
5384 ror.l &1,%d1
5385 cmp.l %d1,&0
5386 bge.w NEVEN
5387
5388SNODD:
5389
5390 fmovm.x &0x04,-(%sp)
5391
5392 fmov.x %fp0,RPRIME(%a6)
5393 fmul.x %fp0,%fp0
5394 fmov.d SINA7(%pc),%fp1
5395 fmov.d COSB8(%pc),%fp2
5396 fmul.x %fp0,%fp1
5397 fmul.x %fp0,%fp2
5398
5399 mov.l %d2,-(%sp)
5400 mov.l %d1,%d2
5401 ror.l &1,%d2
5402 and.l &0x80000000,%d2
5403 eor.l %d1,%d2
5404 and.l &0x80000000,%d2
5405
5406 fadd.d SINA6(%pc),%fp1
5407 fadd.d COSB7(%pc),%fp2
5408
5409 fmul.x %fp0,%fp1
5410 eor.l %d2,RPRIME(%a6)
5411 mov.l (%sp)+,%d2
5412 fmul.x %fp0,%fp2
5413 ror.l &1,%d1
5414 and.l &0x80000000,%d1
5415 mov.l &0x3F800000,POSNEG1(%a6)
5416 eor.l %d1,POSNEG1(%a6)
5417
5418 fadd.d SINA5(%pc),%fp1
5419 fadd.d COSB6(%pc),%fp2
5420
5421 fmul.x %fp0,%fp1
5422 fmul.x %fp0,%fp2
5423 fmov.x %fp0,SPRIME(%a6)
5424
5425 fadd.d SINA4(%pc),%fp1
5426 eor.l %d1,SPRIME(%a6)
5427 fadd.d COSB5(%pc),%fp2
5428
5429 fmul.x %fp0,%fp1
5430 fmul.x %fp0,%fp2
5431
5432 fadd.d SINA3(%pc),%fp1
5433 fadd.d COSB4(%pc),%fp2
5434
5435 fmul.x %fp0,%fp1
5436 fmul.x %fp0,%fp2
5437
5438 fadd.x SINA2(%pc),%fp1
5439 fadd.x COSB3(%pc),%fp2
5440
5441 fmul.x %fp0,%fp1
5442 fmul.x %fp0,%fp2
5443
5444 fadd.x SINA1(%pc),%fp1
5445 fadd.x COSB2(%pc),%fp2
5446
5447 fmul.x %fp0,%fp1
5448 fmul.x %fp2,%fp0
5449
5450 fmul.x RPRIME(%a6),%fp1
5451 fadd.s COSB1(%pc),%fp0
5452 fmul.x SPRIME(%a6),%fp0
5453
5454 fmovm.x (%sp)+,&0x20
5455
5456 fmov.l %d0,%fpcr
5457 fadd.x RPRIME(%a6),%fp1
5458 bsr sto_cos
5459 fadd.s POSNEG1(%a6),%fp0
5460 bra t_inx2
5461
5462NEVEN:
5463
5464 fmovm.x &0x04,-(%sp)
5465
5466 fmov.x %fp0,RPRIME(%a6)
5467 fmul.x %fp0,%fp0
5468
5469 fmov.d COSB8(%pc),%fp1
5470 fmov.d SINA7(%pc),%fp2
5471
5472 fmul.x %fp0,%fp1
5473 fmov.x %fp0,SPRIME(%a6)
5474 fmul.x %fp0,%fp2
5475
5476 ror.l &1,%d1
5477 and.l &0x80000000,%d1
5478
5479 fadd.d COSB7(%pc),%fp1
5480 fadd.d SINA6(%pc),%fp2
5481
5482 eor.l %d1,RPRIME(%a6)
5483 eor.l %d1,SPRIME(%a6)
5484
5485 fmul.x %fp0,%fp1
5486
5487 or.l &0x3F800000,%d1
5488 mov.l %d1,POSNEG1(%a6)
5489
5490 fmul.x %fp0,%fp2
5491
5492 fadd.d COSB6(%pc),%fp1
5493 fadd.d SINA5(%pc),%fp2
5494
5495 fmul.x %fp0,%fp1
5496 fmul.x %fp0,%fp2
5497
5498 fadd.d COSB5(%pc),%fp1
5499 fadd.d SINA4(%pc),%fp2
5500
5501 fmul.x %fp0,%fp1
5502 fmul.x %fp0,%fp2
5503
5504 fadd.d COSB4(%pc),%fp1
5505 fadd.d SINA3(%pc),%fp2
5506
5507 fmul.x %fp0,%fp1
5508 fmul.x %fp0,%fp2
5509
5510 fadd.x COSB3(%pc),%fp1
5511 fadd.x SINA2(%pc),%fp2
5512
5513 fmul.x %fp0,%fp1
5514 fmul.x %fp0,%fp2
5515
5516 fadd.x COSB2(%pc),%fp1
5517 fadd.x SINA1(%pc),%fp2
5518
5519 fmul.x %fp0,%fp1
5520 fmul.x %fp2,%fp0
5521
5522
5523 fadd.s COSB1(%pc),%fp1
5524 fmul.x RPRIME(%a6),%fp0
5525 fmul.x SPRIME(%a6),%fp1
5526
5527 fmovm.x (%sp)+,&0x20
5528
5529 fmov.l %d0,%fpcr
5530 fadd.s POSNEG1(%a6),%fp1
5531 bsr sto_cos
5532 fadd.x RPRIME(%a6),%fp0
5533 bra t_inx2
5534
5535
5536
5537SCBORS:
5538 cmp.l %d1,&0x3FFF8000
5539 bgt.w SREDUCEX
5540
5541
5542
5543SCSM:
5544
5545 fmov.s &0x3F800000,%fp1
5546
5547 fmov.l %d0,%fpcr
5548 fsub.s &0x00800000,%fp1
5549 bsr sto_cos
5550 fmov.l %fpcr,%d0
5551 mov.b &FMOV_OP,%d1
5552 fmov.x X(%a6),%fp0
5553 bra t_catch
5554
5555
5556
5557 global ssincosd
5558
5559ssincosd:
5560 mov.l %d0,-(%sp)
5561 fmov.s &0x3F800000,%fp1
5562 bsr sto_cos
5563 mov.l (%sp)+,%d0
5564 bra t_extdnrm
5565
5566
5567
5568
5569
5570
5571SREDUCEX:
5572 fmovm.x &0x3c,-(%sp)
5573 mov.l %d2,-(%sp)
5574 fmov.s &0x00000000,%fp1
5575
5576
5577
5578
5579
5580 cmp.l %d1,&0x7ffeffff
5581 bne.b SLOOP
5582
5583
5584 mov.w &0x7ffe,FP_SCR0_EX(%a6)
5585 mov.l &0xc90fdaa2,FP_SCR0_HI(%a6)
5586 clr.l FP_SCR0_LO(%a6)
5587
5588
5589 mov.w &0x7fdc,FP_SCR1_EX(%a6)
5590 mov.l &0x85a308d3,FP_SCR1_HI(%a6)
5591 clr.l FP_SCR1_LO(%a6)
5592
5593 ftest.x %fp0
5594 fblt.w sred_neg
5595
5596 or.b &0x80,FP_SCR0_EX(%a6)
5597 or.b &0x80,FP_SCR1_EX(%a6)
5598sred_neg:
5599 fadd.x FP_SCR0(%a6),%fp0
5600 fmov.x %fp0,%fp1
5601 fadd.x FP_SCR1(%a6),%fp0
5602 fsub.x %fp0,%fp1
5603 fadd.x FP_SCR1(%a6),%fp1
5604
5605
5606
5607
5608SLOOP:
5609 fmov.x %fp0,INARG(%a6)
5610 mov.w INARG(%a6),%d1
5611 mov.l %d1,%a1
5612 and.l &0x00007FFF,%d1
5613 sub.l &0x00003FFF,%d1
5614 cmp.l %d1,&28
5615 ble.b SLASTLOOP
5616SCONTLOOP:
5617 sub.l &27,%d1
5618 mov.b &0,ENDFLAG(%a6)
5619 bra.b SWORK
5620SLASTLOOP:
5621 clr.l %d1
5622 mov.b &1,ENDFLAG(%a6)
5623
5624SWORK:
5625
5626
5627
5628
5629
5630
5631 mov.l &0x00003FFE,%d2
5632 sub.l %d1,%d2
5633
5634 mov.l &0xA2F9836E,FP_SCR0_HI(%a6)
5635 mov.l &0x4E44152A,FP_SCR0_LO(%a6)
5636 mov.w %d2,FP_SCR0_EX(%a6)
5637
5638 fmov.x %fp0,%fp2
5639 fmul.x FP_SCR0(%a6),%fp2
5640
5641
5642
5643
5644
5645
5646 mov.l %a1,%d2
5647 swap %d2
5648 and.l &0x80000000,%d2
5649 or.l &0x5F000000,%d2
5650 mov.l %d2,TWOTO63(%a6)
5651 fadd.s TWOTO63(%a6),%fp2
5652 fsub.s TWOTO63(%a6),%fp2
5653
5654
5655
5656 mov.l %d1,%d2
5657
5658 add.l &0x00003FFF,%d2
5659 mov.w %d2,FP_SCR0_EX(%a6)
5660 mov.l &0xC90FDAA2,FP_SCR0_HI(%a6)
5661 clr.l FP_SCR0_LO(%a6)
5662
5663 add.l &0x00003FDD,%d1
5664 mov.w %d1,FP_SCR1_EX(%a6)
5665 mov.l &0x85A308D3,FP_SCR1_HI(%a6)
5666 clr.l FP_SCR1_LO(%a6)
5667
5668 mov.b ENDFLAG(%a6),%d1
5669
5670
5671
5672 fmov.x %fp2,%fp4
5673 fmul.x FP_SCR0(%a6),%fp4
5674 fmov.x %fp2,%fp5
5675 fmul.x FP_SCR1(%a6),%fp5
5676 fmov.x %fp4,%fp3
5677
5678
5679
5680 fadd.x %fp5,%fp3
5681 fsub.x %fp3,%fp4
5682
5683 fsub.x %fp3,%fp0
5684 fadd.x %fp5,%fp4
5685
5686 fmov.x %fp0,%fp3
5687 fsub.x %fp4,%fp1
5688
5689
5690
5691 fadd.x %fp1,%fp0
5692
5693 cmp.b %d1,&0
5694 bgt.w SRESTORE
5695
5696
5697 fsub.x %fp0,%fp3
5698 fadd.x %fp3,%fp1
5699 bra.w SLOOP
5700
5701SRESTORE:
5702 fmov.l %fp2,INT(%a6)
5703 mov.l (%sp)+,%d2
5704 fmovm.x (%sp)+,&0x3c
5705
5706 mov.l ADJN(%a6),%d1
5707 cmp.l %d1,&4
5708
5709 blt.w SINCONT
5710 bra.w SCCONT
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759TANQ4:
5760 long 0x3EA0B759,0xF50F8688
5761TANP3:
5762 long 0xBEF2BAA5,0xA8924F04
5763
5764TANQ3:
5765 long 0xBF346F59,0xB39BA65F,0x00000000,0x00000000
5766
5767TANP2:
5768 long 0x3FF60000,0xE073D3FC,0x199C4A00,0x00000000
5769
5770TANQ2:
5771 long 0x3FF90000,0xD23CD684,0x15D95FA1,0x00000000
5772
5773TANP1:
5774 long 0xBFFC0000,0x8895A6C5,0xFB423BCA,0x00000000
5775
5776TANQ1:
5777 long 0xBFFD0000,0xEEF57E0D,0xA84BC8CE,0x00000000
5778
5779INVTWOPI:
5780 long 0x3FFC0000,0xA2F9836E,0x4E44152A,0x00000000
5781
5782TWOPI1:
5783 long 0x40010000,0xC90FDAA2,0x00000000,0x00000000
5784TWOPI2:
5785 long 0x3FDF0000,0x85A308D4,0x00000000,0x00000000
5786
5787
5788
5789
5790
5791PITBL:
5792 long 0xC0040000,0xC90FDAA2,0x2168C235,0x21800000
5793 long 0xC0040000,0xC2C75BCD,0x105D7C23,0xA0D00000
5794 long 0xC0040000,0xBC7EDCF7,0xFF523611,0xA1E80000
5795 long 0xC0040000,0xB6365E22,0xEE46F000,0x21480000
5796 long 0xC0040000,0xAFEDDF4D,0xDD3BA9EE,0xA1200000
5797 long 0xC0040000,0xA9A56078,0xCC3063DD,0x21FC0000
5798 long 0xC0040000,0xA35CE1A3,0xBB251DCB,0x21100000
5799 long 0xC0040000,0x9D1462CE,0xAA19D7B9,0xA1580000
5800 long 0xC0040000,0x96CBE3F9,0x990E91A8,0x21E00000
5801 long 0xC0040000,0x90836524,0x88034B96,0x20B00000
5802 long 0xC0040000,0x8A3AE64F,0x76F80584,0xA1880000
5803 long 0xC0040000,0x83F2677A,0x65ECBF73,0x21C40000
5804 long 0xC0030000,0xFB53D14A,0xA9C2F2C2,0x20000000
5805 long 0xC0030000,0xEEC2D3A0,0x87AC669F,0x21380000
5806 long 0xC0030000,0xE231D5F6,0x6595DA7B,0xA1300000
5807 long 0xC0030000,0xD5A0D84C,0x437F4E58,0x9FC00000
5808 long 0xC0030000,0xC90FDAA2,0x2168C235,0x21000000
5809 long 0xC0030000,0xBC7EDCF7,0xFF523611,0xA1680000
5810 long 0xC0030000,0xAFEDDF4D,0xDD3BA9EE,0xA0A00000
5811 long 0xC0030000,0xA35CE1A3,0xBB251DCB,0x20900000
5812 long 0xC0030000,0x96CBE3F9,0x990E91A8,0x21600000
5813 long 0xC0030000,0x8A3AE64F,0x76F80584,0xA1080000
5814 long 0xC0020000,0xFB53D14A,0xA9C2F2C2,0x1F800000
5815 long 0xC0020000,0xE231D5F6,0x6595DA7B,0xA0B00000
5816 long 0xC0020000,0xC90FDAA2,0x2168C235,0x20800000
5817 long 0xC0020000,0xAFEDDF4D,0xDD3BA9EE,0xA0200000
5818 long 0xC0020000,0x96CBE3F9,0x990E91A8,0x20E00000
5819 long 0xC0010000,0xFB53D14A,0xA9C2F2C2,0x1F000000
5820 long 0xC0010000,0xC90FDAA2,0x2168C235,0x20000000
5821 long 0xC0010000,0x96CBE3F9,0x990E91A8,0x20600000
5822 long 0xC0000000,0xC90FDAA2,0x2168C235,0x1F800000
5823 long 0xBFFF0000,0xC90FDAA2,0x2168C235,0x1F000000
5824 long 0x00000000,0x00000000,0x00000000,0x00000000
5825 long 0x3FFF0000,0xC90FDAA2,0x2168C235,0x9F000000
5826 long 0x40000000,0xC90FDAA2,0x2168C235,0x9F800000
5827 long 0x40010000,0x96CBE3F9,0x990E91A8,0xA0600000
5828 long 0x40010000,0xC90FDAA2,0x2168C235,0xA0000000
5829 long 0x40010000,0xFB53D14A,0xA9C2F2C2,0x9F000000
5830 long 0x40020000,0x96CBE3F9,0x990E91A8,0xA0E00000
5831 long 0x40020000,0xAFEDDF4D,0xDD3BA9EE,0x20200000
5832 long 0x40020000,0xC90FDAA2,0x2168C235,0xA0800000
5833 long 0x40020000,0xE231D5F6,0x6595DA7B,0x20B00000
5834 long 0x40020000,0xFB53D14A,0xA9C2F2C2,0x9F800000
5835 long 0x40030000,0x8A3AE64F,0x76F80584,0x21080000
5836 long 0x40030000,0x96CBE3F9,0x990E91A8,0xA1600000
5837 long 0x40030000,0xA35CE1A3,0xBB251DCB,0xA0900000
5838 long 0x40030000,0xAFEDDF4D,0xDD3BA9EE,0x20A00000
5839 long 0x40030000,0xBC7EDCF7,0xFF523611,0x21680000
5840 long 0x40030000,0xC90FDAA2,0x2168C235,0xA1000000
5841 long 0x40030000,0xD5A0D84C,0x437F4E58,0x1FC00000
5842 long 0x40030000,0xE231D5F6,0x6595DA7B,0x21300000
5843 long 0x40030000,0xEEC2D3A0,0x87AC669F,0xA1380000
5844 long 0x40030000,0xFB53D14A,0xA9C2F2C2,0xA0000000
5845 long 0x40040000,0x83F2677A,0x65ECBF73,0xA1C40000
5846 long 0x40040000,0x8A3AE64F,0x76F80584,0x21880000
5847 long 0x40040000,0x90836524,0x88034B96,0xA0B00000
5848 long 0x40040000,0x96CBE3F9,0x990E91A8,0xA1E00000
5849 long 0x40040000,0x9D1462CE,0xAA19D7B9,0x21580000
5850 long 0x40040000,0xA35CE1A3,0xBB251DCB,0xA1100000
5851 long 0x40040000,0xA9A56078,0xCC3063DD,0xA1FC0000
5852 long 0x40040000,0xAFEDDF4D,0xDD3BA9EE,0x21200000
5853 long 0x40040000,0xB6365E22,0xEE46F000,0xA1480000
5854 long 0x40040000,0xBC7EDCF7,0xFF523611,0x21E80000
5855 long 0x40040000,0xC2C75BCD,0x105D7C23,0x20D00000
5856 long 0x40040000,0xC90FDAA2,0x2168C235,0xA1800000
5857
5858 set INARG,FP_SCR0
5859
5860 set TWOTO63,L_SCR1
5861 set INT,L_SCR1
5862 set ENDFLAG,L_SCR2
5863
5864 global stan
5865stan:
5866 fmov.x (%a0),%fp0
5867
5868 mov.l (%a0),%d1
5869 mov.w 4(%a0),%d1
5870 and.l &0x7FFFFFFF,%d1
5871
5872 cmp.l %d1,&0x3FD78000
5873 bge.b TANOK1
5874 bra.w TANSM
5875TANOK1:
5876 cmp.l %d1,&0x4004BC7E
5877 blt.b TANMAIN
5878 bra.w REDUCEX
5879
5880TANMAIN:
5881
5882
5883 fmov.x %fp0,%fp1
5884 fmul.d TWOBYPI(%pc),%fp1
5885
5886 lea.l PITBL+0x200(%pc),%a1
5887
5888 fmov.l %fp1,%d1
5889
5890 asl.l &4,%d1
5891 add.l %d1,%a1
5892
5893 fsub.x (%a1)+,%fp0
5894
5895 fsub.s (%a1),%fp0
5896
5897 ror.l &5,%d1
5898 and.l &0x80000000,%d1
5899
5900TANCONT:
5901 fmovm.x &0x0c,-(%sp)
5902
5903 cmp.l %d1,&0
5904 blt.w NODD
5905
5906 fmov.x %fp0,%fp1
5907 fmul.x %fp1,%fp1
5908
5909 fmov.d TANQ4(%pc),%fp3
5910 fmov.d TANP3(%pc),%fp2
5911
5912 fmul.x %fp1,%fp3
5913 fmul.x %fp1,%fp2
5914
5915 fadd.d TANQ3(%pc),%fp3
5916 fadd.x TANP2(%pc),%fp2
5917
5918 fmul.x %fp1,%fp3
5919 fmul.x %fp1,%fp2
5920
5921 fadd.x TANQ2(%pc),%fp3
5922 fadd.x TANP1(%pc),%fp2
5923
5924 fmul.x %fp1,%fp3
5925 fmul.x %fp1,%fp2
5926
5927 fadd.x TANQ1(%pc),%fp3
5928 fmul.x %fp0,%fp2
5929
5930 fmul.x %fp3,%fp1
5931
5932 fadd.x %fp2,%fp0
5933
5934 fadd.s &0x3F800000,%fp1
5935
5936 fmovm.x (%sp)+,&0x30
5937
5938 fmov.l %d0,%fpcr
5939 fdiv.x %fp1,%fp0
5940 bra t_inx2
5941
5942NODD:
5943 fmov.x %fp0,%fp1
5944 fmul.x %fp0,%fp0
5945
5946 fmov.d TANQ4(%pc),%fp3
5947 fmov.d TANP3(%pc),%fp2
5948
5949 fmul.x %fp0,%fp3
5950 fmul.x %fp0,%fp2
5951
5952 fadd.d TANQ3(%pc),%fp3
5953 fadd.x TANP2(%pc),%fp2
5954
5955 fmul.x %fp0,%fp3
5956 fmul.x %fp0,%fp2
5957
5958 fadd.x TANQ2(%pc),%fp3
5959 fadd.x TANP1(%pc),%fp2
5960
5961 fmul.x %fp0,%fp3
5962 fmul.x %fp0,%fp2
5963
5964 fadd.x TANQ1(%pc),%fp3
5965 fmul.x %fp1,%fp2
5966
5967 fmul.x %fp3,%fp0
5968
5969 fadd.x %fp2,%fp1
5970 fadd.s &0x3F800000,%fp0
5971
5972 fmovm.x (%sp)+,&0x30
5973
5974 fmov.x %fp1,-(%sp)
5975 eor.l &0x80000000,(%sp)
5976
5977 fmov.l %d0,%fpcr
5978 fdiv.x (%sp)+,%fp0
5979 bra t_inx2
5980
5981TANBORS:
5982
5983
5984 cmp.l %d1,&0x3FFF8000
5985 bgt.b REDUCEX
5986
5987TANSM:
5988 fmov.x %fp0,-(%sp)
5989 fmov.l %d0,%fpcr
5990 mov.b &FMOV_OP,%d1
5991 fmov.x (%sp)+,%fp0
5992 bra t_catch
5993
5994 global stand
5995
5996stand:
5997 bra t_extdnrm
5998
5999
6000
6001
6002REDUCEX:
6003 fmovm.x &0x3c,-(%sp)
6004 mov.l %d2,-(%sp)
6005 fmov.s &0x00000000,%fp1
6006
6007
6008
6009
6010
6011 cmp.l %d1,&0x7ffeffff
6012 bne.b LOOP
6013
6014
6015 mov.w &0x7ffe,FP_SCR0_EX(%a6)
6016 mov.l &0xc90fdaa2,FP_SCR0_HI(%a6)
6017 clr.l FP_SCR0_LO(%a6)
6018
6019
6020 mov.w &0x7fdc,FP_SCR1_EX(%a6)
6021 mov.l &0x85a308d3,FP_SCR1_HI(%a6)
6022 clr.l FP_SCR1_LO(%a6)
6023
6024 ftest.x %fp0
6025 fblt.w red_neg
6026
6027 or.b &0x80,FP_SCR0_EX(%a6)
6028 or.b &0x80,FP_SCR1_EX(%a6)
6029red_neg:
6030 fadd.x FP_SCR0(%a6),%fp0
6031 fmov.x %fp0,%fp1
6032 fadd.x FP_SCR1(%a6),%fp0
6033 fsub.x %fp0,%fp1
6034 fadd.x FP_SCR1(%a6),%fp1
6035
6036
6037
6038
6039LOOP:
6040 fmov.x %fp0,INARG(%a6)
6041 mov.w INARG(%a6),%d1
6042 mov.l %d1,%a1
6043 and.l &0x00007FFF,%d1
6044 sub.l &0x00003FFF,%d1
6045 cmp.l %d1,&28
6046 ble.b LASTLOOP
6047CONTLOOP:
6048 sub.l &27,%d1
6049 mov.b &0,ENDFLAG(%a6)
6050 bra.b WORK
6051LASTLOOP:
6052 clr.l %d1
6053 mov.b &1,ENDFLAG(%a6)
6054
6055WORK:
6056
6057
6058
6059
6060
6061
6062 mov.l &0x00003FFE,%d2
6063 sub.l %d1,%d2
6064
6065 mov.l &0xA2F9836E,FP_SCR0_HI(%a6)
6066 mov.l &0x4E44152A,FP_SCR0_LO(%a6)
6067 mov.w %d2,FP_SCR0_EX(%a6)
6068
6069 fmov.x %fp0,%fp2
6070 fmul.x FP_SCR0(%a6),%fp2
6071
6072
6073
6074
6075
6076
6077 mov.l %a1,%d2
6078 swap %d2
6079 and.l &0x80000000,%d2
6080 or.l &0x5F000000,%d2
6081 mov.l %d2,TWOTO63(%a6)
6082 fadd.s TWOTO63(%a6),%fp2
6083 fsub.s TWOTO63(%a6),%fp2
6084
6085
6086
6087 mov.l %d1,%d2
6088
6089 add.l &0x00003FFF,%d2
6090 mov.w %d2,FP_SCR0_EX(%a6)
6091 mov.l &0xC90FDAA2,FP_SCR0_HI(%a6)
6092 clr.l FP_SCR0_LO(%a6)
6093
6094 add.l &0x00003FDD,%d1
6095 mov.w %d1,FP_SCR1_EX(%a6)
6096 mov.l &0x85A308D3,FP_SCR1_HI(%a6)
6097 clr.l FP_SCR1_LO(%a6)
6098
6099 mov.b ENDFLAG(%a6),%d1
6100
6101
6102
6103 fmov.x %fp2,%fp4
6104 fmul.x FP_SCR0(%a6),%fp4
6105 fmov.x %fp2,%fp5
6106 fmul.x FP_SCR1(%a6),%fp5
6107 fmov.x %fp4,%fp3
6108
6109
6110
6111 fadd.x %fp5,%fp3
6112 fsub.x %fp3,%fp4
6113
6114 fsub.x %fp3,%fp0
6115 fadd.x %fp5,%fp4
6116
6117 fmov.x %fp0,%fp3
6118 fsub.x %fp4,%fp1
6119
6120
6121
6122 fadd.x %fp1,%fp0
6123
6124 cmp.b %d1,&0
6125 bgt.w RESTORE
6126
6127
6128 fsub.x %fp0,%fp3
6129 fadd.x %fp3,%fp1
6130 bra.w LOOP
6131
6132RESTORE:
6133 fmov.l %fp2,INT(%a6)
6134 mov.l (%sp)+,%d2
6135 fmovm.x (%sp)+,&0x3c
6136
6137 mov.l INT(%a6),%d1
6138 ror.l &1,%d1
6139
6140 bra.w TANCONT
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183ATANA3: long 0xBFF6687E,0x314987D8
6184ATANA2: long 0x4002AC69,0x34A26DB3
6185ATANA1: long 0xBFC2476F,0x4E1DA28E
6186
6187ATANB6: long 0x3FB34444,0x7F876989
6188ATANB5: long 0xBFB744EE,0x7FAF45DB
6189ATANB4: long 0x3FBC71C6,0x46940220
6190ATANB3: long 0xBFC24924,0x921872F9
6191ATANB2: long 0x3FC99999,0x99998FA9
6192ATANB1: long 0xBFD55555,0x55555555
6193
6194ATANC5: long 0xBFB70BF3,0x98539E6A
6195ATANC4: long 0x3FBC7187,0x962D1D7D
6196ATANC3: long 0xBFC24924,0x827107B8
6197ATANC2: long 0x3FC99999,0x9996263E
6198ATANC1: long 0xBFD55555,0x55555536
6199
6200PPIBY2: long 0x3FFF0000,0xC90FDAA2,0x2168C235,0x00000000
6201NPIBY2: long 0xBFFF0000,0xC90FDAA2,0x2168C235,0x00000000
6202
6203PTINY: long 0x00010000,0x80000000,0x00000000,0x00000000
6204NTINY: long 0x80010000,0x80000000,0x00000000,0x00000000
6205
6206ATANTBL:
6207 long 0x3FFB0000,0x83D152C5,0x060B7A51,0x00000000
6208 long 0x3FFB0000,0x8BC85445,0x65498B8B,0x00000000
6209 long 0x3FFB0000,0x93BE4060,0x17626B0D,0x00000000
6210 long 0x3FFB0000,0x9BB3078D,0x35AEC202,0x00000000
6211 long 0x3FFB0000,0xA3A69A52,0x5DDCE7DE,0x00000000
6212 long 0x3FFB0000,0xAB98E943,0x62765619,0x00000000
6213 long 0x3FFB0000,0xB389E502,0xF9C59862,0x00000000
6214 long 0x3FFB0000,0xBB797E43,0x6B09E6FB,0x00000000
6215 long 0x3FFB0000,0xC367A5C7,0x39E5F446,0x00000000
6216 long 0x3FFB0000,0xCB544C61,0xCFF7D5C6,0x00000000
6217 long 0x3FFB0000,0xD33F62F8,0x2488533E,0x00000000
6218 long 0x3FFB0000,0xDB28DA81,0x62404C77,0x00000000
6219 long 0x3FFB0000,0xE310A407,0x8AD34F18,0x00000000
6220 long 0x3FFB0000,0xEAF6B0A8,0x188EE1EB,0x00000000
6221 long 0x3FFB0000,0xF2DAF194,0x9DBE79D5,0x00000000
6222 long 0x3FFB0000,0xFABD5813,0x61D47E3E,0x00000000
6223 long 0x3FFC0000,0x8346AC21,0x0959ECC4,0x00000000
6224 long 0x3FFC0000,0x8B232A08,0x304282D8,0x00000000
6225 long 0x3FFC0000,0x92FB70B8,0xD29AE2F9,0x00000000
6226 long 0x3FFC0000,0x9ACF476F,0x5CCD1CB4,0x00000000
6227 long 0x3FFC0000,0xA29E7630,0x4954F23F,0x00000000
6228 long 0x3FFC0000,0xAA68C5D0,0x8AB85230,0x00000000
6229 long 0x3FFC0000,0xB22DFFFD,0x9D539F83,0x00000000
6230 long 0x3FFC0000,0xB9EDEF45,0x3E900EA5,0x00000000
6231 long 0x3FFC0000,0xC1A85F1C,0xC75E3EA5,0x00000000
6232 long 0x3FFC0000,0xC95D1BE8,0x28138DE6,0x00000000
6233 long 0x3FFC0000,0xD10BF300,0x840D2DE4,0x00000000
6234 long 0x3FFC0000,0xD8B4B2BA,0x6BC05E7A,0x00000000
6235 long 0x3FFC0000,0xE0572A6B,0xB42335F6,0x00000000
6236 long 0x3FFC0000,0xE7F32A70,0xEA9CAA8F,0x00000000
6237 long 0x3FFC0000,0xEF888432,0x64ECEFAA,0x00000000
6238 long 0x3FFC0000,0xF7170A28,0xECC06666,0x00000000
6239 long 0x3FFD0000,0x812FD288,0x332DAD32,0x00000000
6240 long 0x3FFD0000,0x88A8D1B1,0x218E4D64,0x00000000
6241 long 0x3FFD0000,0x9012AB3F,0x23E4AEE8,0x00000000
6242 long 0x3FFD0000,0x976CC3D4,0x11E7F1B9,0x00000000
6243 long 0x3FFD0000,0x9EB68949,0x3889A227,0x00000000
6244 long 0x3FFD0000,0xA5EF72C3,0x4487361B,0x00000000
6245 long 0x3FFD0000,0xAD1700BA,0xF07A7227,0x00000000
6246 long 0x3FFD0000,0xB42CBCFA,0xFD37EFB7,0x00000000
6247 long 0x3FFD0000,0xBB303A94,0x0BA80F89,0x00000000
6248 long 0x3FFD0000,0xC22115C6,0xFCAEBBAF,0x00000000
6249 long 0x3FFD0000,0xC8FEF3E6,0x86331221,0x00000000
6250 long 0x3FFD0000,0xCFC98330,0xB4000C70,0x00000000
6251 long 0x3FFD0000,0xD6807AA1,0x102C5BF9,0x00000000
6252 long 0x3FFD0000,0xDD2399BC,0x31252AA3,0x00000000
6253 long 0x3FFD0000,0xE3B2A855,0x6B8FC517,0x00000000
6254 long 0x3FFD0000,0xEA2D764F,0x64315989,0x00000000
6255 long 0x3FFD0000,0xF3BF5BF8,0xBAD1A21D,0x00000000
6256 long 0x3FFE0000,0x801CE39E,0x0D205C9A,0x00000000
6257 long 0x3FFE0000,0x8630A2DA,0xDA1ED066,0x00000000
6258 long 0x3FFE0000,0x8C1AD445,0xF3E09B8C,0x00000000
6259 long 0x3FFE0000,0x91DB8F16,0x64F350E2,0x00000000
6260 long 0x3FFE0000,0x97731420,0x365E538C,0x00000000
6261 long 0x3FFE0000,0x9CE1C8E6,0xA0B8CDBA,0x00000000
6262 long 0x3FFE0000,0xA22832DB,0xCADAAE09,0x00000000
6263 long 0x3FFE0000,0xA746F2DD,0xB7602294,0x00000000
6264 long 0x3FFE0000,0xAC3EC0FB,0x997DD6A2,0x00000000
6265 long 0x3FFE0000,0xB110688A,0xEBDC6F6A,0x00000000
6266 long 0x3FFE0000,0xB5BCC490,0x59ECC4B0,0x00000000
6267 long 0x3FFE0000,0xBA44BC7D,0xD470782F,0x00000000
6268 long 0x3FFE0000,0xBEA94144,0xFD049AAC,0x00000000
6269 long 0x3FFE0000,0xC2EB4ABB,0x661628B6,0x00000000
6270 long 0x3FFE0000,0xC70BD54C,0xE602EE14,0x00000000
6271 long 0x3FFE0000,0xCD000549,0xADEC7159,0x00000000
6272 long 0x3FFE0000,0xD48457D2,0xD8EA4EA3,0x00000000
6273 long 0x3FFE0000,0xDB948DA7,0x12DECE3B,0x00000000
6274 long 0x3FFE0000,0xE23855F9,0x69E8096A,0x00000000
6275 long 0x3FFE0000,0xE8771129,0xC4353259,0x00000000
6276 long 0x3FFE0000,0xEE57C16E,0x0D379C0D,0x00000000
6277 long 0x3FFE0000,0xF3E10211,0xA87C3779,0x00000000
6278 long 0x3FFE0000,0xF919039D,0x758B8D41,0x00000000
6279 long 0x3FFE0000,0xFE058B8F,0x64935FB3,0x00000000
6280 long 0x3FFF0000,0x8155FB49,0x7B685D04,0x00000000
6281 long 0x3FFF0000,0x83889E35,0x49D108E1,0x00000000
6282 long 0x3FFF0000,0x859CFA76,0x511D724B,0x00000000
6283 long 0x3FFF0000,0x87952ECF,0xFF8131E7,0x00000000
6284 long 0x3FFF0000,0x89732FD1,0x9557641B,0x00000000
6285 long 0x3FFF0000,0x8B38CAD1,0x01932A35,0x00000000
6286 long 0x3FFF0000,0x8CE7A8D8,0x301EE6B5,0x00000000
6287 long 0x3FFF0000,0x8F46A39E,0x2EAE5281,0x00000000
6288 long 0x3FFF0000,0x922DA7D7,0x91888487,0x00000000
6289 long 0x3FFF0000,0x94D19FCB,0xDEDF5241,0x00000000
6290 long 0x3FFF0000,0x973AB944,0x19D2A08B,0x00000000
6291 long 0x3FFF0000,0x996FF00E,0x08E10B96,0x00000000
6292 long 0x3FFF0000,0x9B773F95,0x12321DA7,0x00000000
6293 long 0x3FFF0000,0x9D55CC32,0x0F935624,0x00000000
6294 long 0x3FFF0000,0x9F100575,0x006CC571,0x00000000
6295 long 0x3FFF0000,0xA0A9C290,0xD97CC06C,0x00000000
6296 long 0x3FFF0000,0xA22659EB,0xEBC0630A,0x00000000
6297 long 0x3FFF0000,0xA388B4AF,0xF6EF0EC9,0x00000000
6298 long 0x3FFF0000,0xA4D35F10,0x61D292C4,0x00000000
6299 long 0x3FFF0000,0xA60895DC,0xFBE3187E,0x00000000
6300 long 0x3FFF0000,0xA72A51DC,0x7367BEAC,0x00000000
6301 long 0x3FFF0000,0xA83A5153,0x0956168F,0x00000000
6302 long 0x3FFF0000,0xA93A2007,0x7539546E,0x00000000
6303 long 0x3FFF0000,0xAA9E7245,0x023B2605,0x00000000
6304 long 0x3FFF0000,0xAC4C84BA,0x6FE4D58F,0x00000000
6305 long 0x3FFF0000,0xADCE4A4A,0x606B9712,0x00000000
6306 long 0x3FFF0000,0xAF2A2DCD,0x8D263C9C,0x00000000
6307 long 0x3FFF0000,0xB0656F81,0xF22265C7,0x00000000
6308 long 0x3FFF0000,0xB1846515,0x0F71496A,0x00000000
6309 long 0x3FFF0000,0xB28AAA15,0x6F9ADA35,0x00000000
6310 long 0x3FFF0000,0xB37B44FF,0x3766B895,0x00000000
6311 long 0x3FFF0000,0xB458C3DC,0xE9630433,0x00000000
6312 long 0x3FFF0000,0xB525529D,0x562246BD,0x00000000
6313 long 0x3FFF0000,0xB5E2CCA9,0x5F9D88CC,0x00000000
6314 long 0x3FFF0000,0xB692CADA,0x7ACA1ADA,0x00000000
6315 long 0x3FFF0000,0xB736AEA7,0xA6925838,0x00000000
6316 long 0x3FFF0000,0xB7CFAB28,0x7E9F7B36,0x00000000
6317 long 0x3FFF0000,0xB85ECC66,0xCB219835,0x00000000
6318 long 0x3FFF0000,0xB8E4FD5A,0x20A593DA,0x00000000
6319 long 0x3FFF0000,0xB99F41F6,0x4AFF9BB5,0x00000000
6320 long 0x3FFF0000,0xBA7F1E17,0x842BBE7B,0x00000000
6321 long 0x3FFF0000,0xBB471285,0x7637E17D,0x00000000
6322 long 0x3FFF0000,0xBBFABE8A,0x4788DF6F,0x00000000
6323 long 0x3FFF0000,0xBC9D0FAD,0x2B689D79,0x00000000
6324 long 0x3FFF0000,0xBD306A39,0x471ECD86,0x00000000
6325 long 0x3FFF0000,0xBDB6C731,0x856AF18A,0x00000000
6326 long 0x3FFF0000,0xBE31CAC5,0x02E80D70,0x00000000
6327 long 0x3FFF0000,0xBEA2D55C,0xE33194E2,0x00000000
6328 long 0x3FFF0000,0xBF0B10B7,0xC03128F0,0x00000000
6329 long 0x3FFF0000,0xBF6B7A18,0xDACB778D,0x00000000
6330 long 0x3FFF0000,0xBFC4EA46,0x63FA18F6,0x00000000
6331 long 0x3FFF0000,0xC0181BDE,0x8B89A454,0x00000000
6332 long 0x3FFF0000,0xC065B066,0xCFBF6439,0x00000000
6333 long 0x3FFF0000,0xC0AE345F,0x56340AE6,0x00000000
6334 long 0x3FFF0000,0xC0F22291,0x9CB9E6A7,0x00000000
6335
6336 set X,FP_SCR0
6337 set XDCARE,X+2
6338 set XFRAC,X+4
6339 set XFRACLO,X+8
6340
6341 set ATANF,FP_SCR1
6342 set ATANFHI,ATANF+4
6343 set ATANFLO,ATANF+8
6344
6345 global satan
6346
6347satan:
6348 fmov.x (%a0),%fp0
6349
6350 mov.l (%a0),%d1
6351 mov.w 4(%a0),%d1
6352 fmov.x %fp0,X(%a6)
6353 and.l &0x7FFFFFFF,%d1
6354
6355 cmp.l %d1,&0x3FFB8000
6356 bge.b ATANOK1
6357 bra.w ATANSM
6358
6359ATANOK1:
6360 cmp.l %d1,&0x4002FFFF
6361 ble.b ATANMAIN
6362 bra.w ATANBIG
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385ATANMAIN:
6386
6387 and.l &0xF8000000,XFRAC(%a6)
6388 or.l &0x04000000,XFRAC(%a6)
6389 mov.l &0x00000000,XFRACLO(%a6)
6390
6391 fmov.x %fp0,%fp1
6392 fmul.x X(%a6),%fp1
6393 fsub.x X(%a6),%fp0
6394 fadd.s &0x3F800000,%fp1
6395 fdiv.x %fp1,%fp0
6396
6397
6398
6399
6400
6401 mov.l %d2,-(%sp)
6402 mov.l %d1,%d2
6403 and.l &0x00007800,%d1
6404 and.l &0x7FFF0000,%d2
6405 sub.l &0x3FFB0000,%d2
6406 asr.l &1,%d2
6407 add.l %d2,%d1
6408 asr.l &7,%d1
6409 lea ATANTBL(%pc),%a1
6410 add.l %d1,%a1
6411 mov.l (%a1)+,ATANF(%a6)
6412 mov.l (%a1)+,ATANFHI(%a6)
6413 mov.l (%a1)+,ATANFLO(%a6)
6414 mov.l X(%a6),%d1
6415 and.l &0x80000000,%d1
6416 or.l %d1,ATANF(%a6)
6417 mov.l (%sp)+,%d2
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430 fmovm.x &0x04,-(%sp)
6431
6432 fmov.x %fp0,%fp1
6433 fmul.x %fp1,%fp1
6434 fmov.d ATANA3(%pc),%fp2
6435 fadd.x %fp1,%fp2
6436 fmul.x %fp1,%fp2
6437 fmul.x %fp0,%fp1
6438 fadd.d ATANA2(%pc),%fp2
6439 fmul.d ATANA1(%pc),%fp1
6440 fmul.x %fp2,%fp1
6441 fadd.x %fp1,%fp0
6442
6443 fmovm.x (%sp)+,&0x20
6444
6445 fmov.l %d0,%fpcr
6446 fadd.x ATANF(%a6),%fp0
6447 bra t_inx2
6448
6449ATANBORS:
6450
6451
6452 cmp.l %d1,&0x3FFF8000
6453 bgt.w ATANBIG
6454
6455ATANSM:
6456
6457
6458
6459
6460
6461
6462 cmp.l %d1,&0x3FD78000
6463 blt.w ATANTINY
6464
6465
6466 fmovm.x &0x0c,-(%sp)
6467
6468 fmul.x %fp0,%fp0
6469
6470 fmov.x %fp0,%fp1
6471 fmul.x %fp1,%fp1
6472
6473 fmov.d ATANB6(%pc),%fp2
6474 fmov.d ATANB5(%pc),%fp3
6475
6476 fmul.x %fp1,%fp2
6477 fmul.x %fp1,%fp3
6478
6479 fadd.d ATANB4(%pc),%fp2
6480 fadd.d ATANB3(%pc),%fp3
6481
6482 fmul.x %fp1,%fp2
6483 fmul.x %fp3,%fp1
6484
6485 fadd.d ATANB2(%pc),%fp2
6486 fadd.d ATANB1(%pc),%fp1
6487
6488 fmul.x %fp0,%fp2
6489 fmul.x X(%a6),%fp0
6490
6491 fadd.x %fp2,%fp1
6492
6493 fmul.x %fp1,%fp0
6494
6495 fmovm.x (%sp)+,&0x30
6496
6497 fmov.l %d0,%fpcr
6498 fadd.x X(%a6),%fp0
6499 bra t_inx2
6500
6501ATANTINY:
6502
6503
6504 fmov.l %d0,%fpcr
6505 mov.b &FMOV_OP,%d1
6506 fmov.x X(%a6),%fp0
6507
6508 bra t_catch
6509
6510ATANBIG:
6511
6512
6513 cmp.l %d1,&0x40638000
6514 bgt.w ATANHUGE
6515
6516
6517
6518
6519
6520
6521 fmovm.x &0x0c,-(%sp)
6522
6523 fmov.s &0xBF800000,%fp1
6524 fdiv.x %fp0,%fp1
6525
6526
6527
6528 fmov.x %fp1,%fp0
6529 fmul.x %fp0,%fp0
6530 fmov.x %fp1,X(%a6)
6531
6532 fmov.x %fp0,%fp1
6533 fmul.x %fp1,%fp1
6534
6535 fmov.d ATANC5(%pc),%fp3
6536 fmov.d ATANC4(%pc),%fp2
6537
6538 fmul.x %fp1,%fp3
6539 fmul.x %fp1,%fp2
6540
6541 fadd.d ATANC3(%pc),%fp3
6542 fadd.d ATANC2(%pc),%fp2
6543
6544 fmul.x %fp3,%fp1
6545 fmul.x %fp0,%fp2
6546
6547 fadd.d ATANC1(%pc),%fp1
6548 fmul.x X(%a6),%fp0
6549
6550 fadd.x %fp2,%fp1
6551
6552 fmul.x %fp1,%fp0
6553
6554 fadd.x X(%a6),%fp0
6555
6556 fmovm.x (%sp)+,&0x30
6557
6558 fmov.l %d0,%fpcr
6559 tst.b (%a0)
6560 bpl.b pos_big
6561
6562neg_big:
6563 fadd.x NPIBY2(%pc),%fp0
6564 bra t_minx2
6565
6566pos_big:
6567 fadd.x PPIBY2(%pc),%fp0
6568 bra t_pinx2
6569
6570ATANHUGE:
6571
6572 tst.b (%a0)
6573 bpl.b pos_huge
6574
6575neg_huge:
6576 fmov.x NPIBY2(%pc),%fp0
6577 fmov.l %d0,%fpcr
6578 fadd.x PTINY(%pc),%fp0
6579 bra t_minx2
6580
6581pos_huge:
6582 fmov.x PPIBY2(%pc),%fp0
6583 fmov.l %d0,%fpcr
6584 fadd.x NTINY(%pc),%fp0
6585 bra t_pinx2
6586
6587 global satand
6588
6589satand:
6590 bra t_extdnrm
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628 global sasin
6629sasin:
6630 fmov.x (%a0),%fp0
6631
6632 mov.l (%a0),%d1
6633 mov.w 4(%a0),%d1
6634 and.l &0x7FFFFFFF,%d1
6635 cmp.l %d1,&0x3FFF8000
6636 bge.b ASINBIG
6637
6638
6639
6640
6641
6642
6643 cmp.l %d1,&0x3FD78000
6644 blt.w ASINTINY
6645
6646
6647
6648
6649ASINMAIN:
6650 fmov.s &0x3F800000,%fp1
6651 fsub.x %fp0,%fp1
6652 fmovm.x &0x4,-(%sp)
6653 fmov.s &0x3F800000,%fp2
6654 fadd.x %fp0,%fp2
6655 fmul.x %fp2,%fp1
6656 fmovm.x (%sp)+,&0x20
6657 fsqrt.x %fp1
6658 fdiv.x %fp1,%fp0
6659 fmovm.x &0x01,-(%sp)
6660 lea (%sp),%a0
6661 bsr satan
6662 add.l &0xc,%sp
6663 bra t_inx2
6664
6665ASINBIG:
6666 fabs.x %fp0
6667 fcmp.s %fp0,&0x3F800000
6668 fbgt t_operr
6669
6670
6671ASINONE:
6672 fmov.x PIBY2(%pc),%fp0
6673 mov.l (%a0),%d1
6674 and.l &0x80000000,%d1
6675 or.l &0x3F800000,%d1
6676 mov.l %d1,-(%sp)
6677 fmov.l %d0,%fpcr
6678 fmul.s (%sp)+,%fp0
6679 bra t_inx2
6680
6681
6682ASINTINY:
6683 fmov.l %d0,%fpcr
6684 mov.b &FMOV_OP,%d1
6685 fmov.x (%a0),%fp0
6686 bra t_catch
6687
6688 global sasind
6689
6690sasind:
6691 bra t_extdnrm
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729 global sacos
6730sacos:
6731 fmov.x (%a0),%fp0
6732
6733 mov.l (%a0),%d1
6734 mov.w 4(%a0),%d1
6735 and.l &0x7FFFFFFF,%d1
6736 cmp.l %d1,&0x3FFF8000
6737 bge.b ACOSBIG
6738
6739
6740
6741
6742ACOSMAIN:
6743 fmov.s &0x3F800000,%fp1
6744 fadd.x %fp0,%fp1
6745 fneg.x %fp0
6746 fadd.s &0x3F800000,%fp0
6747 fdiv.x %fp1,%fp0
6748 fsqrt.x %fp0
6749 mov.l %d0,-(%sp)
6750 clr.l %d0
6751 fmovm.x &0x01,-(%sp)
6752 lea (%sp),%a0
6753 bsr satan
6754 add.l &0xc,%sp
6755
6756 fmov.l (%sp)+,%fpcr
6757 fadd.x %fp0,%fp0
6758 bra t_pinx2
6759
6760ACOSBIG:
6761 fabs.x %fp0
6762 fcmp.s %fp0,&0x3F800000
6763 fbgt t_operr
6764
6765
6766 tst.b (%a0)
6767 bpl.b ACOSP1
6768
6769
6770
6771ACOSM1:
6772 fmov.x PI(%pc),%fp0
6773 fmov.l %d0,%fpcr
6774 fadd.s &0x00800000,%fp0
6775 bra t_pinx2
6776
6777ACOSP1:
6778 bra ld_pzero
6779
6780 global sacosd
6781
6782sacosd:
6783 fmov.l %d0,%fpcr
6784 fmov.x PIBY2(%pc),%fp0
6785 bra t_pinx2
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108L2: long 0x3FDC0000,0x82E30865,0x4361C4C6,0x00000000
7109
7110EEXPA3: long 0x3FA55555,0x55554CC1
7111EEXPA2: long 0x3FC55555,0x55554A54
7112
7113EM1A4: long 0x3F811111,0x11174385
7114EM1A3: long 0x3FA55555,0x55554F5A
7115
7116EM1A2: long 0x3FC55555,0x55555555,0x00000000,0x00000000
7117
7118EM1B8: long 0x3EC71DE3,0xA5774682
7119EM1B7: long 0x3EFA01A0,0x19D7CB68
7120
7121EM1B6: long 0x3F2A01A0,0x1A019DF3
7122EM1B5: long 0x3F56C16C,0x16C170E2
7123
7124EM1B4: long 0x3F811111,0x11111111
7125EM1B3: long 0x3FA55555,0x55555555
7126
7127EM1B2: long 0x3FFC0000,0xAAAAAAAA,0xAAAAAAAB
7128 long 0x00000000
7129
7130TWO140: long 0x48B00000,0x00000000
7131TWON140:
7132 long 0x37300000,0x00000000
7133
7134EEXPTBL:
7135 long 0x3FFF0000,0x80000000,0x00000000,0x00000000
7136 long 0x3FFF0000,0x8164D1F3,0xBC030774,0x9F841A9B
7137 long 0x3FFF0000,0x82CD8698,0xAC2BA1D8,0x9FC1D5B9
7138 long 0x3FFF0000,0x843A28C3,0xACDE4048,0xA0728369
7139 long 0x3FFF0000,0x85AAC367,0xCC487B14,0x1FC5C95C
7140 long 0x3FFF0000,0x871F6196,0x9E8D1010,0x1EE85C9F
7141 long 0x3FFF0000,0x88980E80,0x92DA8528,0x9FA20729
7142 long 0x3FFF0000,0x8A14D575,0x496EFD9C,0xA07BF9AF
7143 long 0x3FFF0000,0x8B95C1E3,0xEA8BD6E8,0xA0020DCF
7144 long 0x3FFF0000,0x8D1ADF5B,0x7E5BA9E4,0x205A63DA
7145 long 0x3FFF0000,0x8EA4398B,0x45CD53C0,0x1EB70051
7146 long 0x3FFF0000,0x9031DC43,0x1466B1DC,0x1F6EB029
7147 long 0x3FFF0000,0x91C3D373,0xAB11C338,0xA0781494
7148 long 0x3FFF0000,0x935A2B2F,0x13E6E92C,0x9EB319B0
7149 long 0x3FFF0000,0x94F4EFA8,0xFEF70960,0x2017457D
7150 long 0x3FFF0000,0x96942D37,0x20185A00,0x1F11D537
7151 long 0x3FFF0000,0x9837F051,0x8DB8A970,0x9FB952DD
7152 long 0x3FFF0000,0x99E04593,0x20B7FA64,0x1FE43087
7153 long 0x3FFF0000,0x9B8D39B9,0xD54E5538,0x1FA2A818
7154 long 0x3FFF0000,0x9D3ED9A7,0x2CFFB750,0x1FDE494D
7155 long 0x3FFF0000,0x9EF53260,0x91A111AC,0x20504890
7156 long 0x3FFF0000,0xA0B0510F,0xB9714FC4,0xA073691C
7157 long 0x3FFF0000,0xA2704303,0x0C496818,0x1F9B7A05
7158 long 0x3FFF0000,0xA43515AE,0x09E680A0,0xA0797126
7159 long 0x3FFF0000,0xA5FED6A9,0xB15138EC,0xA071A140
7160 long 0x3FFF0000,0xA7CD93B4,0xE9653568,0x204F62DA
7161 long 0x3FFF0000,0xA9A15AB4,0xEA7C0EF8,0x1F283C4A
7162 long 0x3FFF0000,0xAB7A39B5,0xA93ED338,0x9F9A7FDC
7163 long 0x3FFF0000,0xAD583EEA,0x42A14AC8,0xA05B3FAC
7164 long 0x3FFF0000,0xAF3B78AD,0x690A4374,0x1FDF2610
7165 long 0x3FFF0000,0xB123F581,0xD2AC2590,0x9F705F90
7166 long 0x3FFF0000,0xB311C412,0xA9112488,0x201F678A
7167 long 0x3FFF0000,0xB504F333,0xF9DE6484,0x1F32FB13
7168 long 0x3FFF0000,0xB6FD91E3,0x28D17790,0x20038B30
7169 long 0x3FFF0000,0xB8FBAF47,0x62FB9EE8,0x200DC3CC
7170 long 0x3FFF0000,0xBAFF5AB2,0x133E45FC,0x9F8B2AE6
7171 long 0x3FFF0000,0xBD08A39F,0x580C36C0,0xA02BBF70
7172 long 0x3FFF0000,0xBF1799B6,0x7A731084,0xA00BF518
7173 long 0x3FFF0000,0xC12C4CCA,0x66709458,0xA041DD41
7174 long 0x3FFF0000,0xC346CCDA,0x24976408,0x9FDF137B
7175 long 0x3FFF0000,0xC5672A11,0x5506DADC,0x201F1568
7176 long 0x3FFF0000,0xC78D74C8,0xABB9B15C,0x1FC13A2E
7177 long 0x3FFF0000,0xC9B9BD86,0x6E2F27A4,0xA03F8F03
7178 long 0x3FFF0000,0xCBEC14FE,0xF2727C5C,0x1FF4907D
7179 long 0x3FFF0000,0xCE248C15,0x1F8480E4,0x9E6E53E4
7180 long 0x3FFF0000,0xD06333DA,0xEF2B2594,0x1FD6D45C
7181 long 0x3FFF0000,0xD2A81D91,0xF12AE45C,0xA076EDB9
7182 long 0x3FFF0000,0xD4F35AAB,0xCFEDFA20,0x9FA6DE21
7183 long 0x3FFF0000,0xD744FCCA,0xD69D6AF4,0x1EE69A2F
7184 long 0x3FFF0000,0xD99D15C2,0x78AFD7B4,0x207F439F
7185 long 0x3FFF0000,0xDBFBB797,0xDAF23754,0x201EC207
7186 long 0x3FFF0000,0xDE60F482,0x5E0E9124,0x9E8BE175
7187 long 0x3FFF0000,0xE0CCDEEC,0x2A94E110,0x20032C4B
7188 long 0x3FFF0000,0xE33F8972,0xBE8A5A50,0x2004DFF5
7189 long 0x3FFF0000,0xE5B906E7,0x7C8348A8,0x1E72F47A
7190 long 0x3FFF0000,0xE8396A50,0x3C4BDC68,0x1F722F22
7191 long 0x3FFF0000,0xEAC0C6E7,0xDD243930,0xA017E945
7192 long 0x3FFF0000,0xED4F301E,0xD9942B84,0x1F401A5B
7193 long 0x3FFF0000,0xEFE4B99B,0xDCDAF5CC,0x9FB9A9E3
7194 long 0x3FFF0000,0xF281773C,0x59FFB138,0x20744C05
7195 long 0x3FFF0000,0xF5257D15,0x2486CC2C,0x1F773A19
7196 long 0x3FFF0000,0xF7D0DF73,0x0AD13BB8,0x1FFE90D5
7197 long 0x3FFF0000,0xFA83B2DB,0x722A033C,0xA041ED22
7198 long 0x3FFF0000,0xFD3E0C0C,0xF486C174,0x1F853F3A
7199
7200 set ADJFLAG,L_SCR2
7201 set SCALE,FP_SCR0
7202 set ADJSCALE,FP_SCR1
7203 set SC,FP_SCR0
7204 set ONEBYSC,FP_SCR1
7205
7206 global setox
7207setox:
7208
7209
7210
7211 mov.l (%a0),%d1
7212 and.l &0x7FFF0000,%d1
7213 cmp.l %d1,&0x3FBE0000
7214 bge.b EXPC1
7215 bra EXPSM
7216
7217EXPC1:
7218
7219 mov.w 4(%a0),%d1
7220 cmp.l %d1,&0x400CB167
7221 blt.b EXPMAIN
7222 bra EEXPBIG
7223
7224EXPMAIN:
7225
7226
7227 fmov.x (%a0),%fp0
7228
7229 fmov.x %fp0,%fp1
7230 fmul.s &0x42B8AA3B,%fp0
7231 fmovm.x &0xc,-(%sp)
7232 mov.l &0,ADJFLAG(%a6)
7233 fmov.l %fp0,%d1
7234 lea EEXPTBL(%pc),%a1
7235 fmov.l %d1,%fp0
7236
7237 mov.l %d1,L_SCR1(%a6)
7238 and.l &0x3F,%d1
7239 lsl.l &4,%d1
7240 add.l %d1,%a1
7241 mov.l L_SCR1(%a6),%d1
7242 asr.l &6,%d1
7243 add.w &0x3FFF,%d1
7244 mov.w L2(%pc),L_SCR1(%a6)
7245
7246EXPCONT1:
7247
7248
7249
7250 fmov.x %fp0,%fp2
7251 fmul.s &0xBC317218,%fp0
7252 fmul.x L2(%pc),%fp2
7253 fadd.x %fp1,%fp0
7254 fadd.x %fp2,%fp0
7255
7256
7257
7258
7259
7260
7261
7262 fmov.x %fp0,%fp1
7263 fmul.x %fp1,%fp1
7264
7265 fmov.s &0x3AB60B70,%fp2
7266
7267 fmul.x %fp1,%fp2
7268 fmov.x %fp1,%fp3
7269 fmul.s &0x3C088895,%fp3
7270
7271 fadd.d EEXPA3(%pc),%fp2
7272 fadd.d EEXPA2(%pc),%fp3
7273
7274 fmul.x %fp1,%fp2
7275 mov.w %d1,SCALE(%a6)
7276 mov.l &0x80000000,SCALE+4(%a6)
7277 clr.l SCALE+8(%a6)
7278
7279 fmul.x %fp1,%fp3
7280
7281 fadd.s &0x3F000000,%fp2
7282 fmul.x %fp0,%fp3
7283
7284 fmul.x %fp1,%fp2
7285 fadd.x %fp3,%fp0
7286
7287 fmov.x (%a1)+,%fp1
7288 fadd.x %fp2,%fp0
7289
7290
7291
7292
7293
7294 fmul.x %fp1,%fp0
7295 fmovm.x (%sp)+,&0x30
7296 fadd.s (%a1),%fp0
7297
7298 fadd.x %fp1,%fp0
7299 mov.l ADJFLAG(%a6),%d1
7300
7301
7302 tst.l %d1
7303 beq.b NORMAL
7304ADJUST:
7305 fmul.x ADJSCALE(%a6),%fp0
7306NORMAL:
7307 fmov.l %d0,%fpcr
7308 mov.b &FMUL_OP,%d1
7309 fmul.x SCALE(%a6),%fp0
7310 bra t_catch
7311
7312EXPSM:
7313
7314 fmovm.x (%a0),&0x80
7315 fmov.l %d0,%fpcr
7316 fadd.s &0x3F800000,%fp0
7317 bra t_pinx2
7318
7319EEXPBIG:
7320
7321 cmp.l %d1,&0x400CB27C
7322 bgt.b EXP2BIG
7323
7324 fmov.x (%a0),%fp0
7325
7326 fmov.x %fp0,%fp1
7327 fmul.s &0x42B8AA3B,%fp0
7328 fmovm.x &0xc,-(%sp)
7329 mov.l &1,ADJFLAG(%a6)
7330 fmov.l %fp0,%d1
7331 lea EEXPTBL(%pc),%a1
7332 fmov.l %d1,%fp0
7333 mov.l %d1,L_SCR1(%a6)
7334 and.l &0x3F,%d1
7335 lsl.l &4,%d1
7336 add.l %d1,%a1
7337 mov.l L_SCR1(%a6),%d1
7338 asr.l &6,%d1
7339 mov.l %d1,L_SCR1(%a6)
7340 asr.l &1,%d1
7341 sub.l %d1,L_SCR1(%a6)
7342 add.w &0x3FFF,%d1
7343 mov.w %d1,ADJSCALE(%a6)
7344 mov.l &0x80000000,ADJSCALE+4(%a6)
7345 clr.l ADJSCALE+8(%a6)
7346 mov.l L_SCR1(%a6),%d1
7347 add.w &0x3FFF,%d1
7348 bra.w EXPCONT1
7349
7350EXP2BIG:
7351
7352 tst.b (%a0)
7353 bmi t_unfl2
7354 bra t_ovfl2
7355
7356 global setoxd
7357setoxd:
7358
7359 mov.l (%a0),-(%sp)
7360 andi.l &0x80000000,(%sp)
7361 ori.l &0x00800000,(%sp)
7362
7363 fmov.s &0x3F800000,%fp0
7364
7365 fmov.l %d0,%fpcr
7366 fadd.s (%sp)+,%fp0
7367 bra t_pinx2
7368
7369 global setoxm1
7370setoxm1:
7371
7372
7373
7374
7375 mov.l (%a0),%d1
7376 and.l &0x7FFF0000,%d1
7377 cmp.l %d1,&0x3FFD0000
7378 bge.b EM1CON1
7379 bra EM1SM
7380
7381EM1CON1:
7382
7383
7384 mov.w 4(%a0),%d1
7385 cmp.l %d1,&0x4004C215
7386 ble.b EM1MAIN
7387 bra EM1BIG
7388
7389EM1MAIN:
7390
7391
7392 fmov.x (%a0),%fp0
7393
7394 fmov.x %fp0,%fp1
7395 fmul.s &0x42B8AA3B,%fp0
7396 fmovm.x &0xc,-(%sp)
7397 fmov.l %fp0,%d1
7398 lea EEXPTBL(%pc),%a1
7399 fmov.l %d1,%fp0
7400
7401 mov.l %d1,L_SCR1(%a6)
7402 and.l &0x3F,%d1
7403 lsl.l &4,%d1
7404 add.l %d1,%a1
7405 mov.l L_SCR1(%a6),%d1
7406 asr.l &6,%d1
7407 mov.l %d1,L_SCR1(%a6)
7408
7409
7410
7411
7412 fmov.x %fp0,%fp2
7413 fmul.s &0xBC317218,%fp0
7414 fmul.x L2(%pc),%fp2
7415 fadd.x %fp1,%fp0
7416 fadd.x %fp2,%fp0
7417 add.w &0x3FFF,%d1
7418
7419
7420
7421
7422
7423
7424
7425 fmov.x %fp0,%fp1
7426 fmul.x %fp1,%fp1
7427
7428 fmov.s &0x3950097B,%fp2
7429
7430 fmul.x %fp1,%fp2
7431 fmov.x %fp1,%fp3
7432 fmul.s &0x3AB60B6A,%fp3
7433
7434 fadd.d EM1A4(%pc),%fp2
7435 fadd.d EM1A3(%pc),%fp3
7436 mov.w %d1,SC(%a6)
7437 mov.l &0x80000000,SC+4(%a6)
7438 clr.l SC+8(%a6)
7439
7440 fmul.x %fp1,%fp2
7441 mov.l L_SCR1(%a6),%d1
7442 neg.w %d1
7443 fmul.x %fp1,%fp3
7444 add.w &0x3FFF,%d1
7445 fadd.d EM1A2(%pc),%fp2
7446 fadd.s &0x3F000000,%fp3
7447
7448 fmul.x %fp1,%fp2
7449 or.w &0x8000,%d1
7450 mov.w %d1,ONEBYSC(%a6)
7451 mov.l &0x80000000,ONEBYSC+4(%a6)
7452 clr.l ONEBYSC+8(%a6)
7453 fmul.x %fp3,%fp1
7454
7455 fmul.x %fp0,%fp2
7456 fadd.x %fp1,%fp0
7457
7458 fadd.x %fp2,%fp0
7459
7460 fmovm.x (%sp)+,&0x30
7461
7462
7463
7464
7465 fmul.x (%a1),%fp0
7466
7467
7468
7469 mov.l L_SCR1(%a6),%d1
7470 cmp.l %d1,&63
7471 ble.b MLE63
7472
7473 fmov.s 12(%a1),%fp1
7474 fadd.x ONEBYSC(%a6),%fp1
7475 fadd.x %fp1,%fp0
7476 fadd.x (%a1),%fp0
7477 bra EM1SCALE
7478MLE63:
7479
7480 cmp.l %d1,&-3
7481 bge.b MGEN3
7482MLTN3:
7483
7484 fadd.s 12(%a1),%fp0
7485 fadd.x (%a1),%fp0
7486 fadd.x ONEBYSC(%a6),%fp0
7487 bra EM1SCALE
7488MGEN3:
7489
7490 fmov.x (%a1)+,%fp1
7491 fadd.s (%a1),%fp0
7492 fadd.x ONEBYSC(%a6),%fp1
7493 fadd.x %fp1,%fp0
7494
7495EM1SCALE:
7496
7497 fmov.l %d0,%fpcr
7498 fmul.x SC(%a6),%fp0
7499 bra t_inx2
7500
7501EM1SM:
7502
7503 cmp.l %d1,&0x3FBE0000
7504 bge.b EM1POLY
7505
7506EM1TINY:
7507
7508 cmp.l %d1,&0x00330000
7509 blt.b EM12TINY
7510
7511 mov.l &0x80010000,SC(%a6)
7512 mov.l &0x80000000,SC+4(%a6)
7513 clr.l SC+8(%a6)
7514 fmov.x (%a0),%fp0
7515 fmov.l %d0,%fpcr
7516 mov.b &FADD_OP,%d1
7517 fadd.x SC(%a6),%fp0
7518 bra t_catch
7519
7520EM12TINY:
7521
7522 fmov.x (%a0),%fp0
7523 fmul.d TWO140(%pc),%fp0
7524 mov.l &0x80010000,SC(%a6)
7525 mov.l &0x80000000,SC+4(%a6)
7526 clr.l SC+8(%a6)
7527 fadd.x SC(%a6),%fp0
7528 fmov.l %d0,%fpcr
7529 mov.b &FMUL_OP,%d1
7530 fmul.d TWON140(%pc),%fp0
7531 bra t_catch
7532
7533EM1POLY:
7534
7535 fmov.x (%a0),%fp0
7536 fmul.x %fp0,%fp0
7537 fmovm.x &0xc,-(%sp)
7538 fmov.s &0x2F30CAA8,%fp1
7539 fmul.x %fp0,%fp1
7540 fmov.s &0x310F8290,%fp2
7541 fadd.s &0x32D73220,%fp1
7542
7543 fmul.x %fp0,%fp2
7544 fmul.x %fp0,%fp1
7545
7546 fadd.s &0x3493F281,%fp2
7547 fadd.d EM1B8(%pc),%fp1
7548
7549 fmul.x %fp0,%fp2
7550 fmul.x %fp0,%fp1
7551
7552 fadd.d EM1B7(%pc),%fp2
7553 fadd.d EM1B6(%pc),%fp1
7554
7555 fmul.x %fp0,%fp2
7556 fmul.x %fp0,%fp1
7557
7558 fadd.d EM1B5(%pc),%fp2
7559 fadd.d EM1B4(%pc),%fp1
7560
7561 fmul.x %fp0,%fp2
7562 fmul.x %fp0,%fp1
7563
7564 fadd.d EM1B3(%pc),%fp2
7565 fadd.x EM1B2(%pc),%fp1
7566
7567 fmul.x %fp0,%fp2
7568 fmul.x %fp0,%fp1
7569
7570 fmul.x %fp0,%fp2
7571 fmul.x (%a0),%fp1
7572
7573 fmul.s &0x3F000000,%fp0
7574 fadd.x %fp2,%fp1
7575
7576 fmovm.x (%sp)+,&0x30
7577
7578 fadd.x %fp1,%fp0
7579
7580 fmov.l %d0,%fpcr
7581 fadd.x (%a0),%fp0
7582 bra t_inx2
7583
7584EM1BIG:
7585
7586 mov.l (%a0),%d1
7587 cmp.l %d1,&0
7588 bgt.w EXPC1
7589
7590 fmov.s &0xBF800000,%fp0
7591 fmov.l %d0,%fpcr
7592 fadd.s &0x00800000,%fp0
7593 bra t_minx2
7594
7595 global setoxm1d
7596setoxm1d:
7597
7598
7599 bra t_extdnrm
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621 global sgetexp
7622sgetexp:
7623 mov.w SRC_EX(%a0),%d0
7624 bclr &0xf,%d0
7625 subi.w &0x3fff,%d0
7626 fmov.w %d0,%fp0
7627 blt.b sgetexpn
7628 rts
7629
7630sgetexpn:
7631 mov.b &neg_bmask,FPSR_CC(%a6)
7632 rts
7633
7634 global sgetexpd
7635sgetexpd:
7636 bsr.l norm
7637 neg.w %d0
7638 subi.w &0x3fff,%d0
7639 fmov.w %d0,%fp0
7640 mov.b &neg_bmask,FPSR_CC(%a6)
7641 rts
7642
7643 global sgetman
7644sgetman:
7645 mov.w SRC_EX(%a0),%d0
7646 ori.w &0x7fff,%d0
7647 bclr &0xe,%d0
7648
7649
7650 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
7651 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
7652 mov.w %d0,FP_SCR0_EX(%a6)
7653 fmov.x FP_SCR0(%a6),%fp0
7654 bmi.b sgetmann
7655 rts
7656
7657sgetmann:
7658 mov.b &neg_bmask,FPSR_CC(%a6)
7659 rts
7660
7661
7662
7663
7664
7665 global sgetmand
7666sgetmand:
7667 bsr.l norm
7668 bra.b sgetman
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716TWO16380:
7717 long 0x7FFB0000,0x80000000,0x00000000,0x00000000
7718
7719 global scosh
7720scosh:
7721 fmov.x (%a0),%fp0
7722
7723 mov.l (%a0),%d1
7724 mov.w 4(%a0),%d1
7725 and.l &0x7FFFFFFF,%d1
7726 cmp.l %d1,&0x400CB167
7727 bgt.b COSHBIG
7728
7729
7730
7731
7732 fabs.x %fp0
7733
7734 mov.l %d0,-(%sp)
7735 clr.l %d0
7736 fmovm.x &0x01,-(%sp)
7737 lea (%sp),%a0
7738 bsr setox
7739 add.l &0xc,%sp
7740 fmul.s &0x3F000000,%fp0
7741 mov.l (%sp)+,%d0
7742
7743 fmov.s &0x3E800000,%fp1
7744 fdiv.x %fp0,%fp1
7745
7746 fmov.l %d0,%fpcr
7747 mov.b &FADD_OP,%d1
7748 fadd.x %fp1,%fp0
7749 bra t_catch
7750
7751COSHBIG:
7752 cmp.l %d1,&0x400CB2B3
7753 bgt.b COSHHUGE
7754
7755 fabs.x %fp0
7756 fsub.d T1(%pc),%fp0
7757 fsub.d T2(%pc),%fp0
7758
7759 mov.l %d0,-(%sp)
7760 clr.l %d0
7761 fmovm.x &0x01,-(%sp)
7762 lea (%sp),%a0
7763 bsr setox
7764 add.l &0xc,%sp
7765 mov.l (%sp)+,%d0
7766
7767 fmov.l %d0,%fpcr
7768 mov.b &FMUL_OP,%d1
7769 fmul.x TWO16380(%pc),%fp0
7770 bra t_catch
7771
7772COSHHUGE:
7773 bra t_ovfl2
7774
7775 global scoshd
7776
7777scoshd:
7778 fmov.s &0x3F800000,%fp0
7779
7780 fmov.l %d0,%fpcr
7781 fadd.s &0x00800000,%fp0
7782 bra t_pinx2
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831 global ssinh
7832ssinh:
7833 fmov.x (%a0),%fp0
7834
7835 mov.l (%a0),%d1
7836 mov.w 4(%a0),%d1
7837 mov.l %d1,%a1
7838 and.l &0x7FFFFFFF,%d1
7839 cmp.l %d1,&0x400CB167
7840 bgt.b SINHBIG
7841
7842
7843
7844
7845 fabs.x %fp0
7846
7847 movm.l &0x8040,-(%sp)
7848 fmovm.x &0x01,-(%sp)
7849 lea (%sp),%a0
7850 clr.l %d0
7851 bsr setoxm1
7852 add.l &0xc,%sp
7853 fmov.l &0,%fpcr
7854 movm.l (%sp)+,&0x0201
7855
7856 fmov.x %fp0,%fp1
7857 fadd.s &0x3F800000,%fp1
7858 fmov.x %fp0,-(%sp)
7859 fdiv.x %fp1,%fp0
7860 mov.l %a1,%d1
7861 and.l &0x80000000,%d1
7862 or.l &0x3F000000,%d1
7863 fadd.x (%sp)+,%fp0
7864 mov.l %d1,-(%sp)
7865
7866 fmov.l %d0,%fpcr
7867 mov.b &FMUL_OP,%d1
7868 fmul.s (%sp)+,%fp0
7869 bra t_catch
7870
7871SINHBIG:
7872 cmp.l %d1,&0x400CB2B3
7873 bgt t_ovfl
7874 fabs.x %fp0
7875 fsub.d T1(%pc),%fp0
7876 mov.l &0,-(%sp)
7877 mov.l &0x80000000,-(%sp)
7878 mov.l %a1,%d1
7879 and.l &0x80000000,%d1
7880 or.l &0x7FFB0000,%d1
7881 mov.l %d1,-(%sp)
7882 fsub.d T2(%pc),%fp0
7883
7884 mov.l %d0,-(%sp)
7885 clr.l %d0
7886 fmovm.x &0x01,-(%sp)
7887 lea (%sp),%a0
7888 bsr setox
7889 add.l &0xc,%sp
7890
7891 mov.l (%sp)+,%d0
7892 fmov.l %d0,%fpcr
7893 mov.b &FMUL_OP,%d1
7894 fmul.x (%sp)+,%fp0
7895 bra t_catch
7896
7897 global ssinhd
7898
7899ssinhd:
7900 bra t_extdnrm
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949 set X,FP_SCR0
7950 set XFRAC,X+4
7951
7952 set SGN,L_SCR3
7953
7954 set V,FP_SCR0
7955
7956 global stanh
7957stanh:
7958 fmov.x (%a0),%fp0
7959
7960 fmov.x %fp0,X(%a6)
7961 mov.l (%a0),%d1
7962 mov.w 4(%a0),%d1
7963 mov.l %d1,X(%a6)
7964 and.l &0x7FFFFFFF,%d1
7965 cmp.l %d1, &0x3fd78000
7966 blt.w TANHBORS
7967 cmp.l %d1, &0x3fffddce
7968 bgt.w TANHBORS
7969
7970
7971
7972
7973 mov.l X(%a6),%d1
7974 mov.l %d1,SGN(%a6)
7975 and.l &0x7FFF0000,%d1
7976 add.l &0x00010000,%d1
7977 mov.l %d1,X(%a6)
7978 and.l &0x80000000,SGN(%a6)
7979 fmov.x X(%a6),%fp0
7980
7981 mov.l %d0,-(%sp)
7982 clr.l %d0
7983 fmovm.x &0x1,-(%sp)
7984 lea (%sp),%a0
7985 bsr setoxm1
7986 add.l &0xc,%sp
7987 mov.l (%sp)+,%d0
7988
7989 fmov.x %fp0,%fp1
7990 fadd.s &0x40000000,%fp1
7991 mov.l SGN(%a6),%d1
7992 fmov.x %fp1,V(%a6)
7993 eor.l %d1,V(%a6)
7994
7995 fmov.l %d0,%fpcr
7996 fdiv.x V(%a6),%fp0
7997 bra t_inx2
7998
7999TANHBORS:
8000 cmp.l %d1,&0x3FFF8000
8001 blt.w TANHSM
8002
8003 cmp.l %d1,&0x40048AA1
8004 bgt.w TANHHUGE
8005
8006
8007
8008
8009
8010 mov.l X(%a6),%d1
8011 mov.l %d1,SGN(%a6)
8012 and.l &0x7FFF0000,%d1
8013 add.l &0x00010000,%d1
8014 mov.l %d1,X(%a6)
8015 and.l &0x80000000,SGN(%a6)
8016 mov.l SGN(%a6),%d1
8017 fmov.x X(%a6),%fp0
8018
8019 mov.l %d0,-(%sp)
8020 clr.l %d0
8021 fmovm.x &0x01,-(%sp)
8022 lea (%sp),%a0
8023 bsr setox
8024 add.l &0xc,%sp
8025 mov.l (%sp)+,%d0
8026 mov.l SGN(%a6),%d1
8027 fadd.s &0x3F800000,%fp0
8028
8029 eor.l &0xC0000000,%d1
8030 fmov.s %d1,%fp1
8031 fdiv.x %fp0,%fp1
8032
8033 mov.l SGN(%a6),%d1
8034 or.l &0x3F800000,%d1
8035 fmov.s %d1,%fp0
8036
8037 fmov.l %d0,%fpcr
8038 mov.b &FADD_OP,%d1
8039 fadd.x %fp1,%fp0
8040 bra t_inx2
8041
8042TANHSM:
8043 fmov.l %d0,%fpcr
8044 mov.b &FMOV_OP,%d1
8045 fmov.x X(%a6),%fp0
8046 bra t_catch
8047
8048
8049TANHHUGE:
8050 mov.l X(%a6),%d1
8051 and.l &0x80000000,%d1
8052 or.l &0x3F800000,%d1
8053 fmov.s %d1,%fp0
8054 and.l &0x80000000,%d1
8055 eor.l &0x80800000,%d1
8056
8057 fmov.l %d0,%fpcr
8058 fadd.s %d1,%fp0
8059 bra t_inx2
8060
8061 global stanhd
8062
8063stanhd:
8064 bra t_extdnrm
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129LOGOF2:
8130 long 0x3FFE0000,0xB17217F7,0xD1CF79AC,0x00000000
8131
8132one:
8133 long 0x3F800000
8134zero:
8135 long 0x00000000
8136infty:
8137 long 0x7F800000
8138negone:
8139 long 0xBF800000
8140
8141LOGA6:
8142 long 0x3FC2499A,0xB5E4040B
8143LOGA5:
8144 long 0xBFC555B5,0x848CB7DB
8145
8146LOGA4:
8147 long 0x3FC99999,0x987D8730
8148LOGA3:
8149 long 0xBFCFFFFF,0xFF6F7E97
8150
8151LOGA2:
8152 long 0x3FD55555,0x555555A4
8153LOGA1:
8154 long 0xBFE00000,0x00000008
8155
8156LOGB5:
8157 long 0x3F175496,0xADD7DAD6
8158LOGB4:
8159 long 0x3F3C71C2,0xFE80C7E0
8160
8161LOGB3:
8162 long 0x3F624924,0x928BCCFF
8163LOGB2:
8164 long 0x3F899999,0x999995EC
8165
8166LOGB1:
8167 long 0x3FB55555,0x55555555
8168TWO:
8169 long 0x40000000,0x00000000
8170
8171LTHOLD:
8172 long 0x3f990000,0x80000000,0x00000000,0x00000000
8173
8174LOGTBL:
8175 long 0x3FFE0000,0xFE03F80F,0xE03F80FE,0x00000000
8176 long 0x3FF70000,0xFF015358,0x833C47E2,0x00000000
8177 long 0x3FFE0000,0xFA232CF2,0x52138AC0,0x00000000
8178 long 0x3FF90000,0xBDC8D83E,0xAD88D549,0x00000000
8179 long 0x3FFE0000,0xF6603D98,0x0F6603DA,0x00000000
8180 long 0x3FFA0000,0x9CF43DCF,0xF5EAFD48,0x00000000
8181 long 0x3FFE0000,0xF2B9D648,0x0F2B9D65,0x00000000
8182 long 0x3FFA0000,0xDA16EB88,0xCB8DF614,0x00000000
8183 long 0x3FFE0000,0xEF2EB71F,0xC4345238,0x00000000
8184 long 0x3FFB0000,0x8B29B775,0x1BD70743,0x00000000
8185 long 0x3FFE0000,0xEBBDB2A5,0xC1619C8C,0x00000000
8186 long 0x3FFB0000,0xA8D839F8,0x30C1FB49,0x00000000
8187 long 0x3FFE0000,0xE865AC7B,0x7603A197,0x00000000
8188 long 0x3FFB0000,0xC61A2EB1,0x8CD907AD,0x00000000
8189 long 0x3FFE0000,0xE525982A,0xF70C880E,0x00000000
8190 long 0x3FFB0000,0xE2F2A47A,0xDE3A18AF,0x00000000
8191 long 0x3FFE0000,0xE1FC780E,0x1FC780E2,0x00000000
8192 long 0x3FFB0000,0xFF64898E,0xDF55D551,0x00000000
8193 long 0x3FFE0000,0xDEE95C4C,0xA037BA57,0x00000000
8194 long 0x3FFC0000,0x8DB956A9,0x7B3D0148,0x00000000
8195 long 0x3FFE0000,0xDBEB61EE,0xD19C5958,0x00000000
8196 long 0x3FFC0000,0x9B8FE100,0xF47BA1DE,0x00000000
8197 long 0x3FFE0000,0xD901B203,0x6406C80E,0x00000000
8198 long 0x3FFC0000,0xA9372F1D,0x0DA1BD17,0x00000000
8199 long 0x3FFE0000,0xD62B80D6,0x2B80D62C,0x00000000
8200 long 0x3FFC0000,0xB6B07F38,0xCE90E46B,0x00000000
8201 long 0x3FFE0000,0xD3680D36,0x80D3680D,0x00000000
8202 long 0x3FFC0000,0xC3FD0329,0x06488481,0x00000000
8203 long 0x3FFE0000,0xD0B69FCB,0xD2580D0B,0x00000000
8204 long 0x3FFC0000,0xD11DE0FF,0x15AB18CA,0x00000000
8205 long 0x3FFE0000,0xCE168A77,0x25080CE1,0x00000000
8206 long 0x3FFC0000,0xDE1433A1,0x6C66B150,0x00000000
8207 long 0x3FFE0000,0xCB8727C0,0x65C393E0,0x00000000
8208 long 0x3FFC0000,0xEAE10B5A,0x7DDC8ADD,0x00000000
8209 long 0x3FFE0000,0xC907DA4E,0x871146AD,0x00000000
8210 long 0x3FFC0000,0xF7856E5E,0xE2C9B291,0x00000000
8211 long 0x3FFE0000,0xC6980C69,0x80C6980C,0x00000000
8212 long 0x3FFD0000,0x82012CA5,0xA68206D7,0x00000000
8213 long 0x3FFE0000,0xC4372F85,0x5D824CA6,0x00000000
8214 long 0x3FFD0000,0x882C5FCD,0x7256A8C5,0x00000000
8215 long 0x3FFE0000,0xC1E4BBD5,0x95F6E947,0x00000000
8216 long 0x3FFD0000,0x8E44C60B,0x4CCFD7DE,0x00000000
8217 long 0x3FFE0000,0xBFA02FE8,0x0BFA02FF,0x00000000
8218 long 0x3FFD0000,0x944AD09E,0xF4351AF6,0x00000000
8219 long 0x3FFE0000,0xBD691047,0x07661AA3,0x00000000
8220 long 0x3FFD0000,0x9A3EECD4,0xC3EAA6B2,0x00000000
8221 long 0x3FFE0000,0xBB3EE721,0xA54D880C,0x00000000
8222 long 0x3FFD0000,0xA0218434,0x353F1DE8,0x00000000
8223 long 0x3FFE0000,0xB92143FA,0x36F5E02E,0x00000000
8224 long 0x3FFD0000,0xA5F2FCAB,0xBBC506DA,0x00000000
8225 long 0x3FFE0000,0xB70FBB5A,0x19BE3659,0x00000000
8226 long 0x3FFD0000,0xABB3B8BA,0x2AD362A5,0x00000000
8227 long 0x3FFE0000,0xB509E68A,0x9B94821F,0x00000000
8228 long 0x3FFD0000,0xB1641795,0xCE3CA97B,0x00000000
8229 long 0x3FFE0000,0xB30F6352,0x8917C80B,0x00000000
8230 long 0x3FFD0000,0xB7047551,0x5D0F1C61,0x00000000
8231 long 0x3FFE0000,0xB11FD3B8,0x0B11FD3C,0x00000000
8232 long 0x3FFD0000,0xBC952AFE,0xEA3D13E1,0x00000000
8233 long 0x3FFE0000,0xAF3ADDC6,0x80AF3ADE,0x00000000
8234 long 0x3FFD0000,0xC2168ED0,0xF458BA4A,0x00000000
8235 long 0x3FFE0000,0xAD602B58,0x0AD602B6,0x00000000
8236 long 0x3FFD0000,0xC788F439,0xB3163BF1,0x00000000
8237 long 0x3FFE0000,0xAB8F69E2,0x8359CD11,0x00000000
8238 long 0x3FFD0000,0xCCECAC08,0xBF04565D,0x00000000
8239 long 0x3FFE0000,0xA9C84A47,0xA07F5638,0x00000000
8240 long 0x3FFD0000,0xD2420487,0x2DD85160,0x00000000
8241 long 0x3FFE0000,0xA80A80A8,0x0A80A80B,0x00000000
8242 long 0x3FFD0000,0xD7894992,0x3BC3588A,0x00000000
8243 long 0x3FFE0000,0xA655C439,0x2D7B73A8,0x00000000
8244 long 0x3FFD0000,0xDCC2C4B4,0x9887DACC,0x00000000
8245 long 0x3FFE0000,0xA4A9CF1D,0x96833751,0x00000000
8246 long 0x3FFD0000,0xE1EEBD3E,0x6D6A6B9E,0x00000000
8247 long 0x3FFE0000,0xA3065E3F,0xAE7CD0E0,0x00000000
8248 long 0x3FFD0000,0xE70D785C,0x2F9F5BDC,0x00000000
8249 long 0x3FFE0000,0xA16B312E,0xA8FC377D,0x00000000
8250 long 0x3FFD0000,0xEC1F392C,0x5179F283,0x00000000
8251 long 0x3FFE0000,0x9FD809FD,0x809FD80A,0x00000000
8252 long 0x3FFD0000,0xF12440D3,0xE36130E6,0x00000000
8253 long 0x3FFE0000,0x9E4CAD23,0xDD5F3A20,0x00000000
8254 long 0x3FFD0000,0xF61CCE92,0x346600BB,0x00000000
8255 long 0x3FFE0000,0x9CC8E160,0xC3FB19B9,0x00000000
8256 long 0x3FFD0000,0xFB091FD3,0x8145630A,0x00000000
8257 long 0x3FFE0000,0x9B4C6F9E,0xF03A3CAA,0x00000000
8258 long 0x3FFD0000,0xFFE97042,0xBFA4C2AD,0x00000000
8259 long 0x3FFE0000,0x99D722DA,0xBDE58F06,0x00000000
8260 long 0x3FFE0000,0x825EFCED,0x49369330,0x00000000
8261 long 0x3FFE0000,0x9868C809,0x868C8098,0x00000000
8262 long 0x3FFE0000,0x84C37A7A,0xB9A905C9,0x00000000
8263 long 0x3FFE0000,0x97012E02,0x5C04B809,0x00000000
8264 long 0x3FFE0000,0x87224C2E,0x8E645FB7,0x00000000
8265 long 0x3FFE0000,0x95A02568,0x095A0257,0x00000000
8266 long 0x3FFE0000,0x897B8CAC,0x9F7DE298,0x00000000
8267 long 0x3FFE0000,0x94458094,0x45809446,0x00000000
8268 long 0x3FFE0000,0x8BCF55DE,0xC4CD05FE,0x00000000
8269 long 0x3FFE0000,0x92F11384,0x0497889C,0x00000000
8270 long 0x3FFE0000,0x8E1DC0FB,0x89E125E5,0x00000000
8271 long 0x3FFE0000,0x91A2B3C4,0xD5E6F809,0x00000000
8272 long 0x3FFE0000,0x9066E68C,0x955B6C9B,0x00000000
8273 long 0x3FFE0000,0x905A3863,0x3E06C43B,0x00000000
8274 long 0x3FFE0000,0x92AADE74,0xC7BE59E0,0x00000000
8275 long 0x3FFE0000,0x8F1779D9,0xFDC3A219,0x00000000
8276 long 0x3FFE0000,0x94E9BFF6,0x15845643,0x00000000
8277 long 0x3FFE0000,0x8DDA5202,0x37694809,0x00000000
8278 long 0x3FFE0000,0x9723A1B7,0x20134203,0x00000000
8279 long 0x3FFE0000,0x8CA29C04,0x6514E023,0x00000000
8280 long 0x3FFE0000,0x995899C8,0x90EB8990,0x00000000
8281 long 0x3FFE0000,0x8B70344A,0x139BC75A,0x00000000
8282 long 0x3FFE0000,0x9B88BDAA,0x3A3DAE2F,0x00000000
8283 long 0x3FFE0000,0x8A42F870,0x5669DB46,0x00000000
8284 long 0x3FFE0000,0x9DB4224F,0xFFE1157C,0x00000000
8285 long 0x3FFE0000,0x891AC73A,0xE9819B50,0x00000000
8286 long 0x3FFE0000,0x9FDADC26,0x8B7A12DA,0x00000000
8287 long 0x3FFE0000,0x87F78087,0xF78087F8,0x00000000
8288 long 0x3FFE0000,0xA1FCFF17,0xCE733BD4,0x00000000
8289 long 0x3FFE0000,0x86D90544,0x7A34ACC6,0x00000000
8290 long 0x3FFE0000,0xA41A9E8F,0x5446FB9F,0x00000000
8291 long 0x3FFE0000,0x85BF3761,0x2CEE3C9B,0x00000000
8292 long 0x3FFE0000,0xA633CD7E,0x6771CD8B,0x00000000
8293 long 0x3FFE0000,0x84A9F9C8,0x084A9F9D,0x00000000
8294 long 0x3FFE0000,0xA8489E60,0x0B435A5E,0x00000000
8295 long 0x3FFE0000,0x83993052,0x3FBE3368,0x00000000
8296 long 0x3FFE0000,0xAA59233C,0xCCA4BD49,0x00000000
8297 long 0x3FFE0000,0x828CBFBE,0xB9A020A3,0x00000000
8298 long 0x3FFE0000,0xAC656DAE,0x6BCC4985,0x00000000
8299 long 0x3FFE0000,0x81848DA8,0xFAF0D277,0x00000000
8300 long 0x3FFE0000,0xAE6D8EE3,0x60BB2468,0x00000000
8301 long 0x3FFE0000,0x80808080,0x80808081,0x00000000
8302 long 0x3FFE0000,0xB07197A2,0x3C46C654,0x00000000
8303
8304 set ADJK,L_SCR1
8305
8306 set X,FP_SCR0
8307 set XDCARE,X+2
8308 set XFRAC,X+4
8309
8310 set F,FP_SCR1
8311 set FFRAC,F+4
8312
8313 set KLOG2,FP_SCR0
8314
8315 set SAVEU,FP_SCR0
8316
8317 global slogn
8318
8319slogn:
8320 fmov.x (%a0),%fp0
8321 mov.l &0x00000000,ADJK(%a6)
8322
8323LOGBGN:
8324
8325
8326
8327 mov.l (%a0),%d1
8328 mov.w 4(%a0),%d1
8329
8330 mov.l (%a0),X(%a6)
8331 mov.l 4(%a0),X+4(%a6)
8332 mov.l 8(%a0),X+8(%a6)
8333
8334 cmp.l %d1,&0
8335 blt.w LOGNEG
8336
8337 cmp.l %d1,&0x3ffef07d
8338 blt.b LOGMAIN
8339 cmp.l %d1,&0x3fff8841
8340 ble.w LOGNEAR1
8341
8342LOGMAIN:
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355 asr.l &8,%d1
8356 asr.l &8,%d1
8357 sub.l &0x3FFF,%d1
8358 add.l ADJK(%a6),%d1
8359 lea LOGTBL(%pc),%a0
8360 fmov.l %d1,%fp1
8361
8362
8363 mov.l &0x3FFF0000,X(%a6)
8364 mov.l XFRAC(%a6),FFRAC(%a6)
8365 and.l &0xFE000000,FFRAC(%a6)
8366 or.l &0x01000000,FFRAC(%a6)
8367 mov.l FFRAC(%a6),%d1
8368 and.l &0x7E000000,%d1
8369 asr.l &8,%d1
8370 asr.l &8,%d1
8371 asr.l &4,%d1
8372 add.l %d1,%a0
8373
8374 fmov.x X(%a6),%fp0
8375 mov.l &0x3fff0000,F(%a6)
8376 clr.l F+8(%a6)
8377 fsub.x F(%a6),%fp0
8378 fmovm.x &0xc,-(%sp)
8379
8380
8381
8382LP1CONT1:
8383
8384 fmul.x (%a0),%fp0
8385 fmul.x LOGOF2(%pc),%fp1
8386 fmov.x %fp0,%fp2
8387 fmul.x %fp2,%fp2
8388 fmov.x %fp1,KLOG2(%a6)
8389
8390
8391
8392
8393
8394 fmov.x %fp2,%fp3
8395 fmov.x %fp2,%fp1
8396
8397 fmul.d LOGA6(%pc),%fp1
8398 fmul.d LOGA5(%pc),%fp2
8399
8400 fadd.d LOGA4(%pc),%fp1
8401 fadd.d LOGA3(%pc),%fp2
8402
8403 fmul.x %fp3,%fp1
8404 fmul.x %fp3,%fp2
8405
8406 fadd.d LOGA2(%pc),%fp1
8407 fadd.d LOGA1(%pc),%fp2
8408
8409 fmul.x %fp3,%fp1
8410 add.l &16,%a0
8411 fmul.x %fp3,%fp2
8412
8413 fmul.x %fp0,%fp1
8414 fadd.x %fp2,%fp0
8415
8416 fadd.x (%a0),%fp1
8417 fmovm.x (%sp)+,&0x30
8418 fadd.x %fp1,%fp0
8419
8420 fmov.l %d0,%fpcr
8421 fadd.x KLOG2(%a6),%fp0
8422 bra t_inx2
8423
8424
8425LOGNEAR1:
8426
8427
8428
8429
8430 fcmp.b %fp0,&0x1
8431 fbeq.l ld_pzero
8432
8433
8434 fmov.x %fp0,%fp1
8435 fsub.s one(%pc),%fp1
8436 fadd.s one(%pc),%fp0
8437 fadd.x %fp1,%fp1
8438
8439
8440
8441LP1CONT2:
8442
8443 fdiv.x %fp0,%fp1
8444 fmovm.x &0xc,-(%sp)
8445
8446
8447
8448
8449 fmov.x %fp1,%fp0
8450 fmul.x %fp0,%fp0
8451 fmov.x %fp1,SAVEU(%a6)
8452 fmov.x %fp0,%fp1
8453 fmul.x %fp1,%fp1
8454
8455 fmov.d LOGB5(%pc),%fp3
8456 fmov.d LOGB4(%pc),%fp2
8457
8458 fmul.x %fp1,%fp3
8459 fmul.x %fp1,%fp2
8460
8461 fadd.d LOGB3(%pc),%fp3
8462 fadd.d LOGB2(%pc),%fp2
8463
8464 fmul.x %fp3,%fp1
8465
8466 fmul.x %fp0,%fp2
8467
8468 fadd.d LOGB1(%pc),%fp1
8469 fmul.x SAVEU(%a6),%fp0
8470
8471 fadd.x %fp2,%fp1
8472 fmovm.x (%sp)+,&0x30
8473
8474 fmul.x %fp1,%fp0
8475
8476 fmov.l %d0,%fpcr
8477 fadd.x SAVEU(%a6),%fp0
8478 bra t_inx2
8479
8480
8481LOGNEG:
8482 bra t_operr
8483
8484 global slognd
8485slognd:
8486
8487
8488 mov.l &-100,ADJK(%a6)
8489
8490
8491
8492
8493
8494
8495 movm.l &0x3f00,-(%sp)
8496 mov.l (%a0),%d3
8497 mov.l 4(%a0),%d4
8498 mov.l 8(%a0),%d5
8499 clr.l %d2
8500
8501 tst.l %d4
8502 bne.b Hi_not0
8503
8504Hi_0:
8505 mov.l %d5,%d4
8506 clr.l %d5
8507 mov.l &32,%d2
8508 clr.l %d6
8509 bfffo %d4{&0:&32},%d6
8510 lsl.l %d6,%d4
8511 add.l %d6,%d2
8512
8513 mov.l %d3,X(%a6)
8514 mov.l %d4,XFRAC(%a6)
8515 mov.l %d5,XFRAC+4(%a6)
8516 neg.l %d2
8517 mov.l %d2,ADJK(%a6)
8518 fmov.x X(%a6),%fp0
8519 movm.l (%sp)+,&0xfc
8520 lea X(%a6),%a0
8521 bra.w LOGBGN
8522
8523Hi_not0:
8524 clr.l %d6
8525 bfffo %d4{&0:&32},%d6
8526 mov.l %d6,%d2
8527 lsl.l %d6,%d4
8528 mov.l %d5,%d7
8529 lsl.l %d6,%d5
8530 neg.l %d6
8531 add.l &32,%d6
8532 lsr.l %d6,%d7
8533 or.l %d7,%d4
8534
8535 mov.l %d3,X(%a6)
8536 mov.l %d4,XFRAC(%a6)
8537 mov.l %d5,XFRAC+4(%a6)
8538 neg.l %d2
8539 mov.l %d2,ADJK(%a6)
8540 fmov.x X(%a6),%fp0
8541 movm.l (%sp)+,&0xfc
8542 lea X(%a6),%a0
8543 bra.w LOGBGN
8544
8545 global slognp1
8546
8547slognp1:
8548 fmov.x (%a0),%fp0
8549 fabs.x %fp0
8550 fcmp.x %fp0,LTHOLD(%pc)
8551 fbgt.w LP1REAL
8552 fmov.l %d0,%fpcr
8553 mov.b &FMOV_OP,%d1
8554 fmov.x (%a0),%fp0
8555 bra t_catch
8556
8557LP1REAL:
8558 fmov.x (%a0),%fp0
8559 mov.l &0x00000000,ADJK(%a6)
8560 fmov.x %fp0,%fp1
8561 fadd.s one(%pc),%fp0
8562 fmov.x %fp0,X(%a6)
8563 mov.w XFRAC(%a6),XDCARE(%a6)
8564 mov.l X(%a6),%d1
8565 cmp.l %d1,&0
8566 ble.w LP1NEG0
8567 cmp.l %d1,&0x3ffe8000
8568 blt.w LOGMAIN
8569 cmp.l %d1,&0x3fffc000
8570 bgt.w LOGMAIN
8571
8572
8573
8574
8575LP1NEAR1:
8576
8577 cmp.l %d1,&0x3ffef07d
8578 blt.w LP1CARE
8579 cmp.l %d1,&0x3fff8841
8580 bgt.w LP1CARE
8581
8582LP1ONE16:
8583
8584
8585 fadd.x %fp1,%fp1
8586 fadd.s one(%pc),%fp0
8587
8588 bra.w LP1CONT2
8589
8590LP1CARE:
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600 mov.l XFRAC(%a6),FFRAC(%a6)
8601 and.l &0xFE000000,FFRAC(%a6)
8602 or.l &0x01000000,FFRAC(%a6)
8603 cmp.l %d1,&0x3FFF8000
8604 bge.b KISZERO
8605
8606KISNEG1:
8607 fmov.s TWO(%pc),%fp0
8608 mov.l &0x3fff0000,F(%a6)
8609 clr.l F+8(%a6)
8610 fsub.x F(%a6),%fp0
8611 mov.l FFRAC(%a6),%d1
8612 and.l &0x7E000000,%d1
8613 asr.l &8,%d1
8614 asr.l &8,%d1
8615 asr.l &4,%d1
8616 fadd.x %fp1,%fp1
8617 fmovm.x &0xc,-(%sp)
8618 fadd.x %fp1,%fp0
8619 lea LOGTBL(%pc),%a0
8620 add.l %d1,%a0
8621 fmov.s negone(%pc),%fp1
8622 bra.w LP1CONT1
8623
8624KISZERO:
8625 fmov.s one(%pc),%fp0
8626 mov.l &0x3fff0000,F(%a6)
8627 clr.l F+8(%a6)
8628 fsub.x F(%a6),%fp0
8629 mov.l FFRAC(%a6),%d1
8630 and.l &0x7E000000,%d1
8631 asr.l &8,%d1
8632 asr.l &8,%d1
8633 asr.l &4,%d1
8634 fadd.x %fp1,%fp0
8635 fmovm.x &0xc,-(%sp)
8636 lea LOGTBL(%pc),%a0
8637 add.l %d1,%a0
8638 fmov.s zero(%pc),%fp1
8639 bra.w LP1CONT1
8640
8641LP1NEG0:
8642
8643 cmp.l %d1,&0
8644 blt.b LP1NEG
8645LP1ZERO:
8646 fmov.s negone(%pc),%fp0
8647
8648 fmov.l %d0,%fpcr
8649 bra t_dz
8650
8651LP1NEG:
8652 fmov.s zero(%pc),%fp0
8653
8654 fmov.l %d0,%fpcr
8655 bra t_operr
8656
8657 global slognp1d
8658
8659
8660slognp1d:
8661 bra t_extdnrm
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705 global satanh
8706satanh:
8707 mov.l (%a0),%d1
8708 mov.w 4(%a0),%d1
8709 and.l &0x7FFFFFFF,%d1
8710 cmp.l %d1,&0x3FFF8000
8711 bge.b ATANHBIG
8712
8713
8714
8715
8716 fabs.x (%a0),%fp0
8717 fmov.x %fp0,%fp1
8718 fneg.x %fp1
8719 fadd.x %fp0,%fp0
8720 fadd.s &0x3F800000,%fp1
8721 fdiv.x %fp1,%fp0
8722 mov.l (%a0),%d1
8723 and.l &0x80000000,%d1
8724 or.l &0x3F000000,%d1
8725 mov.l %d1,-(%sp)
8726
8727 mov.l %d0,-(%sp)
8728 clr.l %d0
8729 fmovm.x &0x01,-(%sp)
8730 lea (%sp),%a0
8731 bsr slognp1
8732 add.l &0xc,%sp
8733
8734 mov.l (%sp)+,%d0
8735 fmov.l %d0,%fpcr
8736 mov.b &FMUL_OP,%d1
8737 fmul.s (%sp)+,%fp0
8738 bra t_catch
8739
8740ATANHBIG:
8741 fabs.x (%a0),%fp0
8742 fcmp.s %fp0,&0x3F800000
8743 fbgt t_operr
8744 bra t_dz
8745
8746 global satanhd
8747
8748satanhd:
8749 bra t_extdnrm
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836INV_L10:
8837 long 0x3FFD0000,0xDE5BD8A9,0x37287195,0x00000000
8838
8839INV_L2:
8840 long 0x3FFF0000,0xB8AA3B29,0x5C17F0BC,0x00000000
8841
8842 global slog10
8843
8844slog10:
8845 fmov.b &0x1,%fp0
8846 fcmp.x %fp0,(%a0)
8847 fbeq.l ld_pzero
8848
8849 mov.l (%a0),%d1
8850 blt.w invalid
8851 mov.l %d0,-(%sp)
8852 clr.l %d0
8853 bsr slogn
8854 fmov.l (%sp)+,%fpcr
8855 fmul.x INV_L10(%pc),%fp0
8856 bra t_inx2
8857
8858 global slog10d
8859
8860slog10d:
8861 mov.l (%a0),%d1
8862 blt.w invalid
8863 mov.l %d0,-(%sp)
8864 clr.l %d0
8865 bsr slognd
8866 fmov.l (%sp)+,%fpcr
8867 fmul.x INV_L10(%pc),%fp0
8868 bra t_minx2
8869
8870 global slog2
8871
8872slog2:
8873 mov.l (%a0),%d1
8874 blt.w invalid
8875
8876 mov.l 8(%a0),%d1
8877 bne.b continue
8878
8879 mov.l 4(%a0),%d1
8880 and.l &0x7FFFFFFF,%d1
8881 bne.b continue
8882
8883
8884 mov.w (%a0),%d1
8885 and.l &0x00007FFF,%d1
8886 sub.l &0x3FFF,%d1
8887 beq.l ld_pzero
8888 fmov.l %d0,%fpcr
8889 fmov.l %d1,%fp0
8890 bra t_inx2
8891
8892continue:
8893 mov.l %d0,-(%sp)
8894 clr.l %d0
8895 bsr slogn
8896 fmov.l (%sp)+,%fpcr
8897 fmul.x INV_L2(%pc),%fp0
8898 bra t_inx2
8899
8900invalid:
8901 bra t_operr
8902
8903 global slog2d
8904
8905slog2d:
8906 mov.l (%a0),%d1
8907 blt.w invalid
8908 mov.l %d0,-(%sp)
8909 clr.l %d0
8910 bsr slognd
8911 fmov.l (%sp)+,%fpcr
8912 fmul.x INV_L2(%pc),%fp0
8913 bra t_minx2
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989L2TEN64:
8990 long 0x406A934F,0x0979A371
8991L10TWO1:
8992 long 0x3F734413,0x509F8000
8993
8994L10TWO2:
8995 long 0xBFCD0000,0xC0219DC1,0xDA994FD2,0x00000000
8996
8997LOG10: long 0x40000000,0x935D8DDD,0xAAA8AC17,0x00000000
8998
8999LOG2: long 0x3FFE0000,0xB17217F7,0xD1CF79AC,0x00000000
9000
9001EXPA5: long 0x3F56C16D,0x6F7BD0B2
9002EXPA4: long 0x3F811112,0x302C712C
9003EXPA3: long 0x3FA55555,0x55554CC1
9004EXPA2: long 0x3FC55555,0x55554A54
9005EXPA1: long 0x3FE00000,0x00000000,0x00000000,0x00000000
9006
9007TEXPTBL:
9008 long 0x3FFF0000,0x80000000,0x00000000,0x3F738000
9009 long 0x3FFF0000,0x8164D1F3,0xBC030773,0x3FBEF7CA
9010 long 0x3FFF0000,0x82CD8698,0xAC2BA1D7,0x3FBDF8A9
9011 long 0x3FFF0000,0x843A28C3,0xACDE4046,0x3FBCD7C9
9012 long 0x3FFF0000,0x85AAC367,0xCC487B15,0xBFBDE8DA
9013 long 0x3FFF0000,0x871F6196,0x9E8D1010,0x3FBDE85C
9014 long 0x3FFF0000,0x88980E80,0x92DA8527,0x3FBEBBF1
9015 long 0x3FFF0000,0x8A14D575,0x496EFD9A,0x3FBB80CA
9016 long 0x3FFF0000,0x8B95C1E3,0xEA8BD6E7,0xBFBA8373
9017 long 0x3FFF0000,0x8D1ADF5B,0x7E5BA9E6,0xBFBE9670
9018 long 0x3FFF0000,0x8EA4398B,0x45CD53C0,0x3FBDB700
9019 long 0x3FFF0000,0x9031DC43,0x1466B1DC,0x3FBEEEB0
9020 long 0x3FFF0000,0x91C3D373,0xAB11C336,0x3FBBFD6D
9021 long 0x3FFF0000,0x935A2B2F,0x13E6E92C,0xBFBDB319
9022 long 0x3FFF0000,0x94F4EFA8,0xFEF70961,0x3FBDBA2B
9023 long 0x3FFF0000,0x96942D37,0x20185A00,0x3FBE91D5
9024 long 0x3FFF0000,0x9837F051,0x8DB8A96F,0x3FBE8D5A
9025 long 0x3FFF0000,0x99E04593,0x20B7FA65,0xBFBCDE7B
9026 long 0x3FFF0000,0x9B8D39B9,0xD54E5539,0xBFBEBAAF
9027 long 0x3FFF0000,0x9D3ED9A7,0x2CFFB751,0xBFBD86DA
9028 long 0x3FFF0000,0x9EF53260,0x91A111AE,0xBFBEBEDD
9029 long 0x3FFF0000,0xA0B0510F,0xB9714FC2,0x3FBCC96E
9030 long 0x3FFF0000,0xA2704303,0x0C496819,0xBFBEC90B
9031 long 0x3FFF0000,0xA43515AE,0x09E6809E,0x3FBBD1DB
9032 long 0x3FFF0000,0xA5FED6A9,0xB15138EA,0x3FBCE5EB
9033 long 0x3FFF0000,0xA7CD93B4,0xE965356A,0xBFBEC274
9034 long 0x3FFF0000,0xA9A15AB4,0xEA7C0EF8,0x3FBEA83C
9035 long 0x3FFF0000,0xAB7A39B5,0xA93ED337,0x3FBECB00
9036 long 0x3FFF0000,0xAD583EEA,0x42A14AC6,0x3FBE9301
9037 long 0x3FFF0000,0xAF3B78AD,0x690A4375,0xBFBD8367
9038 long 0x3FFF0000,0xB123F581,0xD2AC2590,0xBFBEF05F
9039 long 0x3FFF0000,0xB311C412,0xA9112489,0x3FBDFB3C
9040 long 0x3FFF0000,0xB504F333,0xF9DE6484,0x3FBEB2FB
9041 long 0x3FFF0000,0xB6FD91E3,0x28D17791,0x3FBAE2CB
9042 long 0x3FFF0000,0xB8FBAF47,0x62FB9EE9,0x3FBCDC3C
9043 long 0x3FFF0000,0xBAFF5AB2,0x133E45FB,0x3FBEE9AA
9044 long 0x3FFF0000,0xBD08A39F,0x580C36BF,0xBFBEAEFD
9045 long 0x3FFF0000,0xBF1799B6,0x7A731083,0xBFBCBF51
9046 long 0x3FFF0000,0xC12C4CCA,0x66709456,0x3FBEF88A
9047 long 0x3FFF0000,0xC346CCDA,0x24976407,0x3FBD83B2
9048 long 0x3FFF0000,0xC5672A11,0x5506DADD,0x3FBDF8AB
9049 long 0x3FFF0000,0xC78D74C8,0xABB9B15D,0xBFBDFB17
9050 long 0x3FFF0000,0xC9B9BD86,0x6E2F27A3,0xBFBEFE3C
9051 long 0x3FFF0000,0xCBEC14FE,0xF2727C5D,0xBFBBB6F8
9052 long 0x3FFF0000,0xCE248C15,0x1F8480E4,0xBFBCEE53
9053 long 0x3FFF0000,0xD06333DA,0xEF2B2595,0xBFBDA4AE
9054 long 0x3FFF0000,0xD2A81D91,0xF12AE45A,0x3FBC9124
9055 long 0x3FFF0000,0xD4F35AAB,0xCFEDFA1F,0x3FBEB243
9056 long 0x3FFF0000,0xD744FCCA,0xD69D6AF4,0x3FBDE69A
9057 long 0x3FFF0000,0xD99D15C2,0x78AFD7B6,0xBFB8BC61
9058 long 0x3FFF0000,0xDBFBB797,0xDAF23755,0x3FBDF610
9059 long 0x3FFF0000,0xDE60F482,0x5E0E9124,0xBFBD8BE1
9060 long 0x3FFF0000,0xE0CCDEEC,0x2A94E111,0x3FBACB12
9061 long 0x3FFF0000,0xE33F8972,0xBE8A5A51,0x3FBB9BFE
9062 long 0x3FFF0000,0xE5B906E7,0x7C8348A8,0x3FBCF2F4
9063 long 0x3FFF0000,0xE8396A50,0x3C4BDC68,0x3FBEF22F
9064 long 0x3FFF0000,0xEAC0C6E7,0xDD24392F,0xBFBDBF4A
9065 long 0x3FFF0000,0xED4F301E,0xD9942B84,0x3FBEC01A
9066 long 0x3FFF0000,0xEFE4B99B,0xDCDAF5CB,0x3FBE8CAC
9067 long 0x3FFF0000,0xF281773C,0x59FFB13A,0xBFBCBB3F
9068 long 0x3FFF0000,0xF5257D15,0x2486CC2C,0x3FBEF73A
9069 long 0x3FFF0000,0xF7D0DF73,0x0AD13BB9,0xBFB8B795
9070 long 0x3FFF0000,0xFA83B2DB,0x722A033A,0x3FBEF84B
9071 long 0x3FFF0000,0xFD3E0C0C,0xF486C175,0xBFBEF581
9072
9073 set INT,L_SCR1
9074
9075 set X,FP_SCR0
9076 set XDCARE,X+2
9077 set XFRAC,X+4
9078
9079 set ADJFACT,FP_SCR0
9080
9081 set FACT1,FP_SCR0
9082 set FACT1HI,FACT1+4
9083 set FACT1LOW,FACT1+8
9084
9085 set FACT2,FP_SCR1
9086 set FACT2HI,FACT2+4
9087 set FACT2LOW,FACT2+8
9088
9089 global stwotox
9090
9091stwotox:
9092 fmovm.x (%a0),&0x80
9093
9094 mov.l (%a0),%d1
9095 mov.w 4(%a0),%d1
9096 fmov.x %fp0,X(%a6)
9097 and.l &0x7FFFFFFF,%d1
9098
9099 cmp.l %d1,&0x3FB98000
9100 bge.b TWOOK1
9101 bra.w EXPBORS
9102
9103TWOOK1:
9104 cmp.l %d1,&0x400D80C0
9105 ble.b TWOMAIN
9106 bra.w EXPBORS
9107
9108TWOMAIN:
9109
9110
9111 fmov.x %fp0,%fp1
9112 fmul.s &0x42800000,%fp1
9113 fmov.l %fp1,INT(%a6)
9114 mov.l %d2,-(%sp)
9115 lea TEXPTBL(%pc),%a1
9116 fmov.l INT(%a6),%fp1
9117 mov.l INT(%a6),%d1
9118 mov.l %d1,%d2
9119 and.l &0x3F,%d1
9120 asl.l &4,%d1
9121 add.l %d1,%a1
9122 asr.l &6,%d2
9123 mov.l %d2,%d1
9124 asr.l &1,%d1
9125 sub.l %d1,%d2
9126 add.l &0x3FFF,%d2
9127
9128
9129
9130
9131
9132
9133 fmovm.x &0x0c,-(%sp)
9134
9135 fmul.s &0x3C800000,%fp1
9136 mov.l (%a1)+,FACT1(%a6)
9137 mov.l (%a1)+,FACT1HI(%a6)
9138 mov.l (%a1)+,FACT1LOW(%a6)
9139 mov.w (%a1)+,FACT2(%a6)
9140
9141 fsub.x %fp1,%fp0
9142
9143 mov.w (%a1)+,FACT2HI(%a6)
9144 clr.w FACT2HI+2(%a6)
9145 clr.l FACT2LOW(%a6)
9146 add.w %d1,FACT1(%a6)
9147 fmul.x LOG2(%pc),%fp0
9148 add.w %d1,FACT2(%a6)
9149
9150 bra.w expr
9151
9152EXPBORS:
9153
9154 cmp.l %d1,&0x3FFF8000
9155 bgt.b TEXPBIG
9156
9157
9158
9159 fmov.l %d0,%fpcr
9160 fadd.s &0x3F800000,%fp0
9161 bra t_pinx2
9162
9163TEXPBIG:
9164
9165
9166 mov.l X(%a6),%d1
9167 cmp.l %d1,&0
9168 blt.b EXPNEG
9169
9170 bra t_ovfl2
9171
9172EXPNEG:
9173 bra t_unfl2
9174
9175 global stwotoxd
9176stwotoxd:
9177
9178
9179 fmov.l %d0,%fpcr
9180 fmov.s &0x3F800000,%fp0
9181 mov.l (%a0),%d1
9182 or.l &0x00800001,%d1
9183 fadd.s %d1,%fp0
9184 bra t_pinx2
9185
9186 global stentox
9187
9188stentox:
9189 fmovm.x (%a0),&0x80
9190
9191 mov.l (%a0),%d1
9192 mov.w 4(%a0),%d1
9193 fmov.x %fp0,X(%a6)
9194 and.l &0x7FFFFFFF,%d1
9195
9196 cmp.l %d1,&0x3FB98000
9197 bge.b TENOK1
9198 bra.w EXPBORS
9199
9200TENOK1:
9201 cmp.l %d1,&0x400B9B07
9202 ble.b TENMAIN
9203 bra.w EXPBORS
9204
9205TENMAIN:
9206
9207
9208 fmov.x %fp0,%fp1
9209 fmul.d L2TEN64(%pc),%fp1
9210 fmov.l %fp1,INT(%a6)
9211 mov.l %d2,-(%sp)
9212 lea TEXPTBL(%pc),%a1
9213 fmov.l INT(%a6),%fp1
9214 mov.l INT(%a6),%d1
9215 mov.l %d1,%d2
9216 and.l &0x3F,%d1
9217 asl.l &4,%d1
9218 add.l %d1,%a1
9219 asr.l &6,%d2
9220 mov.l %d2,%d1
9221 asr.l &1,%d1
9222 sub.l %d1,%d2
9223 add.l &0x3FFF,%d2
9224
9225
9226
9227
9228
9229 fmovm.x &0x0c,-(%sp)
9230
9231 fmov.x %fp1,%fp2
9232
9233 fmul.d L10TWO1(%pc),%fp1
9234 mov.l (%a1)+,FACT1(%a6)
9235
9236 fmul.x L10TWO2(%pc),%fp2
9237
9238 mov.l (%a1)+,FACT1HI(%a6)
9239 mov.l (%a1)+,FACT1LOW(%a6)
9240 fsub.x %fp1,%fp0
9241 mov.w (%a1)+,FACT2(%a6)
9242
9243 fsub.x %fp2,%fp0
9244
9245 mov.w (%a1)+,FACT2HI(%a6)
9246 clr.w FACT2HI+2(%a6)
9247 clr.l FACT2LOW(%a6)
9248
9249 fmul.x LOG10(%pc),%fp0
9250 add.w %d1,FACT1(%a6)
9251 add.w %d1,FACT2(%a6)
9252
9253expr:
9254
9255
9256
9257
9258
9259 fmov.x %fp0,%fp1
9260 fmul.x %fp1,%fp1
9261
9262 fmov.d EXPA5(%pc),%fp2
9263 fmov.d EXPA4(%pc),%fp3
9264
9265 fmul.x %fp1,%fp2
9266 fmul.x %fp1,%fp3
9267
9268 fadd.d EXPA3(%pc),%fp2
9269 fadd.d EXPA2(%pc),%fp3
9270
9271 fmul.x %fp1,%fp2
9272 fmul.x %fp1,%fp3
9273
9274 fadd.d EXPA1(%pc),%fp2
9275 fmul.x %fp0,%fp3
9276
9277 fmul.x %fp1,%fp2
9278 fadd.x %fp3,%fp0
9279 fadd.x %fp2,%fp0
9280
9281 fmovm.x (%sp)+,&0x30
9282
9283
9284
9285
9286 fmul.x FACT1(%a6),%fp0
9287 fadd.x FACT2(%a6),%fp0
9288 fadd.x FACT1(%a6),%fp0
9289
9290 fmov.l %d0,%fpcr
9291 mov.w %d2,ADJFACT(%a6)
9292 mov.l (%sp)+,%d2
9293 mov.l &0x80000000,ADJFACT+4(%a6)
9294 clr.l ADJFACT+8(%a6)
9295 mov.b &FMUL_OP,%d1
9296 fmul.x ADJFACT(%a6),%fp0
9297 bra t_catch
9298
9299 global stentoxd
9300stentoxd:
9301
9302
9303 fmov.l %d0,%fpcr
9304 fmov.s &0x3F800000,%fp0
9305 mov.l (%a0),%d1
9306 or.l &0x00800001,%d1
9307 fadd.s %d1,%fp0
9308 bra t_pinx2
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323 global smovcr
9324smovcr:
9325 mov.l %d1,-(%sp)
9326
9327 lsr.b &0x4,%d0
9328 mov.l %d0,%d1
9329 andi.w &0x3,%d1
9330 andi.w &0xc,%d0
9331 swap %d0
9332 mov.w %d1,%d0
9333
9334 mov.l (%sp)+,%d1
9335
9336
9337
9338
9339 tst.b %d1
9340 beq.b pi_tbl
9341 cmpi.b %d1,&0x0a
9342 ble.b z_val
9343 cmpi.b %d1,&0x0e
9344 ble.b sm_tbl
9345 cmpi.b %d1,&0x2f
9346 ble.b z_val
9347 cmpi.b %d1,&0x3f
9348 ble.b bg_tbl
9349
9350z_val:
9351 bra.l ld_pzero
9352
9353
9354
9355
9356
9357
9358
9359pi_tbl:
9360 tst.b %d0
9361 bne.b pi_not_rn
9362pi_rn:
9363 lea.l PIRN(%pc),%a0
9364 bra.w set_finx
9365pi_not_rn:
9366 cmpi.b %d0,&rp_mode
9367 beq.b pi_rp
9368pi_rzrm:
9369 lea.l PIRZRM(%pc),%a0
9370 bra.b set_finx
9371pi_rp:
9372 lea.l PIRP(%pc),%a0
9373 bra.b set_finx
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385sm_tbl:
9386 subi.b &0xb,%d1
9387 tst.b %d0
9388 bne.b sm_not_rn
9389sm_rn:
9390 lea.l SMALRN(%pc),%a0
9391sm_tbl_cont:
9392 cmpi.b %d1,&0x2
9393 ble.b set_finx
9394 bra.b no_finx
9395sm_not_rn:
9396 cmpi.b %d0,&rp_mode
9397 beq.b sm_rp
9398sm_rzrm:
9399 lea.l SMALRZRM(%pc),%a0
9400 bra.b sm_tbl_cont
9401sm_rp:
9402 lea.l SMALRP(%pc),%a0
9403 bra.b sm_tbl_cont
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427bg_tbl:
9428 subi.b &0x30,%d1
9429 tst.b %d0
9430 bne.b bg_not_rn
9431bg_rn:
9432 lea.l BIGRN(%pc),%a0
9433bg_tbl_cont:
9434 cmpi.b %d1,&0x1
9435 ble.b set_finx
9436 cmpi.b %d1,&0x7
9437 ble.b no_finx
9438 bra.b set_finx
9439bg_not_rn:
9440 cmpi.b %d0,&rp_mode
9441 beq.b bg_rp
9442bg_rzrm:
9443 lea.l BIGRZRM(%pc),%a0
9444 bra.b bg_tbl_cont
9445bg_rp:
9446 lea.l BIGRP(%pc),%a0
9447 bra.b bg_tbl_cont
9448
9449
9450set_finx:
9451 ori.l &inx2a_mask,USER_FPSR(%a6)
9452no_finx:
9453 mulu.w &0xc,%d1
9454 swap %d0
9455 tst.b %d0
9456
9457 bne.b not_ext
9458
9459
9460 fmovm.x (%a0,%d1.w),&0x80
9461 rts
9462
9463
9464not_ext:
9465 swap %d0
9466
9467
9468
9469
9470 mov.w 0x0(%a0,%d1.w),FP_SCR1_EX(%a6)
9471 mov.l 0x4(%a0,%d1.w),FP_SCR1_HI(%a6)
9472 mov.l 0x8(%a0,%d1.w),FP_SCR1_LO(%a6)
9473 mov.l %d0,%d1
9474 clr.l %d0
9475 lea FP_SCR1(%a6),%a0
9476 clr.w LOCAL_SGN(%a0)
9477 bsr.l _round
9478
9479 fmovm.x (%a0),&0x80
9480 rts
9481
9482 align 0x4
9483
9484PIRN: long 0x40000000,0xc90fdaa2,0x2168c235
9485PIRZRM: long 0x40000000,0xc90fdaa2,0x2168c234
9486PIRP: long 0x40000000,0xc90fdaa2,0x2168c235
9487
9488SMALRN: long 0x3ffd0000,0x9a209a84,0xfbcff798
9489 long 0x40000000,0xadf85458,0xa2bb4a9a
9490 long 0x3fff0000,0xb8aa3b29,0x5c17f0bc
9491 long 0x3ffd0000,0xde5bd8a9,0x37287195
9492 long 0x00000000,0x00000000,0x00000000
9493
9494SMALRZRM:
9495 long 0x3ffd0000,0x9a209a84,0xfbcff798
9496 long 0x40000000,0xadf85458,0xa2bb4a9a
9497 long 0x3fff0000,0xb8aa3b29,0x5c17f0bb
9498 long 0x3ffd0000,0xde5bd8a9,0x37287195
9499 long 0x00000000,0x00000000,0x00000000
9500
9501SMALRP: long 0x3ffd0000,0x9a209a84,0xfbcff799
9502 long 0x40000000,0xadf85458,0xa2bb4a9b
9503 long 0x3fff0000,0xb8aa3b29,0x5c17f0bc
9504 long 0x3ffd0000,0xde5bd8a9,0x37287195
9505 long 0x00000000,0x00000000,0x00000000
9506
9507BIGRN: long 0x3ffe0000,0xb17217f7,0xd1cf79ac
9508 long 0x40000000,0x935d8ddd,0xaaa8ac17
9509
9510 long 0x3fff0000,0x80000000,0x00000000
9511 long 0x40020000,0xA0000000,0x00000000
9512 long 0x40050000,0xC8000000,0x00000000
9513 long 0x400C0000,0x9C400000,0x00000000
9514 long 0x40190000,0xBEBC2000,0x00000000
9515 long 0x40340000,0x8E1BC9BF,0x04000000
9516 long 0x40690000,0x9DC5ADA8,0x2B70B59E
9517 long 0x40D30000,0xC2781F49,0xFFCFA6D5
9518 long 0x41A80000,0x93BA47C9,0x80E98CE0
9519 long 0x43510000,0xAA7EEBFB,0x9DF9DE8E
9520 long 0x46A30000,0xE319A0AE,0xA60E91C7
9521 long 0x4D480000,0xC9767586,0x81750C17
9522 long 0x5A920000,0x9E8B3B5D,0xC53D5DE5
9523 long 0x75250000,0xC4605202,0x8A20979B
9524
9525BIGRZRM:
9526 long 0x3ffe0000,0xb17217f7,0xd1cf79ab
9527 long 0x40000000,0x935d8ddd,0xaaa8ac16
9528
9529 long 0x3fff0000,0x80000000,0x00000000
9530 long 0x40020000,0xA0000000,0x00000000
9531 long 0x40050000,0xC8000000,0x00000000
9532 long 0x400C0000,0x9C400000,0x00000000
9533 long 0x40190000,0xBEBC2000,0x00000000
9534 long 0x40340000,0x8E1BC9BF,0x04000000
9535 long 0x40690000,0x9DC5ADA8,0x2B70B59D
9536 long 0x40D30000,0xC2781F49,0xFFCFA6D5
9537 long 0x41A80000,0x93BA47C9,0x80E98CDF
9538 long 0x43510000,0xAA7EEBFB,0x9DF9DE8D
9539 long 0x46A30000,0xE319A0AE,0xA60E91C6
9540 long 0x4D480000,0xC9767586,0x81750C17
9541 long 0x5A920000,0x9E8B3B5D,0xC53D5DE4
9542 long 0x75250000,0xC4605202,0x8A20979A
9543
9544BIGRP:
9545 long 0x3ffe0000,0xb17217f7,0xd1cf79ac
9546 long 0x40000000,0x935d8ddd,0xaaa8ac17
9547
9548 long 0x3fff0000,0x80000000,0x00000000
9549 long 0x40020000,0xA0000000,0x00000000
9550 long 0x40050000,0xC8000000,0x00000000
9551 long 0x400C0000,0x9C400000,0x00000000
9552 long 0x40190000,0xBEBC2000,0x00000000
9553 long 0x40340000,0x8E1BC9BF,0x04000000
9554 long 0x40690000,0x9DC5ADA8,0x2B70B59E
9555 long 0x40D30000,0xC2781F49,0xFFCFA6D6
9556 long 0x41A80000,0x93BA47C9,0x80E98CE0
9557 long 0x43510000,0xAA7EEBFB,0x9DF9DE8E
9558 long 0x46A30000,0xE319A0AE,0xA60E91C7
9559 long 0x4D480000,0xC9767586,0x81750C18
9560 long 0x5A920000,0x9E8B3B5D,0xC53D5DE5
9561 long 0x75250000,0xC4605202,0x8A20979B
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577set SIGN, L_SCR1
9578
9579 global sscale
9580sscale:
9581 mov.l %d0,-(%sp)
9582
9583 mov.w DST_EX(%a1),%d1
9584 smi.b SIGN(%a6)
9585 andi.l &0x00007fff,%d1
9586
9587 mov.w SRC_EX(%a0),%d0
9588 andi.w &0x7fff,%d0
9589 cmpi.w %d0,&0x3fff
9590 blt.w src_small
9591 cmpi.w %d0,&0x400c
9592 bgt.w src_out
9593
9594
9595
9596
9597src_ok:
9598 fintrz.x SRC(%a0),%fp0
9599 fmov.l %fp0,%d0
9600
9601
9602 fmov.l &0x0,%fpsr
9603
9604 tst.b DST_HI(%a1)
9605 bmi.b sok_norm
9606
9607
9608
9609sok_dnrm:
9610 mov.l %d0,-(%sp)
9611
9612 mov.w DST_EX(%a1),FP_SCR0_EX(%a6)
9613 mov.l DST_HI(%a1),FP_SCR0_HI(%a6)
9614 mov.l DST_LO(%a1),FP_SCR0_LO(%a6)
9615
9616 lea FP_SCR0(%a6),%a0
9617 bsr.l norm
9618 neg.l %d0
9619 add.l (%sp)+,%d0
9620
9621 fmovm.x FP_SCR0(%a6),&0x80
9622
9623 cmpi.w %d0,&-0x3fff
9624 bge.b sok_norm2
9625
9626
9627
9628
9629
9630
9631
9632 fmov.l (%sp)+,%fpcr
9633 mov.l &0x80000000,%d1
9634 subi.l &-0x3fff,%d0
9635 neg.l %d0
9636 cmpi.b %d0,&0x20
9637 bge.b sok_dnrm_32
9638 lsr.l %d0,%d1
9639 clr.l -(%sp)
9640 mov.l %d1,-(%sp)
9641 clr.l -(%sp)
9642 bra.b sok_norm_cont
9643sok_dnrm_32:
9644 subi.b &0x20,%d0
9645 lsr.l %d0,%d1
9646 mov.l %d1,-(%sp)
9647 clr.l -(%sp)
9648 clr.l -(%sp)
9649 bra.b sok_norm_cont
9650
9651
9652
9653sok_norm:
9654 fmovm.x DST(%a1),&0x80
9655sok_norm2:
9656 fmov.l (%sp)+,%fpcr
9657
9658 addi.w &0x3fff,%d0
9659 swap %d0
9660 clr.l -(%sp)
9661 mov.l &0x80000000,-(%sp)
9662 mov.l %d0,-(%sp)
9663
9664sok_norm_cont:
9665 fmov.l %fpcr,%d0
9666 mov.b &FMUL_OP,%d1
9667 fmul.x (%sp)+,%fp0
9668 bra t_catch2
9669
9670
9671
9672
9673
9674src_out:
9675 mov.l (%sp)+,%d0
9676 exg %a0,%a1
9677 tst.b SRC_EX(%a1)
9678 bmi t_unfl
9679 bra t_ovfl_sc
9680
9681
9682
9683
9684
9685src_small:
9686 tst.b DST_HI(%a1)
9687 bpl.b ssmall_done
9688
9689 mov.l (%sp)+,%d0
9690 fmov.l %d0,%fpcr
9691 mov.b &FMOV_OP,%d1
9692 fmov.x DST(%a1),%fp0
9693 bra t_catch2
9694ssmall_done:
9695 mov.l (%sp)+,%d0
9696 mov.l %a1,%a0
9697 bra t_resdnrm
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724# else
9725
9726# endif
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759 set Mod_Flag,L_SCR3
9760 set Sc_Flag,L_SCR3+1
9761
9762 set SignY,L_SCR2
9763 set SignX,L_SCR2+2
9764 set SignQ,L_SCR3+2
9765
9766 set Y,FP_SCR0
9767 set Y_Hi,Y+4
9768 set Y_Lo,Y+8
9769
9770 set R,FP_SCR1
9771 set R_Hi,R+4
9772 set R_Lo,R+8
9773
9774Scale:
9775 long 0x00010000,0x80000000,0x00000000,0x00000000
9776
9777 global smod
9778smod:
9779 clr.b FPSR_QBYTE(%a6)
9780 mov.l %d0,-(%sp)
9781 clr.b Mod_Flag(%a6)
9782 bra.b Mod_Rem
9783
9784 global srem
9785srem:
9786 clr.b FPSR_QBYTE(%a6)
9787 mov.l %d0,-(%sp)
9788 mov.b &0x1,Mod_Flag(%a6)
9789
9790Mod_Rem:
9791
9792 movm.l &0x3f00,-(%sp)
9793 mov.w SRC_EX(%a0),%d3
9794 mov.w %d3,SignY(%a6)
9795 and.l &0x00007FFF,%d3
9796
9797
9798 mov.l SRC_HI(%a0),%d4
9799 mov.l SRC_LO(%a0),%d5
9800
9801 tst.l %d3
9802 bne.b Y_Normal
9803
9804 mov.l &0x00003FFE,%d3
9805 tst.l %d4
9806 bne.b HiY_not0
9807
9808HiY_0:
9809 mov.l %d5,%d4
9810 clr.l %d5
9811 sub.l &32,%d3
9812 clr.l %d6
9813 bfffo %d4{&0:&32},%d6
9814 lsl.l %d6,%d4
9815 sub.l %d6,%d3
9816
9817 bra.b Chk_X
9818
9819HiY_not0:
9820 clr.l %d6
9821 bfffo %d4{&0:&32},%d6
9822 sub.l %d6,%d3
9823 lsl.l %d6,%d4
9824 mov.l %d5,%d7
9825 lsl.l %d6,%d5
9826 neg.l %d6
9827 add.l &32,%d6
9828 lsr.l %d6,%d7
9829 or.l %d7,%d4
9830
9831 bra.b Chk_X
9832
9833Y_Normal:
9834 add.l &0x00003FFE,%d3
9835
9836
9837Chk_X:
9838 mov.w DST_EX(%a1),%d0
9839 mov.w %d0,SignX(%a6)
9840 mov.w SignY(%a6),%d1
9841 eor.l %d0,%d1
9842 and.l &0x00008000,%d1
9843 mov.w %d1,SignQ(%a6)
9844 and.l &0x00007FFF,%d0
9845 mov.l DST_HI(%a1),%d1
9846 mov.l DST_LO(%a1),%d2
9847 tst.l %d0
9848 bne.b X_Normal
9849 mov.l &0x00003FFE,%d0
9850 tst.l %d1
9851 bne.b HiX_not0
9852
9853HiX_0:
9854 mov.l %d2,%d1
9855 clr.l %d2
9856 sub.l &32,%d0
9857 clr.l %d6
9858 bfffo %d1{&0:&32},%d6
9859 lsl.l %d6,%d1
9860 sub.l %d6,%d0
9861
9862 bra.b Init
9863
9864HiX_not0:
9865 clr.l %d6
9866 bfffo %d1{&0:&32},%d6
9867 sub.l %d6,%d0
9868 lsl.l %d6,%d1
9869 mov.l %d2,%d7
9870 lsl.l %d6,%d2
9871 neg.l %d6
9872 add.l &32,%d6
9873 lsr.l %d6,%d7
9874 or.l %d7,%d1
9875
9876 bra.b Init
9877
9878X_Normal:
9879 add.l &0x00003FFE,%d0
9880
9881
9882Init:
9883
9884 mov.l %d3,L_SCR1(%a6)
9885 mov.l %d0,-(%sp)
9886 sub.l %d3,%d0
9887
9888 clr.l %d6
9889 clr.l %d3
9890 mov.l &0,%a1
9891
9892
9893 tst.l %d0
9894 bge.b Mod_Loop_pre
9895
9896
9897
9898 mov.l (%sp)+,%d0
9899 bra.w Get_Mod
9900
9901Mod_Loop_pre:
9902 addq.l &0x4,%sp
9903
9904Mod_Loop:
9905 tst.l %d6
9906 bgt.b R_GT_Y
9907
9908
9909 cmp.l %d1,%d4
9910 bne.b R_NE_Y
9911 cmp.l %d2,%d5
9912 bne.b R_NE_Y
9913
9914
9915 bra.w Rem_is_0
9916
9917R_NE_Y:
9918
9919 bcs.b R_LT_Y
9920
9921R_GT_Y:
9922
9923
9924 sub.l %d5,%d2
9925 subx.l %d4,%d1
9926 clr.l %d6
9927 addq.l &1,%d3
9928
9929R_LT_Y:
9930
9931 tst.l %d0
9932 beq.b PostLoop
9933
9934 add.l %d3,%d3
9935 add.l %d2,%d2
9936 roxl.l &1,%d1
9937 scs %d6
9938 addq.l &1,%a1
9939 subq.l &1,%d0
9940
9941
9942 bra.b Mod_Loop
9943
9944PostLoop:
9945
9946
9947
9948 mov.l L_SCR1(%a6),%d0
9949 tst.l %d1
9950 bne.b HiR_not0
9951
9952HiR_0:
9953 mov.l %d2,%d1
9954 clr.l %d2
9955 sub.l &32,%d0
9956 clr.l %d6
9957 bfffo %d1{&0:&32},%d6
9958 lsl.l %d6,%d1
9959 sub.l %d6,%d0
9960
9961 bra.b Get_Mod
9962
9963HiR_not0:
9964 clr.l %d6
9965 bfffo %d1{&0:&32},%d6
9966 bmi.b Get_Mod
9967 sub.l %d6,%d0
9968 lsl.l %d6,%d1
9969 mov.l %d2,%d7
9970 lsl.l %d6,%d2
9971 neg.l %d6
9972 add.l &32,%d6
9973 lsr.l %d6,%d7
9974 or.l %d7,%d1
9975
9976
9977Get_Mod:
9978 cmp.l %d0,&0x000041FE
9979 bge.b No_Scale
9980Do_Scale:
9981 mov.w %d0,R(%a6)
9982 mov.l %d1,R_Hi(%a6)
9983 mov.l %d2,R_Lo(%a6)
9984 mov.l L_SCR1(%a6),%d6
9985 mov.w %d6,Y(%a6)
9986 mov.l %d4,Y_Hi(%a6)
9987 mov.l %d5,Y_Lo(%a6)
9988 fmov.x R(%a6),%fp0
9989 mov.b &1,Sc_Flag(%a6)
9990 bra.b ModOrRem
9991No_Scale:
9992 mov.l %d1,R_Hi(%a6)
9993 mov.l %d2,R_Lo(%a6)
9994 sub.l &0x3FFE,%d0
9995 mov.w %d0,R(%a6)
9996 mov.l L_SCR1(%a6),%d6
9997 sub.l &0x3FFE,%d6
9998 mov.l %d6,L_SCR1(%a6)
9999 fmov.x R(%a6),%fp0
10000 mov.w %d6,Y(%a6)
10001 mov.l %d4,Y_Hi(%a6)
10002 mov.l %d5,Y_Lo(%a6)
10003 clr.b Sc_Flag(%a6)
10004
10005
10006ModOrRem:
10007 tst.b Mod_Flag(%a6)
10008 beq.b Fix_Sign
10009
10010 mov.l L_SCR1(%a6),%d6
10011 subq.l &1,%d6
10012 cmp.l %d0,%d6
10013 blt.b Fix_Sign
10014 bgt.b Last_Sub
10015
10016 cmp.l %d1,%d4
10017 bne.b Not_EQ
10018 cmp.l %d2,%d5
10019 bne.b Not_EQ
10020 bra.w Tie_Case
10021
10022Not_EQ:
10023 bcs.b Fix_Sign
10024
10025Last_Sub:
10026
10027 fsub.x Y(%a6),%fp0
10028 addq.l &1,%d3
10029
10030
10031Fix_Sign:
10032
10033 mov.w SignX(%a6),%d6
10034 bge.b Get_Q
10035 fneg.x %fp0
10036
10037
10038
10039Get_Q:
10040 clr.l %d6
10041 mov.w SignQ(%a6),%d6
10042 mov.l &8,%d7
10043 lsr.l %d7,%d6
10044 and.l &0x0000007F,%d3
10045 or.l %d6,%d3
10046
10047
10048
10049
10050
10051 mov.b %d3,FPSR_QBYTE(%a6)
10052
10053
10054Restore:
10055 movm.l (%sp)+,&0xfc
10056 mov.l (%sp)+,%d0
10057 fmov.l %d0,%fpcr
10058 tst.b Sc_Flag(%a6)
10059 beq.b Finish
10060 mov.b &FMUL_OP,%d1
10061 fmul.x Scale(%pc),%fp0
10062 bra t_catch2
10063
10064
10065
10066
10067
10068
10069
10070Finish:
10071 mov.b &FMOV_OP,%d1
10072 fmov.x %fp0,%fp0
10073 bra t_catch2
10074
10075Rem_is_0:
10076
10077 addq.l &1,%d3
10078 cmp.l %d0,&8
10079 bge.b Q_Big
10080
10081 lsl.l %d0,%d3
10082 bra.b Set_R_0
10083
10084Q_Big:
10085 clr.l %d3
10086
10087Set_R_0:
10088 fmov.s &0x00000000,%fp0
10089 clr.b Sc_Flag(%a6)
10090 bra.w Fix_Sign
10091
10092Tie_Case:
10093
10094 mov.l %d3,%d6
10095 and.l &0x00000001,%d6
10096 tst.l %d6
10097 beq.w Fix_Sign
10098
10099
10100 addq.l &1,%d3
10101 mov.w SignX(%a6),%d6
10102 eor.l &0x00008000,%d6
10103 mov.w %d6,SignX(%a6)
10104 bra.w Fix_Sign
10105
10106qnan: long 0x7fff0000, 0xffffffff, 0xffffffff
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131 global t_dz
10132t_dz:
10133 tst.b SRC_EX(%a0)
10134 bmi.b t_dz2
10135
10136dz_pinf:
10137 fmov.s &0x7f800000,%fp0
10138 ori.l &dzinf_mask,USER_FPSR(%a6)
10139 rts
10140
10141 global t_dz2
10142t_dz2:
10143 fmov.s &0xff800000,%fp0
10144 ori.l &dzinf_mask+neg_mask,USER_FPSR(%a6)
10145 rts
10146
10147
10148
10149
10150
10151
10152 global t_operr
10153t_operr:
10154 ori.l &opnan_mask,USER_FPSR(%a6)
10155 fmovm.x qnan(%pc),&0x80
10156 rts
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168 global t_resdnrm
10169t_resdnrm:
10170 ori.l &unfl_mask,USER_FPSR(%a6)
10171 bra.b xdnrm_con
10172
10173 global t_extdnrm
10174t_extdnrm:
10175 ori.l &unfinx_mask,USER_FPSR(%a6)
10176
10177xdnrm_con:
10178 mov.l %a0,%a1
10179 mov.l %d0,%d1
10180 andi.b &0xc0,%d1
10181 bne.b xdnrm_sd
10182
10183
10184 tst.b LOCAL_EX(%a0)
10185 bpl.b xdnrm_exit
10186
10187 bset &neg_bit,FPSR_CC(%a6)
10188 bra.b xdnrm_exit
10189
10190
10191xdnrm_sd:
10192 mov.l %a1,-(%sp)
10193 tst.b LOCAL_EX(%a0)
10194 smi.b %d1
10195 bsr.l unf_sub
10196 mov.l (%sp)+,%a1
10197xdnrm_exit:
10198 fmovm.x (%a0),&0x80
10199
10200 mov.b FPCR_ENABLE(%a6),%d0
10201 andi.b &0x0a,%d0
10202 bne.b xdnrm_ena
10203 rts
10204
10205
10206
10207
10208
10209
10210
10211xdnrm_ena:
10212 mov.w LOCAL_EX(%a1),FP_SCR0_EX(%a6)
10213 mov.l LOCAL_HI(%a1),FP_SCR0_HI(%a6)
10214 mov.l LOCAL_LO(%a1),FP_SCR0_LO(%a6)
10215
10216 lea FP_SCR0(%a6),%a0
10217 bsr.l norm
10218 addi.l &0x6000,%d0
10219 andi.w &0x8000,FP_SCR0_EX(%a6)
10220 or.w %d0,FP_SCR0_EX(%a6)
10221
10222 fmovm.x FP_SCR0(%a6),&0x40
10223 rts
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236 global t_unfl
10237t_unfl:
10238 ori.l &unfinx_mask,USER_FPSR(%a6)
10239
10240 tst.b (%a0)
10241 smi.b %d1
10242 bsr.l unf_sub
10243 fmovm.x (%a0),&0x80
10244
10245 fmov.s &0x00000000,%fp1
10246 rts
10247
10248
10249 global t_unfl2
10250t_unfl2:
10251 ori.l &unfinx_mask,USER_FPSR(%a6)
10252
10253 sf.b %d1
10254 bsr.l unf_sub
10255 fmovm.x (%a0),&0x80
10256
10257 fmov.s &0x0000000,%fp1
10258 rts
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274 global t_ovfl_sc
10275t_ovfl_sc:
10276 ori.l &ovfl_inx_mask,USER_FPSR(%a6)
10277
10278 mov.b %d0,%d1
10279 andi.b &0xc0,%d1
10280 beq.b ovfl_work
10281
10282 tst.b LOCAL_HI(%a0)
10283 bmi.b ovfl_sc_norm
10284
10285
10286
10287
10288 mov.w LOCAL_EX(%a0),FP_SCR0_EX(%a6)
10289 mov.l LOCAL_HI(%a0),FP_SCR0_HI(%a6)
10290 mov.l LOCAL_LO(%a0),FP_SCR0_LO(%a6)
10291 lea FP_SCR0(%a6),%a0
10292 movm.l &0xc080,-(%sp)
10293 bsr.l norm
10294 movm.l (%sp)+,&0x0103
10295
10296ovfl_sc_norm:
10297 cmpi.b %d1,&0x40
10298 bne.b ovfl_sc_dbl
10299ovfl_sc_sgl:
10300 tst.l LOCAL_LO(%a0)
10301 bne.b ovfl_sc_inx
10302 tst.b 3+LOCAL_HI(%a0)
10303 bne.b ovfl_sc_inx
10304 bra.b ovfl_work
10305ovfl_sc_dbl:
10306 mov.l LOCAL_LO(%a0),%d1
10307 andi.l &0x7ff,%d1
10308 beq.b ovfl_work
10309ovfl_sc_inx:
10310 ori.l &inex2_mask,USER_FPSR(%a6)
10311 bra.b ovfl_work
10312
10313 global t_ovfl
10314t_ovfl:
10315 ori.l &ovfinx_mask,USER_FPSR(%a6)
10316
10317ovfl_work:
10318 tst.b LOCAL_EX(%a0)
10319 smi.b %d1
10320 bsr.l ovf_res
10321 mov.b %d0,FPSR_CC(%a6)
10322 fmovm.x (%a0),&0x80
10323
10324 fmov.s &0x00000000,%fp1
10325 rts
10326
10327
10328 global t_ovfl2
10329t_ovfl2:
10330 ori.l &ovfinx_mask,USER_FPSR(%a6)
10331
10332 sf.b %d1
10333 bsr.l ovf_res
10334 mov.b %d0,FPSR_CC(%a6)
10335 fmovm.x (%a0),&0x80
10336
10337 fmov.s &0x00000000,%fp1
10338 rts
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349 global t_catch
10350t_catch:
10351
10352 fsave -(%sp)
10353 tst.b 0x2(%sp)
10354 bmi.b catch
10355 add.l &0xc,%sp
10356
10357
10358
10359
10360
10361 global t_inx2
10362t_inx2:
10363 fblt.w t_minx2
10364 fbeq.w inx2_zero
10365
10366 global t_pinx2
10367t_pinx2:
10368 ori.w &inx2a_mask,2+USER_FPSR(%a6)
10369 rts
10370
10371 global t_minx2
10372t_minx2:
10373 ori.l &inx2a_mask+neg_mask,USER_FPSR(%a6)
10374 rts
10375
10376inx2_zero:
10377 mov.b &z_bmask,FPSR_CC(%a6)
10378 ori.w &inx2a_mask,2+USER_FPSR(%a6)
10379 rts
10380
10381
10382
10383catch:
10384 ori.w &inx2a_mask,FPSR_EXCEPT(%a6)
10385catch2:
10386 bsr.l fgen_except
10387 add.l &0xc,%sp
10388 rts
10389
10390 global t_catch2
10391t_catch2:
10392
10393 fsave -(%sp)
10394
10395 tst.b 0x2(%sp)
10396 bmi.b catch2
10397 add.l &0xc,%sp
10398
10399 fmov.l %fpsr,%d0
10400 or.l %d0,USER_FPSR(%a6)
10401
10402 rts
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415unf_sub:
10416 ori.l &unfinx_mask,USER_FPSR(%a6)
10417
10418 andi.w &0x10,%d1
10419
10420 lsr.b &0x4,%d0
10421 andi.b &0xf,%d0
10422 or.b %d1,%d0
10423
10424 mov.l %d0,%d1
10425 lsl.b &0x1,%d1
10426
10427 mov.b (tbl_unf_cc.b,%pc,%d0.w*1),FPSR_CC(%a6)
10428 lea (tbl_unf_result.b,%pc,%d1.w*8),%a0
10429 rts
10430
10431tbl_unf_cc:
10432 byte 0x4, 0x4, 0x4, 0x0
10433 byte 0x4, 0x4, 0x4, 0x0
10434 byte 0x4, 0x4, 0x4, 0x0
10435 byte 0x0, 0x0, 0x0, 0x0
10436 byte 0x8+0x4, 0x8+0x4, 0x8, 0x8+0x4
10437 byte 0x8+0x4, 0x8+0x4, 0x8, 0x8+0x4
10438 byte 0x8+0x4, 0x8+0x4, 0x8, 0x8+0x4
10439
10440tbl_unf_result:
10441 long 0x00000000, 0x00000000, 0x00000000, 0x0
10442 long 0x00000000, 0x00000000, 0x00000000, 0x0
10443 long 0x00000000, 0x00000000, 0x00000000, 0x0
10444 long 0x00000000, 0x00000000, 0x00000001, 0x0
10445
10446 long 0x3f810000, 0x00000000, 0x00000000, 0x0
10447 long 0x3f810000, 0x00000000, 0x00000000, 0x0
10448 long 0x3f810000, 0x00000000, 0x00000000, 0x0
10449 long 0x3f810000, 0x00000100, 0x00000000, 0x0
10450
10451 long 0x3c010000, 0x00000000, 0x00000000, 0x0
10452 long 0x3c010000, 0x00000000, 0x00000000, 0x0
10453 long 0x3c010000, 0x00000000, 0x00000000, 0x0
10454 long 0x3c010000, 0x00000000, 0x00000800, 0x0
10455
10456 long 0x0,0x0,0x0,0x0
10457 long 0x0,0x0,0x0,0x0
10458 long 0x0,0x0,0x0,0x0
10459 long 0x0,0x0,0x0,0x0
10460
10461 long 0x80000000, 0x00000000, 0x00000000, 0x0
10462 long 0x80000000, 0x00000000, 0x00000000, 0x0
10463 long 0x80000000, 0x00000000, 0x00000001, 0x0
10464 long 0x80000000, 0x00000000, 0x00000000, 0x0
10465
10466 long 0xbf810000, 0x00000000, 0x00000000, 0x0
10467 long 0xbf810000, 0x00000000, 0x00000000, 0x0
10468 long 0xbf810000, 0x00000100, 0x00000000, 0x0
10469 long 0xbf810000, 0x00000000, 0x00000000, 0x0
10470
10471 long 0xbc010000, 0x00000000, 0x00000000, 0x0
10472 long 0xbc010000, 0x00000000, 0x00000000, 0x0
10473 long 0xbc010000, 0x00000000, 0x00000800, 0x0
10474 long 0xbc010000, 0x00000000, 0x00000000, 0x0
10475
10476
10477
10478
10479
10480
10481 global src_zero
10482src_zero:
10483 tst.b SRC_EX(%a0)
10484 bmi.b ld_mzero
10485
10486
10487
10488
10489 global ld_pzero
10490ld_pzero:
10491 fmov.s &0x00000000,%fp0
10492 mov.b &z_bmask,FPSR_CC(%a6)
10493 rts
10494
10495
10496 global ld_mzero
10497ld_mzero:
10498 fmov.s &0x80000000,%fp0
10499 mov.b &neg_bmask+z_bmask,FPSR_CC(%a6)
10500 rts
10501
10502
10503
10504
10505 global dst_zero
10506dst_zero:
10507 tst.b DST_EX(%a1)
10508 bmi.b ld_mzero
10509 bra.b ld_pzero
10510
10511
10512
10513
10514 global src_inf
10515src_inf:
10516 tst.b SRC_EX(%a0)
10517 bmi.b ld_minf
10518
10519
10520
10521
10522 global ld_pinf
10523ld_pinf:
10524 fmov.s &0x7f800000,%fp0
10525 mov.b &inf_bmask,FPSR_CC(%a6)
10526 rts
10527
10528
10529
10530
10531 global ld_minf
10532ld_minf:
10533 fmov.s &0xff800000,%fp0
10534 mov.b &neg_bmask+inf_bmask,FPSR_CC(%a6)
10535 rts
10536
10537
10538
10539
10540 global dst_inf
10541dst_inf:
10542 tst.b DST_EX(%a1)
10543 bmi.b ld_minf
10544 bra.b ld_pinf
10545
10546 global szr_inf
10547
10548
10549
10550
10551
10552szr_inf:
10553 tst.b SRC_EX(%a0)
10554 bmi.b ld_pzero
10555 bra.b ld_pinf
10556
10557
10558
10559
10560
10561
10562 global sopr_inf
10563sopr_inf:
10564 tst.b SRC_EX(%a0)
10565 bmi.w t_operr
10566 bra.b ld_pinf
10567
10568
10569
10570
10571
10572
10573 global setoxm1i
10574setoxm1i:
10575 tst.b SRC_EX(%a0)
10576 bmi.b ld_mone
10577 bra.b ld_pinf
10578
10579
10580
10581
10582 global src_one
10583src_one:
10584 tst.b SRC_EX(%a0)
10585 bmi.b ld_mone
10586
10587
10588
10589
10590 global ld_pone
10591ld_pone:
10592 fmov.s &0x3f800000,%fp0
10593 clr.b FPSR_CC(%a6)
10594 rts
10595
10596
10597
10598
10599 global ld_mone
10600ld_mone:
10601 fmov.s &0xbf800000,%fp0
10602 mov.b &neg_bmask,FPSR_CC(%a6)
10603 rts
10604
10605ppiby2: long 0x3fff0000, 0xc90fdaa2, 0x2168c235
10606mpiby2: long 0xbfff0000, 0xc90fdaa2, 0x2168c235
10607
10608
10609
10610
10611 global spi_2
10612spi_2:
10613 tst.b SRC_EX(%a0)
10614 bmi.b ld_mpi2
10615
10616
10617
10618
10619 global ld_ppi2
10620ld_ppi2:
10621 fmov.l %d0,%fpcr
10622 fmov.x ppiby2(%pc),%fp0
10623 bra.w t_pinx2
10624
10625
10626
10627
10628 global ld_mpi2
10629ld_mpi2:
10630 fmov.l %d0,%fpcr
10631 fmov.x mpiby2(%pc),%fp0
10632 bra.w t_minx2
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643 global ssincosz
10644ssincosz:
10645 fmov.s &0x3f800000,%fp1
10646 tst.b SRC_EX(%a0)
10647 bpl.b sincoszp
10648 fmov.s &0x80000000,%fp0
10649 mov.b &z_bmask+neg_bmask,FPSR_CC(%a6)
10650 bra.b sto_cos
10651sincoszp:
10652 fmov.s &0x00000000,%fp0
10653 mov.b &z_bmask,FPSR_CC(%a6)
10654 bra.b sto_cos
10655
10656
10657
10658
10659
10660
10661 global ssincosi
10662ssincosi:
10663 fmov.x qnan(%pc),%fp1
10664 bsr.l sto_cos
10665 bra.w t_operr
10666
10667
10668
10669
10670
10671 global ssincosqnan
10672ssincosqnan:
10673 fmov.x LOCAL_EX(%a0),%fp1
10674 bsr.l sto_cos
10675 bra.w src_qnan
10676
10677
10678
10679
10680
10681 global ssincossnan
10682ssincossnan:
10683 fmov.x LOCAL_EX(%a0),%fp1
10684 bsr.l sto_cos
10685 bra.w src_snan
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698 global sto_cos
10699sto_cos:
10700 mov.b 1+EXC_CMDREG(%a6),%d0
10701 andi.w &0x7,%d0
10702 mov.w (tbl_sto_cos.b,%pc,%d0.w*2),%d0
10703 jmp (tbl_sto_cos.b,%pc,%d0.w*1)
10704
10705tbl_sto_cos:
10706 short sto_cos_0 - tbl_sto_cos
10707 short sto_cos_1 - tbl_sto_cos
10708 short sto_cos_2 - tbl_sto_cos
10709 short sto_cos_3 - tbl_sto_cos
10710 short sto_cos_4 - tbl_sto_cos
10711 short sto_cos_5 - tbl_sto_cos
10712 short sto_cos_6 - tbl_sto_cos
10713 short sto_cos_7 - tbl_sto_cos
10714
10715sto_cos_0:
10716 fmovm.x &0x40,EXC_FP0(%a6)
10717 rts
10718sto_cos_1:
10719 fmovm.x &0x40,EXC_FP1(%a6)
10720 rts
10721sto_cos_2:
10722 fmov.x %fp1,%fp2
10723 rts
10724sto_cos_3:
10725 fmov.x %fp1,%fp3
10726 rts
10727sto_cos_4:
10728 fmov.x %fp1,%fp4
10729 rts
10730sto_cos_5:
10731 fmov.x %fp1,%fp5
10732 rts
10733sto_cos_6:
10734 fmov.x %fp1,%fp6
10735 rts
10736sto_cos_7:
10737 fmov.x %fp1,%fp7
10738 rts
10739
10740
10741 global smod_sdnrm
10742 global smod_snorm
10743smod_sdnrm:
10744smod_snorm:
10745 mov.b DTAG(%a6),%d1
10746 beq.l smod
10747 cmpi.b %d1,&ZERO
10748 beq.w smod_zro
10749 cmpi.b %d1,&INF
10750 beq.l t_operr
10751 cmpi.b %d1,&DENORM
10752 beq.l smod
10753 cmpi.b %d1,&SNAN
10754 beq.l dst_snan
10755 bra.l dst_qnan
10756
10757 global smod_szero
10758smod_szero:
10759 mov.b DTAG(%a6),%d1
10760 beq.l t_operr
10761 cmpi.b %d1,&ZERO
10762 beq.l t_operr
10763 cmpi.b %d1,&INF
10764 beq.l t_operr
10765 cmpi.b %d1,&DENORM
10766 beq.l t_operr
10767 cmpi.b %d1,&QNAN
10768 beq.l dst_qnan
10769 bra.l dst_snan
10770
10771 global smod_sinf
10772smod_sinf:
10773 mov.b DTAG(%a6),%d1
10774 beq.l smod_fpn
10775 cmpi.b %d1,&ZERO
10776 beq.l smod_zro
10777 cmpi.b %d1,&INF
10778 beq.l t_operr
10779 cmpi.b %d1,&DENORM
10780 beq.l smod_fpn
10781 cmpi.b %d1,&QNAN
10782 beq.l dst_qnan
10783 bra.l dst_snan
10784
10785smod_zro:
10786srem_zro:
10787 mov.b SRC_EX(%a0),%d1
10788 mov.b DST_EX(%a1),%d0
10789 eor.b %d0,%d1
10790 andi.b &0x80,%d1
10791 mov.b %d1,FPSR_QBYTE(%a6)
10792 tst.b %d0
10793 bpl.w ld_pzero
10794 bra.w ld_mzero
10795
10796smod_fpn:
10797srem_fpn:
10798 clr.b FPSR_QBYTE(%a6)
10799 mov.l %d0,-(%sp)
10800 mov.b SRC_EX(%a0),%d1
10801 mov.b DST_EX(%a1),%d0
10802 eor.b %d0,%d1
10803 andi.b &0x80,%d1
10804 mov.b %d1,FPSR_QBYTE(%a6)
10805 cmpi.b DTAG(%a6),&DENORM
10806 bne.b smod_nrm
10807 lea DST(%a1),%a0
10808 mov.l (%sp)+,%d0
10809 bra t_resdnrm
10810smod_nrm:
10811 fmov.l (%sp)+,%fpcr
10812 fmov.x DST(%a1),%fp0
10813 tst.b DST_EX(%a1)
10814 bmi.b smod_nrm_neg
10815 rts
10816
10817smod_nrm_neg:
10818 mov.b &neg_bmask,FPSR_CC(%a6)
10819 rts
10820
10821
10822 global srem_snorm
10823 global srem_sdnrm
10824srem_sdnrm:
10825srem_snorm:
10826 mov.b DTAG(%a6),%d1
10827 beq.l srem
10828 cmpi.b %d1,&ZERO
10829 beq.w srem_zro
10830 cmpi.b %d1,&INF
10831 beq.l t_operr
10832 cmpi.b %d1,&DENORM
10833 beq.l srem
10834 cmpi.b %d1,&QNAN
10835 beq.l dst_qnan
10836 bra.l dst_snan
10837
10838 global srem_szero
10839srem_szero:
10840 mov.b DTAG(%a6),%d1
10841 beq.l t_operr
10842 cmpi.b %d1,&ZERO
10843 beq.l t_operr
10844 cmpi.b %d1,&INF
10845 beq.l t_operr
10846 cmpi.b %d1,&DENORM
10847 beq.l t_operr
10848 cmpi.b %d1,&QNAN
10849 beq.l dst_qnan
10850 bra.l dst_snan
10851
10852 global srem_sinf
10853srem_sinf:
10854 mov.b DTAG(%a6),%d1
10855 beq.w srem_fpn
10856 cmpi.b %d1,&ZERO
10857 beq.w srem_zro
10858 cmpi.b %d1,&INF
10859 beq.l t_operr
10860 cmpi.b %d1,&DENORM
10861 beq.l srem_fpn
10862 cmpi.b %d1,&QNAN
10863 beq.l dst_qnan
10864 bra.l dst_snan
10865
10866
10867 global sscale_snorm
10868 global sscale_sdnrm
10869sscale_snorm:
10870sscale_sdnrm:
10871 mov.b DTAG(%a6),%d1
10872 beq.l sscale
10873 cmpi.b %d1,&ZERO
10874 beq.l dst_zero
10875 cmpi.b %d1,&INF
10876 beq.l dst_inf
10877 cmpi.b %d1,&DENORM
10878 beq.l sscale
10879 cmpi.b %d1,&QNAN
10880 beq.l dst_qnan
10881 bra.l dst_snan
10882
10883 global sscale_szero
10884sscale_szero:
10885 mov.b DTAG(%a6),%d1
10886 beq.l sscale
10887 cmpi.b %d1,&ZERO
10888 beq.l dst_zero
10889 cmpi.b %d1,&INF
10890 beq.l dst_inf
10891 cmpi.b %d1,&DENORM
10892 beq.l sscale
10893 cmpi.b %d1,&QNAN
10894 beq.l dst_qnan
10895 bra.l dst_snan
10896
10897 global sscale_sinf
10898sscale_sinf:
10899 mov.b DTAG(%a6),%d1
10900 beq.l t_operr
10901 cmpi.b %d1,&QNAN
10902 beq.l dst_qnan
10903 cmpi.b %d1,&SNAN
10904 beq.l dst_snan
10905 bra.l t_operr
10906
10907
10908
10909
10910
10911
10912 global sop_sqnan
10913sop_sqnan:
10914 mov.b DTAG(%a6),%d1
10915 cmpi.b %d1,&QNAN
10916 beq.b dst_qnan
10917 cmpi.b %d1,&SNAN
10918 beq.b dst_snan
10919 bra.b src_qnan
10920
10921
10922
10923
10924 global sop_ssnan
10925sop_ssnan:
10926 mov.b DTAG(%a6),%d1
10927 cmpi.b %d1,&QNAN
10928 beq.b dst_qnan_src_snan
10929 cmpi.b %d1,&SNAN
10930 beq.b dst_snan
10931 bra.b src_snan
10932
10933dst_qnan_src_snan:
10934 ori.l &snaniop_mask,USER_FPSR(%a6)
10935 bra.b dst_qnan
10936
10937
10938
10939
10940 global dst_snan
10941dst_snan:
10942 fmov.x DST(%a1),%fp0
10943 fmov.l %fpsr,%d0
10944 or.l %d0,USER_FPSR(%a6)
10945 rts
10946
10947
10948
10949
10950 global dst_qnan
10951dst_qnan:
10952 fmov.x DST(%a1),%fp0
10953 tst.b DST_EX(%a1)
10954 bmi.b dst_qnan_m
10955dst_qnan_p:
10956 mov.b &nan_bmask,FPSR_CC(%a6)
10957 rts
10958dst_qnan_m:
10959 mov.b &neg_bmask+nan_bmask,FPSR_CC(%a6)
10960 rts
10961
10962
10963
10964
10965 global src_snan
10966src_snan:
10967 fmov.x SRC(%a0),%fp0
10968 fmov.l %fpsr,%d0
10969 or.l %d0,USER_FPSR(%a6)
10970 rts
10971
10972
10973
10974
10975 global src_qnan
10976src_qnan:
10977 fmov.x SRC(%a0),%fp0
10978 tst.b SRC_EX(%a0)
10979 bmi.b dst_qnan_m
10980src_qnan_p:
10981 mov.b &nan_bmask,FPSR_CC(%a6)
10982 rts
10983src_qnan_m:
10984 mov.b &neg_bmask+nan_bmask,FPSR_CC(%a6)
10985 rts
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996 global fsinh
10997fsinh:
10998 mov.b STAG(%a6),%d1
10999 beq.l ssinh
11000 cmpi.b %d1,&ZERO
11001 beq.l src_zero
11002 cmpi.b %d1,&INF
11003 beq.l src_inf
11004 cmpi.b %d1,&DENORM
11005 beq.l ssinhd
11006 cmpi.b %d1,&QNAN
11007 beq.l src_qnan
11008 bra.l src_snan
11009
11010 global flognp1
11011flognp1:
11012 mov.b STAG(%a6),%d1
11013 beq.l slognp1
11014 cmpi.b %d1,&ZERO
11015 beq.l src_zero
11016 cmpi.b %d1,&INF
11017 beq.l sopr_inf
11018 cmpi.b %d1,&DENORM
11019 beq.l slognp1d
11020 cmpi.b %d1,&QNAN
11021 beq.l src_qnan
11022 bra.l src_snan
11023
11024 global fetoxm1
11025fetoxm1:
11026 mov.b STAG(%a6),%d1
11027 beq.l setoxm1
11028 cmpi.b %d1,&ZERO
11029 beq.l src_zero
11030 cmpi.b %d1,&INF
11031 beq.l setoxm1i
11032 cmpi.b %d1,&DENORM
11033 beq.l setoxm1d
11034 cmpi.b %d1,&QNAN
11035 beq.l src_qnan
11036 bra.l src_snan
11037
11038 global ftanh
11039ftanh:
11040 mov.b STAG(%a6),%d1
11041 beq.l stanh
11042 cmpi.b %d1,&ZERO
11043 beq.l src_zero
11044 cmpi.b %d1,&INF
11045 beq.l src_one
11046 cmpi.b %d1,&DENORM
11047 beq.l stanhd
11048 cmpi.b %d1,&QNAN
11049 beq.l src_qnan
11050 bra.l src_snan
11051
11052 global fatan
11053fatan:
11054 mov.b STAG(%a6),%d1
11055 beq.l satan
11056 cmpi.b %d1,&ZERO
11057 beq.l src_zero
11058 cmpi.b %d1,&INF
11059 beq.l spi_2
11060 cmpi.b %d1,&DENORM
11061 beq.l satand
11062 cmpi.b %d1,&QNAN
11063 beq.l src_qnan
11064 bra.l src_snan
11065
11066 global fasin
11067fasin:
11068 mov.b STAG(%a6),%d1
11069 beq.l sasin
11070 cmpi.b %d1,&ZERO
11071 beq.l src_zero
11072 cmpi.b %d1,&INF
11073 beq.l t_operr
11074 cmpi.b %d1,&DENORM
11075 beq.l sasind
11076 cmpi.b %d1,&QNAN
11077 beq.l src_qnan
11078 bra.l src_snan
11079
11080 global fatanh
11081fatanh:
11082 mov.b STAG(%a6),%d1
11083 beq.l satanh
11084 cmpi.b %d1,&ZERO
11085 beq.l src_zero
11086 cmpi.b %d1,&INF
11087 beq.l t_operr
11088 cmpi.b %d1,&DENORM
11089 beq.l satanhd
11090 cmpi.b %d1,&QNAN
11091 beq.l src_qnan
11092 bra.l src_snan
11093
11094 global fsine
11095fsine:
11096 mov.b STAG(%a6),%d1
11097 beq.l ssin
11098 cmpi.b %d1,&ZERO
11099 beq.l src_zero
11100 cmpi.b %d1,&INF
11101 beq.l t_operr
11102 cmpi.b %d1,&DENORM
11103 beq.l ssind
11104 cmpi.b %d1,&QNAN
11105 beq.l src_qnan
11106 bra.l src_snan
11107
11108 global ftan
11109ftan:
11110 mov.b STAG(%a6),%d1
11111 beq.l stan
11112 cmpi.b %d1,&ZERO
11113 beq.l src_zero
11114 cmpi.b %d1,&INF
11115 beq.l t_operr
11116 cmpi.b %d1,&DENORM
11117 beq.l stand
11118 cmpi.b %d1,&QNAN
11119 beq.l src_qnan
11120 bra.l src_snan
11121
11122 global fetox
11123fetox:
11124 mov.b STAG(%a6),%d1
11125 beq.l setox
11126 cmpi.b %d1,&ZERO
11127 beq.l ld_pone
11128 cmpi.b %d1,&INF
11129 beq.l szr_inf
11130 cmpi.b %d1,&DENORM
11131 beq.l setoxd
11132 cmpi.b %d1,&QNAN
11133 beq.l src_qnan
11134 bra.l src_snan
11135
11136 global ftwotox
11137ftwotox:
11138 mov.b STAG(%a6),%d1
11139 beq.l stwotox
11140 cmpi.b %d1,&ZERO
11141 beq.l ld_pone
11142 cmpi.b %d1,&INF
11143 beq.l szr_inf
11144 cmpi.b %d1,&DENORM
11145 beq.l stwotoxd
11146 cmpi.b %d1,&QNAN
11147 beq.l src_qnan
11148 bra.l src_snan
11149
11150 global ftentox
11151ftentox:
11152 mov.b STAG(%a6),%d1
11153 beq.l stentox
11154 cmpi.b %d1,&ZERO
11155 beq.l ld_pone
11156 cmpi.b %d1,&INF
11157 beq.l szr_inf
11158 cmpi.b %d1,&DENORM
11159 beq.l stentoxd
11160 cmpi.b %d1,&QNAN
11161 beq.l src_qnan
11162 bra.l src_snan
11163
11164 global flogn
11165flogn:
11166 mov.b STAG(%a6),%d1
11167 beq.l slogn
11168 cmpi.b %d1,&ZERO
11169 beq.l t_dz2
11170 cmpi.b %d1,&INF
11171 beq.l sopr_inf
11172 cmpi.b %d1,&DENORM
11173 beq.l slognd
11174 cmpi.b %d1,&QNAN
11175 beq.l src_qnan
11176 bra.l src_snan
11177
11178 global flog10
11179flog10:
11180 mov.b STAG(%a6),%d1
11181 beq.l slog10
11182 cmpi.b %d1,&ZERO
11183 beq.l t_dz2
11184 cmpi.b %d1,&INF
11185 beq.l sopr_inf
11186 cmpi.b %d1,&DENORM
11187 beq.l slog10d
11188 cmpi.b %d1,&QNAN
11189 beq.l src_qnan
11190 bra.l src_snan
11191
11192 global flog2
11193flog2:
11194 mov.b STAG(%a6),%d1
11195 beq.l slog2
11196 cmpi.b %d1,&ZERO
11197 beq.l t_dz2
11198 cmpi.b %d1,&INF
11199 beq.l sopr_inf
11200 cmpi.b %d1,&DENORM
11201 beq.l slog2d
11202 cmpi.b %d1,&QNAN
11203 beq.l src_qnan
11204 bra.l src_snan
11205
11206 global fcosh
11207fcosh:
11208 mov.b STAG(%a6),%d1
11209 beq.l scosh
11210 cmpi.b %d1,&ZERO
11211 beq.l ld_pone
11212 cmpi.b %d1,&INF
11213 beq.l ld_pinf
11214 cmpi.b %d1,&DENORM
11215 beq.l scoshd
11216 cmpi.b %d1,&QNAN
11217 beq.l src_qnan
11218 bra.l src_snan
11219
11220 global facos
11221facos:
11222 mov.b STAG(%a6),%d1
11223 beq.l sacos
11224 cmpi.b %d1,&ZERO
11225 beq.l ld_ppi2
11226 cmpi.b %d1,&INF
11227 beq.l t_operr
11228 cmpi.b %d1,&DENORM
11229 beq.l sacosd
11230 cmpi.b %d1,&QNAN
11231 beq.l src_qnan
11232 bra.l src_snan
11233
11234 global fcos
11235fcos:
11236 mov.b STAG(%a6),%d1
11237 beq.l scos
11238 cmpi.b %d1,&ZERO
11239 beq.l ld_pone
11240 cmpi.b %d1,&INF
11241 beq.l t_operr
11242 cmpi.b %d1,&DENORM
11243 beq.l scosd
11244 cmpi.b %d1,&QNAN
11245 beq.l src_qnan
11246 bra.l src_snan
11247
11248 global fgetexp
11249fgetexp:
11250 mov.b STAG(%a6),%d1
11251 beq.l sgetexp
11252 cmpi.b %d1,&ZERO
11253 beq.l src_zero
11254 cmpi.b %d1,&INF
11255 beq.l t_operr
11256 cmpi.b %d1,&DENORM
11257 beq.l sgetexpd
11258 cmpi.b %d1,&QNAN
11259 beq.l src_qnan
11260 bra.l src_snan
11261
11262 global fgetman
11263fgetman:
11264 mov.b STAG(%a6),%d1
11265 beq.l sgetman
11266 cmpi.b %d1,&ZERO
11267 beq.l src_zero
11268 cmpi.b %d1,&INF
11269 beq.l t_operr
11270 cmpi.b %d1,&DENORM
11271 beq.l sgetmand
11272 cmpi.b %d1,&QNAN
11273 beq.l src_qnan
11274 bra.l src_snan
11275
11276 global fsincos
11277fsincos:
11278 mov.b STAG(%a6),%d1
11279 beq.l ssincos
11280 cmpi.b %d1,&ZERO
11281 beq.l ssincosz
11282 cmpi.b %d1,&INF
11283 beq.l ssincosi
11284 cmpi.b %d1,&DENORM
11285 beq.l ssincosd
11286 cmpi.b %d1,&QNAN
11287 beq.l ssincosqnan
11288 bra.l ssincossnan
11289
11290 global fmod
11291fmod:
11292 mov.b STAG(%a6),%d1
11293 beq.l smod_snorm
11294 cmpi.b %d1,&ZERO
11295 beq.l smod_szero
11296 cmpi.b %d1,&INF
11297 beq.l smod_sinf
11298 cmpi.b %d1,&DENORM
11299 beq.l smod_sdnrm
11300 cmpi.b %d1,&QNAN
11301 beq.l sop_sqnan
11302 bra.l sop_ssnan
11303
11304 global frem
11305frem:
11306 mov.b STAG(%a6),%d1
11307 beq.l srem_snorm
11308 cmpi.b %d1,&ZERO
11309 beq.l srem_szero
11310 cmpi.b %d1,&INF
11311 beq.l srem_sinf
11312 cmpi.b %d1,&DENORM
11313 beq.l srem_sdnrm
11314 cmpi.b %d1,&QNAN
11315 beq.l sop_sqnan
11316 bra.l sop_ssnan
11317
11318 global fscale
11319fscale:
11320 mov.b STAG(%a6),%d1
11321 beq.l sscale_snorm
11322 cmpi.b %d1,&ZERO
11323 beq.l sscale_szero
11324 cmpi.b %d1,&INF
11325 beq.l sscale_sinf
11326 cmpi.b %d1,&DENORM
11327 beq.l sscale_sdnrm
11328 cmpi.b %d1,&QNAN
11329 beq.l sop_sqnan
11330 bra.l sop_ssnan
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360 global fgen_except
11361fgen_except:
11362 cmpi.b 0x3(%sp),&0x7
11363 beq.b fge_unsupp
11364
11365 mov.b &NORM,STAG(%a6)
11366
11367fge_cont:
11368 mov.b &NORM,DTAG(%a6)
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378 fmovm.x &0x80,FP_DST(%a6)
11379
11380 lea 0x4(%sp),%a0
11381 lea FP_DST(%a6),%a1
11382
11383 cmpi.b %d1,&FMOV_OP
11384 beq.b fge_fin
11385 cmpi.b %d1,&FADD_OP
11386 beq.b fge_fadd
11387fge_fmul:
11388 bsr.l fmul
11389 rts
11390fge_fadd:
11391 bsr.l fadd
11392 rts
11393fge_fin:
11394 bsr.l fin
11395 rts
11396
11397fge_unsupp:
11398 mov.b &DENORM,STAG(%a6)
11399 bra.b fge_cont
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409 swbeg &109
11410tbl_unsupp:
11411 long fin - tbl_unsupp
11412 long fint - tbl_unsupp
11413 long fsinh - tbl_unsupp
11414 long fintrz - tbl_unsupp
11415 long fsqrt - tbl_unsupp
11416 long tbl_unsupp - tbl_unsupp
11417 long flognp1 - tbl_unsupp
11418 long tbl_unsupp - tbl_unsupp
11419 long fetoxm1 - tbl_unsupp
11420 long ftanh - tbl_unsupp
11421 long fatan - tbl_unsupp
11422 long tbl_unsupp - tbl_unsupp
11423 long fasin - tbl_unsupp
11424 long fatanh - tbl_unsupp
11425 long fsine - tbl_unsupp
11426 long ftan - tbl_unsupp
11427 long fetox - tbl_unsupp
11428 long ftwotox - tbl_unsupp
11429 long ftentox - tbl_unsupp
11430 long tbl_unsupp - tbl_unsupp
11431 long flogn - tbl_unsupp
11432 long flog10 - tbl_unsupp
11433 long flog2 - tbl_unsupp
11434 long tbl_unsupp - tbl_unsupp
11435 long fabs - tbl_unsupp
11436 long fcosh - tbl_unsupp
11437 long fneg - tbl_unsupp
11438 long tbl_unsupp - tbl_unsupp
11439 long facos - tbl_unsupp
11440 long fcos - tbl_unsupp
11441 long fgetexp - tbl_unsupp
11442 long fgetman - tbl_unsupp
11443 long fdiv - tbl_unsupp
11444 long fmod - tbl_unsupp
11445 long fadd - tbl_unsupp
11446 long fmul - tbl_unsupp
11447 long fsgldiv - tbl_unsupp
11448 long frem - tbl_unsupp
11449 long fscale - tbl_unsupp
11450 long fsglmul - tbl_unsupp
11451 long fsub - tbl_unsupp
11452 long tbl_unsupp - tbl_unsupp
11453 long tbl_unsupp - tbl_unsupp
11454 long tbl_unsupp - tbl_unsupp
11455 long tbl_unsupp - tbl_unsupp
11456 long tbl_unsupp - tbl_unsupp
11457 long tbl_unsupp - tbl_unsupp
11458 long tbl_unsupp - tbl_unsupp
11459 long fsincos - tbl_unsupp
11460 long fsincos - tbl_unsupp
11461 long fsincos - tbl_unsupp
11462 long fsincos - tbl_unsupp
11463 long fsincos - tbl_unsupp
11464 long fsincos - tbl_unsupp
11465 long fsincos - tbl_unsupp
11466 long fsincos - tbl_unsupp
11467 long fcmp - tbl_unsupp
11468 long tbl_unsupp - tbl_unsupp
11469 long ftst - tbl_unsupp
11470 long tbl_unsupp - tbl_unsupp
11471 long tbl_unsupp - tbl_unsupp
11472 long tbl_unsupp - tbl_unsupp
11473 long tbl_unsupp - tbl_unsupp
11474 long tbl_unsupp - tbl_unsupp
11475 long fsin - tbl_unsupp
11476 long fssqrt - tbl_unsupp
11477 long tbl_unsupp - tbl_unsupp
11478 long tbl_unsupp - tbl_unsupp
11479 long fdin - tbl_unsupp
11480 long fdsqrt - tbl_unsupp
11481 long tbl_unsupp - tbl_unsupp
11482 long tbl_unsupp - tbl_unsupp
11483 long tbl_unsupp - tbl_unsupp
11484 long tbl_unsupp - tbl_unsupp
11485 long tbl_unsupp - tbl_unsupp
11486 long tbl_unsupp - tbl_unsupp
11487 long tbl_unsupp - tbl_unsupp
11488 long tbl_unsupp - tbl_unsupp
11489 long tbl_unsupp - tbl_unsupp
11490 long tbl_unsupp - tbl_unsupp
11491 long tbl_unsupp - tbl_unsupp
11492 long tbl_unsupp - tbl_unsupp
11493 long tbl_unsupp - tbl_unsupp
11494 long tbl_unsupp - tbl_unsupp
11495 long tbl_unsupp - tbl_unsupp
11496 long tbl_unsupp - tbl_unsupp
11497 long tbl_unsupp - tbl_unsupp
11498 long tbl_unsupp - tbl_unsupp
11499 long fsabs - tbl_unsupp
11500 long tbl_unsupp - tbl_unsupp
11501 long fsneg - tbl_unsupp
11502 long tbl_unsupp - tbl_unsupp
11503 long fdabs - tbl_unsupp
11504 long tbl_unsupp - tbl_unsupp
11505 long fdneg - tbl_unsupp
11506 long tbl_unsupp - tbl_unsupp
11507 long fsdiv - tbl_unsupp
11508 long tbl_unsupp - tbl_unsupp
11509 long fsadd - tbl_unsupp
11510 long fsmul - tbl_unsupp
11511 long fddiv - tbl_unsupp
11512 long tbl_unsupp - tbl_unsupp
11513 long fdadd - tbl_unsupp
11514 long fdmul - tbl_unsupp
11515 long fssub - tbl_unsupp
11516 long tbl_unsupp - tbl_unsupp
11517 long tbl_unsupp - tbl_unsupp
11518 long tbl_unsupp - tbl_unsupp
11519 long fdsub - tbl_unsupp
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556 align 0x10
11557tbl_fmul_ovfl:
11558 long 0x3fff - 0x7ffe
11559 long 0x3fff - 0x407e
11560 long 0x3fff - 0x43fe
11561tbl_fmul_unfl:
11562 long 0x3fff + 0x0001
11563 long 0x3fff - 0x3f80
11564 long 0x3fff - 0x3c00
11565
11566 global fsmul
11567fsmul:
11568 andi.b &0x30,%d0
11569 ori.b &s_mode*0x10,%d0
11570 bra.b fmul
11571
11572 global fdmul
11573fdmul:
11574 andi.b &0x30,%d0
11575 ori.b &d_mode*0x10,%d0
11576
11577 global fmul
11578fmul:
11579 mov.l %d0,L_SCR3(%a6)
11580
11581 clr.w %d1
11582 mov.b DTAG(%a6),%d1
11583 lsl.b &0x3,%d1
11584 or.b STAG(%a6),%d1
11585 bne.w fmul_not_norm
11586
11587fmul_norm:
11588 mov.w DST_EX(%a1),FP_SCR1_EX(%a6)
11589 mov.l DST_HI(%a1),FP_SCR1_HI(%a6)
11590 mov.l DST_LO(%a1),FP_SCR1_LO(%a6)
11591
11592 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
11593 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
11594 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
11595
11596 bsr.l scale_to_zero_src
11597 mov.l %d0,-(%sp)
11598
11599 bsr.l scale_to_zero_dst
11600
11601 add.l %d0,(%sp)
11602
11603 mov.w 2+L_SCR3(%a6),%d1
11604 lsr.b &0x6,%d1
11605 mov.l (%sp)+,%d0
11606 cmp.l %d0,(tbl_fmul_ovfl.w,%pc,%d1.w*4)
11607 beq.w fmul_may_ovfl
11608 blt.w fmul_ovfl
11609
11610 cmp.l %d0,(tbl_fmul_unfl.w,%pc,%d1.w*4)
11611 beq.w fmul_may_unfl
11612 bgt.w fmul_unfl
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622fmul_normal:
11623 fmovm.x FP_SCR1(%a6),&0x80
11624
11625 fmov.l L_SCR3(%a6),%fpcr
11626 fmov.l &0x0,%fpsr
11627
11628 fmul.x FP_SCR0(%a6),%fp0
11629
11630 fmov.l %fpsr,%d1
11631 fmov.l &0x0,%fpcr
11632
11633 or.l %d1,USER_FPSR(%a6)
11634
11635fmul_normal_exit:
11636 fmovm.x &0x80,FP_SCR0(%a6)
11637 mov.l %d2,-(%sp)
11638 mov.w FP_SCR0_EX(%a6),%d1
11639 mov.l %d1,%d2
11640 andi.l &0x7fff,%d1
11641 andi.w &0x8000,%d2
11642 sub.l %d0,%d1
11643 or.w %d2,%d1
11644 mov.w %d1,FP_SCR0_EX(%a6)
11645 mov.l (%sp)+,%d2
11646 fmovm.x FP_SCR0(%a6),&0x80
11647 rts
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662fmul_ovfl:
11663 fmovm.x FP_SCR1(%a6),&0x80
11664
11665 fmov.l L_SCR3(%a6),%fpcr
11666 fmov.l &0x0,%fpsr
11667
11668 fmul.x FP_SCR0(%a6),%fp0
11669
11670 fmov.l %fpsr,%d1
11671 fmov.l &0x0,%fpcr
11672
11673 or.l %d1,USER_FPSR(%a6)
11674
11675
11676fmul_ovfl_tst:
11677 or.l &ovfl_inx_mask,USER_FPSR(%a6)
11678
11679 mov.b FPCR_ENABLE(%a6),%d1
11680 andi.b &0x13,%d1
11681 bne.b fmul_ovfl_ena
11682
11683
11684fmul_ovfl_dis:
11685 btst &neg_bit,FPSR_CC(%a6)
11686 sne %d1
11687 mov.l L_SCR3(%a6),%d0
11688 bsr.l ovf_res
11689 or.b %d0,FPSR_CC(%a6)
11690 fmovm.x (%a0),&0x80
11691 rts
11692
11693
11694
11695
11696
11697
11698
11699fmul_ovfl_ena:
11700 mov.l L_SCR3(%a6),%d1
11701 andi.b &0xc0,%d1
11702 bne.b fmul_ovfl_ena_sd
11703
11704fmul_ovfl_ena_cont:
11705 fmovm.x &0x80,FP_SCR0(%a6)
11706
11707 mov.l %d2,-(%sp)
11708 mov.w FP_SCR0_EX(%a6),%d1
11709 mov.w %d1,%d2
11710 andi.l &0x7fff,%d1
11711 sub.l %d0,%d1
11712 subi.l &0x6000,%d1
11713 andi.w &0x7fff,%d1
11714 andi.w &0x8000,%d2
11715 or.w %d2,%d1
11716 mov.w %d1,FP_SCR0_EX(%a6)
11717 mov.l (%sp)+,%d2
11718 fmovm.x FP_SCR0(%a6),&0x40
11719 bra.b fmul_ovfl_dis
11720
11721fmul_ovfl_ena_sd:
11722 fmovm.x FP_SCR1(%a6),&0x80
11723
11724 mov.l L_SCR3(%a6),%d1
11725 andi.b &0x30,%d1
11726 fmov.l %d1,%fpcr
11727
11728 fmul.x FP_SCR0(%a6),%fp0
11729
11730 fmov.l &0x0,%fpcr
11731 bra.b fmul_ovfl_ena_cont
11732
11733
11734
11735
11736
11737
11738
11739
11740fmul_may_ovfl:
11741 fmovm.x FP_SCR1(%a6),&0x80
11742
11743 fmov.l L_SCR3(%a6),%fpcr
11744 fmov.l &0x0,%fpsr
11745
11746 fmul.x FP_SCR0(%a6),%fp0
11747
11748 fmov.l %fpsr,%d1
11749 fmov.l &0x0,%fpcr
11750
11751 or.l %d1,USER_FPSR(%a6)
11752
11753 fabs.x %fp0,%fp1
11754 fcmp.b %fp1,&0x2
11755 fbge.w fmul_ovfl_tst
11756
11757
11758 bra.w fmul_normal_exit
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773fmul_unfl:
11774 bset &unfl_bit,FPSR_EXCEPT(%a6)
11775
11776
11777
11778
11779 fmovm.x FP_SCR1(%a6),&0x80
11780
11781 fmov.l &rz_mode*0x10,%fpcr
11782 fmov.l &0x0,%fpsr
11783
11784 fmul.x FP_SCR0(%a6),%fp0
11785
11786 fmov.l %fpsr,%d1
11787 fmov.l &0x0,%fpcr
11788
11789 or.l %d1,USER_FPSR(%a6)
11790
11791 mov.b FPCR_ENABLE(%a6),%d1
11792 andi.b &0x0b,%d1
11793 bne.b fmul_unfl_ena
11794
11795fmul_unfl_dis:
11796 fmovm.x &0x80,FP_SCR0(%a6)
11797
11798 lea FP_SCR0(%a6),%a0
11799 mov.l L_SCR3(%a6),%d1
11800 bsr.l unf_res
11801 or.b %d0,FPSR_CC(%a6)
11802 fmovm.x FP_SCR0(%a6),&0x80
11803 rts
11804
11805
11806
11807
11808fmul_unfl_ena:
11809 fmovm.x FP_SCR1(%a6),&0x40
11810
11811 mov.l L_SCR3(%a6),%d1
11812 andi.b &0xc0,%d1
11813 bne.b fmul_unfl_ena_sd
11814
11815
11816
11817 fmov.l L_SCR3(%a6),%fpcr
11818
11819fmul_unfl_ena_cont:
11820 fmov.l &0x0,%fpsr
11821
11822 fmul.x FP_SCR0(%a6),%fp1
11823
11824 fmov.l &0x0,%fpcr
11825
11826 fmovm.x &0x40,FP_SCR0(%a6)
11827 mov.l %d2,-(%sp)
11828 mov.w FP_SCR0_EX(%a6),%d1
11829 mov.l %d1,%d2
11830 andi.l &0x7fff,%d1
11831 andi.w &0x8000,%d2
11832 sub.l %d0,%d1
11833 addi.l &0x6000,%d1
11834 andi.w &0x7fff,%d1
11835 or.w %d2,%d1
11836 mov.w %d1,FP_SCR0_EX(%a6)
11837 mov.l (%sp)+,%d2
11838 fmovm.x FP_SCR0(%a6),&0x40
11839 bra.w fmul_unfl_dis
11840
11841fmul_unfl_ena_sd:
11842 mov.l L_SCR3(%a6),%d1
11843 andi.b &0x30,%d1
11844 fmov.l %d1,%fpcr
11845
11846 bra.b fmul_unfl_ena_cont
11847
11848
11849
11850
11851fmul_may_unfl:
11852 fmovm.x FP_SCR1(%a6),&0x80
11853
11854 fmov.l L_SCR3(%a6),%fpcr
11855 fmov.l &0x0,%fpsr
11856
11857 fmul.x FP_SCR0(%a6),%fp0
11858
11859 fmov.l %fpsr,%d1
11860 fmov.l &0x0,%fpcr
11861
11862 or.l %d1,USER_FPSR(%a6)
11863
11864 fabs.x %fp0,%fp1
11865 fcmp.b %fp1,&0x2
11866 fbgt.w fmul_normal_exit
11867 fblt.w fmul_unfl
11868
11869
11870
11871
11872
11873
11874
11875
11876 fmovm.x FP_SCR1(%a6),&0x40
11877
11878 mov.l L_SCR3(%a6),%d1
11879 andi.b &0xc0,%d1
11880 ori.b &rz_mode*0x10,%d1
11881
11882 fmov.l %d1,%fpcr
11883 fmov.l &0x0,%fpsr
11884
11885 fmul.x FP_SCR0(%a6),%fp1
11886
11887 fmov.l &0x0,%fpcr
11888 fabs.x %fp1
11889 fcmp.b %fp1,&0x2
11890 fbge.w fmul_normal_exit
11891 bra.w fmul_unfl
11892
11893
11894
11895
11896
11897
11898fmul_not_norm:
11899 mov.w (tbl_fmul_op.b,%pc,%d1.w*2),%d1
11900 jmp (tbl_fmul_op.b,%pc,%d1.w)
11901
11902 swbeg &48
11903tbl_fmul_op:
11904 short fmul_norm - tbl_fmul_op
11905 short fmul_zero - tbl_fmul_op
11906 short fmul_inf_src - tbl_fmul_op
11907 short fmul_res_qnan - tbl_fmul_op
11908 short fmul_norm - tbl_fmul_op
11909 short fmul_res_snan - tbl_fmul_op
11910 short tbl_fmul_op - tbl_fmul_op
11911 short tbl_fmul_op - tbl_fmul_op
11912
11913 short fmul_zero - tbl_fmul_op
11914 short fmul_zero - tbl_fmul_op
11915 short fmul_res_operr - tbl_fmul_op
11916 short fmul_res_qnan - tbl_fmul_op
11917 short fmul_zero - tbl_fmul_op
11918 short fmul_res_snan - tbl_fmul_op
11919 short tbl_fmul_op - tbl_fmul_op
11920 short tbl_fmul_op - tbl_fmul_op
11921
11922 short fmul_inf_dst - tbl_fmul_op
11923 short fmul_res_operr - tbl_fmul_op
11924 short fmul_inf_dst - tbl_fmul_op
11925 short fmul_res_qnan - tbl_fmul_op
11926 short fmul_inf_dst - tbl_fmul_op
11927 short fmul_res_snan - tbl_fmul_op
11928 short tbl_fmul_op - tbl_fmul_op
11929 short tbl_fmul_op - tbl_fmul_op
11930
11931 short fmul_res_qnan - tbl_fmul_op
11932 short fmul_res_qnan - tbl_fmul_op
11933 short fmul_res_qnan - tbl_fmul_op
11934 short fmul_res_qnan - tbl_fmul_op
11935 short fmul_res_qnan - tbl_fmul_op
11936 short fmul_res_snan - tbl_fmul_op
11937 short tbl_fmul_op - tbl_fmul_op
11938 short tbl_fmul_op - tbl_fmul_op
11939
11940 short fmul_norm - tbl_fmul_op
11941 short fmul_zero - tbl_fmul_op
11942 short fmul_inf_src - tbl_fmul_op
11943 short fmul_res_qnan - tbl_fmul_op
11944 short fmul_norm - tbl_fmul_op
11945 short fmul_res_snan - tbl_fmul_op
11946 short tbl_fmul_op - tbl_fmul_op
11947 short tbl_fmul_op - tbl_fmul_op
11948
11949 short fmul_res_snan - tbl_fmul_op
11950 short fmul_res_snan - tbl_fmul_op
11951 short fmul_res_snan - tbl_fmul_op
11952 short fmul_res_snan - tbl_fmul_op
11953 short fmul_res_snan - tbl_fmul_op
11954 short fmul_res_snan - tbl_fmul_op
11955 short tbl_fmul_op - tbl_fmul_op
11956 short tbl_fmul_op - tbl_fmul_op
11957
11958fmul_res_operr:
11959 bra.l res_operr
11960fmul_res_snan:
11961 bra.l res_snan
11962fmul_res_qnan:
11963 bra.l res_qnan
11964
11965
11966
11967
11968 global fmul_zero
11969fmul_zero:
11970 mov.b SRC_EX(%a0),%d0
11971 mov.b DST_EX(%a1),%d1
11972 eor.b %d0,%d1
11973 bpl.b fmul_zero_p
11974fmul_zero_n:
11975 fmov.s &0x80000000,%fp0
11976 mov.b &z_bmask+neg_bmask,FPSR_CC(%a6)
11977 rts
11978fmul_zero_p:
11979 fmov.s &0x00000000,%fp0
11980 mov.b &z_bmask,FPSR_CC(%a6)
11981 rts
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991 global fmul_inf_dst
11992fmul_inf_dst:
11993 fmovm.x DST(%a1),&0x80
11994 mov.b SRC_EX(%a0),%d0
11995 mov.b DST_EX(%a1),%d1
11996 eor.b %d0,%d1
11997 bpl.b fmul_inf_dst_p
11998fmul_inf_dst_n:
11999 fabs.x %fp0
12000 fneg.x %fp0
12001 mov.b &inf_bmask+neg_bmask,FPSR_CC(%a6)
12002 rts
12003fmul_inf_dst_p:
12004 fabs.x %fp0
12005 mov.b &inf_bmask,FPSR_CC(%a6)
12006 rts
12007
12008 global fmul_inf_src
12009fmul_inf_src:
12010 fmovm.x SRC(%a0),&0x80
12011 mov.b SRC_EX(%a0),%d0
12012 mov.b DST_EX(%a1),%d1
12013 eor.b %d0,%d1
12014 bpl.b fmul_inf_dst_p
12015 bra.b fmul_inf_dst_n
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051 global fsin
12052fsin:
12053 andi.b &0x30,%d0
12054 ori.b &s_mode*0x10,%d0
12055 bra.b fin
12056
12057 global fdin
12058fdin:
12059 andi.b &0x30,%d0
12060 ori.b &d_mode*0x10,%d0
12061
12062 global fin
12063fin:
12064 mov.l %d0,L_SCR3(%a6)
12065
12066 mov.b STAG(%a6),%d1
12067 bne.w fin_not_norm
12068
12069
12070
12071
12072fin_norm:
12073 andi.b &0xc0,%d0
12074 bne.w fin_not_ext
12075
12076
12077
12078
12079
12080
12081 tst.b SRC_EX(%a0)
12082 bpl.b fin_norm_done
12083 bset &neg_bit,FPSR_CC(%a6)
12084fin_norm_done:
12085 fmovm.x SRC(%a0),&0x80
12086 rts
12087
12088
12089
12090
12091
12092fin_denorm:
12093 andi.b &0xc0,%d0
12094 bne.w fin_not_ext
12095
12096 bset &unfl_bit,FPSR_EXCEPT(%a6)
12097 tst.b SRC_EX(%a0)
12098 bpl.b fin_denorm_done
12099 bset &neg_bit,FPSR_CC(%a6)
12100fin_denorm_done:
12101 fmovm.x SRC(%a0),&0x80
12102 btst &unfl_bit,FPCR_ENABLE(%a6)
12103 bne.b fin_denorm_unfl_ena
12104 rts
12105
12106
12107
12108
12109
12110
12111fin_denorm_unfl_ena:
12112 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
12113 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
12114 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
12115 lea FP_SCR0(%a6),%a0
12116 bsr.l norm
12117 neg.w %d0
12118 addi.w &0x6000,%d0
12119 mov.w FP_SCR0_EX(%a6),%d1
12120 andi.w &0x8000,%d1
12121 andi.w &0x7fff,%d0
12122 or.w %d1,%d0
12123 mov.w %d0,FP_SCR0_EX(%a6)
12124 fmovm.x FP_SCR0(%a6),&0x40
12125 rts
12126
12127
12128
12129
12130fin_not_ext:
12131 cmpi.b %d0,&s_mode*0x10
12132 bne.b fin_dbl
12133
12134
12135
12136
12137fin_sgl:
12138 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
12139 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
12140 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
12141 bsr.l scale_to_zero_src
12142
12143 cmpi.l %d0,&0x3fff-0x3f80
12144 bge.w fin_sd_unfl
12145 cmpi.l %d0,&0x3fff-0x407e
12146 beq.w fin_sd_may_ovfl
12147 blt.w fin_sd_ovfl
12148
12149
12150
12151
12152fin_sd_normal:
12153 fmov.l &0x0,%fpsr
12154 fmov.l L_SCR3(%a6),%fpcr
12155
12156 fmov.x FP_SCR0(%a6),%fp0
12157
12158 fmov.l %fpsr,%d1
12159 fmov.l &0x0,%fpcr
12160
12161 or.l %d1,USER_FPSR(%a6)
12162
12163fin_sd_normal_exit:
12164 mov.l %d2,-(%sp)
12165 fmovm.x &0x80,FP_SCR0(%a6)
12166 mov.w FP_SCR0_EX(%a6),%d1
12167 mov.w %d1,%d2
12168 andi.l &0x7fff,%d1
12169 sub.l %d0,%d1
12170 andi.w &0x8000,%d2
12171 or.w %d1,%d2
12172 mov.w %d2,FP_SCR0_EX(%a6)
12173 mov.l (%sp)+,%d2
12174 fmovm.x FP_SCR0(%a6),&0x80
12175 rts
12176
12177
12178
12179
12180fin_dbl:
12181 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
12182 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
12183 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
12184 bsr.l scale_to_zero_src
12185
12186 cmpi.l %d0,&0x3fff-0x3c00
12187 bge.w fin_sd_unfl
12188 cmpi.l %d0,&0x3fff-0x43fe
12189 beq.w fin_sd_may_ovfl
12190 blt.w fin_sd_ovfl
12191 bra.w fin_sd_normal
12192
12193
12194
12195
12196fin_sd_unfl:
12197 bset &unfl_bit,FPSR_EXCEPT(%a6)
12198
12199 tst.b FP_SCR0_EX(%a6)
12200 bpl.b fin_sd_unfl_tst
12201 bset &neg_bit,FPSR_CC(%a6)
12202
12203
12204fin_sd_unfl_tst:
12205 mov.b FPCR_ENABLE(%a6),%d1
12206 andi.b &0x0b,%d1
12207 bne.b fin_sd_unfl_ena
12208
12209fin_sd_unfl_dis:
12210 lea FP_SCR0(%a6),%a0
12211 mov.l L_SCR3(%a6),%d1
12212 bsr.l unf_res
12213 or.b %d0,FPSR_CC(%a6)
12214 fmovm.x FP_SCR0(%a6),&0x80
12215 rts
12216
12217
12218
12219
12220
12221fin_sd_unfl_ena:
12222 mov.l FP_SCR0_HI(%a6),FP_SCR1_HI(%a6)
12223 mov.l FP_SCR0_LO(%a6),FP_SCR1_LO(%a6)
12224 mov.w FP_SCR0_EX(%a6),%d1
12225
12226 mov.l %d2,-(%sp)
12227 mov.w %d1,%d2
12228 andi.l &0x7fff,%d1
12229 sub.l %d0,%d1
12230 andi.w &0x8000,%d2
12231 addi.l &0x6000,%d1
12232 andi.w &0x7fff,%d1
12233 or.w %d1,%d2
12234 mov.w %d2,FP_SCR1_EX(%a6)
12235 fmovm.x FP_SCR1(%a6),&0x40
12236 mov.l (%sp)+,%d2
12237 bra.b fin_sd_unfl_dis
12238
12239
12240
12241
12242fin_sd_ovfl:
12243 fmov.l &0x0,%fpsr
12244 fmov.l L_SCR3(%a6),%fpcr
12245
12246 fmov.x FP_SCR0(%a6),%fp0
12247
12248 fmov.l &0x0,%fpcr
12249 fmov.l %fpsr,%d1
12250
12251 or.l %d1,USER_FPSR(%a6)
12252
12253fin_sd_ovfl_tst:
12254 or.l &ovfl_inx_mask,USER_FPSR(%a6)
12255
12256 mov.b FPCR_ENABLE(%a6),%d1
12257 andi.b &0x13,%d1
12258 bne.b fin_sd_ovfl_ena
12259
12260
12261
12262
12263
12264fin_sd_ovfl_dis:
12265 btst &neg_bit,FPSR_CC(%a6)
12266 sne %d1
12267 mov.l L_SCR3(%a6),%d0
12268 bsr.l ovf_res
12269 or.b %d0,FPSR_CC(%a6)
12270 fmovm.x (%a0),&0x80
12271 rts
12272
12273
12274
12275
12276
12277
12278fin_sd_ovfl_ena:
12279 mov.l %d2,-(%sp)
12280 mov.w FP_SCR0_EX(%a6),%d1
12281 mov.l %d1,%d2
12282 andi.l &0x7fff,%d1
12283 andi.w &0x8000,%d2
12284 sub.l %d0,%d1
12285 sub.l &0x6000,%d1
12286 andi.w &0x7fff,%d1
12287 or.w %d2,%d1
12288 mov.w %d1,FP_SCR0_EX(%a6)
12289 mov.l (%sp)+,%d2
12290 fmovm.x FP_SCR0(%a6),&0x40
12291 bra.b fin_sd_ovfl_dis
12292
12293
12294
12295
12296fin_sd_may_ovfl:
12297 fmov.l &0x0,%fpsr
12298 fmov.l L_SCR3(%a6),%fpcr
12299
12300 fmov.x FP_SCR0(%a6),%fp0
12301
12302 fmov.l %fpsr,%d1
12303 fmov.l &0x0,%fpcr
12304
12305 or.l %d1,USER_FPSR(%a6)
12306
12307 fabs.x %fp0,%fp1
12308 fcmp.b %fp1,&0x2
12309 fbge.w fin_sd_ovfl_tst
12310
12311
12312 bra.w fin_sd_normal_exit
12313
12314
12315
12316
12317
12318
12319fin_not_norm:
12320 cmpi.b %d1,&DENORM
12321 beq.w fin_denorm
12322 cmpi.b %d1,&SNAN
12323 beq.l res_snan_1op
12324 cmpi.b %d1,&QNAN
12325 beq.l res_qnan_1op
12326
12327
12328
12329
12330
12331
12332 fmov.x SRC(%a0),%fp0
12333 fmov.l %fpsr,%d0
12334 rol.l &0x8,%d0
12335 mov.b %d0,FPSR_CC(%a6)
12336 rts
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373 align 0x10
12374tbl_fdiv_unfl:
12375 long 0x3fff - 0x0000
12376 long 0x3fff - 0x3f81
12377 long 0x3fff - 0x3c01
12378
12379tbl_fdiv_ovfl:
12380 long 0x3fff - 0x7ffe
12381 long 0x3fff - 0x407e
12382 long 0x3fff - 0x43fe
12383
12384 global fsdiv
12385fsdiv:
12386 andi.b &0x30,%d0
12387 ori.b &s_mode*0x10,%d0
12388 bra.b fdiv
12389
12390 global fddiv
12391fddiv:
12392 andi.b &0x30,%d0
12393 ori.b &d_mode*0x10,%d0
12394
12395 global fdiv
12396fdiv:
12397 mov.l %d0,L_SCR3(%a6)
12398
12399 clr.w %d1
12400 mov.b DTAG(%a6),%d1
12401 lsl.b &0x3,%d1
12402 or.b STAG(%a6),%d1
12403
12404 bne.w fdiv_not_norm
12405
12406
12407
12408
12409fdiv_norm:
12410 mov.w DST_EX(%a1),FP_SCR1_EX(%a6)
12411 mov.l DST_HI(%a1),FP_SCR1_HI(%a6)
12412 mov.l DST_LO(%a1),FP_SCR1_LO(%a6)
12413
12414 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
12415 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
12416 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
12417
12418 bsr.l scale_to_zero_src
12419 mov.l %d0,-(%sp)
12420
12421 bsr.l scale_to_zero_dst
12422
12423 neg.l (%sp)
12424 add.l %d0,(%sp)
12425
12426 mov.w 2+L_SCR3(%a6),%d1
12427 lsr.b &0x6,%d1
12428 mov.l (%sp)+,%d0
12429 cmp.l %d0,(tbl_fdiv_ovfl.b,%pc,%d1.w*4)
12430 ble.w fdiv_may_ovfl
12431
12432 cmp.l %d0,(tbl_fdiv_unfl.w,%pc,%d1.w*4)
12433 beq.w fdiv_may_unfl
12434 bgt.w fdiv_unfl
12435
12436fdiv_normal:
12437 fmovm.x FP_SCR1(%a6),&0x80
12438
12439 fmov.l L_SCR3(%a6),%fpcr
12440 fmov.l &0x0,%fpsr
12441
12442 fdiv.x FP_SCR0(%a6),%fp0
12443
12444 fmov.l %fpsr,%d1
12445 fmov.l &0x0,%fpcr
12446
12447 or.l %d1,USER_FPSR(%a6)
12448
12449fdiv_normal_exit:
12450 fmovm.x &0x80,FP_SCR0(%a6)
12451 mov.l %d2,-(%sp)
12452 mov.w FP_SCR0_EX(%a6),%d1
12453 mov.l %d1,%d2
12454 andi.l &0x7fff,%d1
12455 andi.w &0x8000,%d2
12456 sub.l %d0,%d1
12457 or.w %d2,%d1
12458 mov.w %d1,FP_SCR0_EX(%a6)
12459 mov.l (%sp)+,%d2
12460 fmovm.x FP_SCR0(%a6),&0x80
12461 rts
12462
12463tbl_fdiv_ovfl2:
12464 long 0x7fff
12465 long 0x407f
12466 long 0x43ff
12467
12468fdiv_no_ovfl:
12469 mov.l (%sp)+,%d0
12470 bra.b fdiv_normal_exit
12471
12472fdiv_may_ovfl:
12473 mov.l %d0,-(%sp)
12474
12475 fmovm.x FP_SCR1(%a6),&0x80
12476
12477 fmov.l L_SCR3(%a6),%fpcr
12478 fmov.l &0x0,%fpsr
12479
12480 fdiv.x FP_SCR0(%a6),%fp0
12481
12482 fmov.l %fpsr,%d0
12483 fmov.l &0x0,%fpcr
12484
12485 or.l %d0,USER_FPSR(%a6)
12486
12487 fmovm.x &0x01,-(%sp)
12488 mov.w (%sp),%d0
12489 add.l &0xc,%sp
12490 andi.l &0x7fff,%d0
12491 sub.l (%sp),%d0
12492 cmp.l %d0,(tbl_fdiv_ovfl2.b,%pc,%d1.w*4)
12493 blt.b fdiv_no_ovfl
12494 mov.l (%sp)+,%d0
12495
12496fdiv_ovfl_tst:
12497 or.l &ovfl_inx_mask,USER_FPSR(%a6)
12498
12499 mov.b FPCR_ENABLE(%a6),%d1
12500 andi.b &0x13,%d1
12501 bne.b fdiv_ovfl_ena
12502
12503fdiv_ovfl_dis:
12504 btst &neg_bit,FPSR_CC(%a6)
12505 sne %d1
12506 mov.l L_SCR3(%a6),%d0
12507 bsr.l ovf_res
12508 or.b %d0,FPSR_CC(%a6)
12509 fmovm.x (%a0),&0x80
12510 rts
12511
12512fdiv_ovfl_ena:
12513 mov.l L_SCR3(%a6),%d1
12514 andi.b &0xc0,%d1
12515 bne.b fdiv_ovfl_ena_sd
12516
12517fdiv_ovfl_ena_cont:
12518 fmovm.x &0x80,FP_SCR0(%a6)
12519
12520 mov.l %d2,-(%sp)
12521 mov.w FP_SCR0_EX(%a6),%d1
12522 mov.w %d1,%d2
12523 andi.l &0x7fff,%d1
12524 sub.l %d0,%d1
12525 subi.l &0x6000,%d1
12526 andi.w &0x7fff,%d1
12527 andi.w &0x8000,%d2
12528 or.w %d2,%d1
12529 mov.w %d1,FP_SCR0_EX(%a6)
12530 mov.l (%sp)+,%d2
12531 fmovm.x FP_SCR0(%a6),&0x40
12532 bra.b fdiv_ovfl_dis
12533
12534fdiv_ovfl_ena_sd:
12535 fmovm.x FP_SCR1(%a6),&0x80
12536
12537 mov.l L_SCR3(%a6),%d1
12538 andi.b &0x30,%d1
12539 fmov.l %d1,%fpcr
12540
12541 fdiv.x FP_SCR0(%a6),%fp0
12542
12543 fmov.l &0x0,%fpcr
12544 bra.b fdiv_ovfl_ena_cont
12545
12546fdiv_unfl:
12547 bset &unfl_bit,FPSR_EXCEPT(%a6)
12548
12549 fmovm.x FP_SCR1(%a6),&0x80
12550
12551 fmov.l &rz_mode*0x10,%fpcr
12552 fmov.l &0x0,%fpsr
12553
12554 fdiv.x FP_SCR0(%a6),%fp0
12555
12556 fmov.l %fpsr,%d1
12557 fmov.l &0x0,%fpcr
12558
12559 or.l %d1,USER_FPSR(%a6)
12560
12561 mov.b FPCR_ENABLE(%a6),%d1
12562 andi.b &0x0b,%d1
12563 bne.b fdiv_unfl_ena
12564
12565fdiv_unfl_dis:
12566 fmovm.x &0x80,FP_SCR0(%a6)
12567
12568 lea FP_SCR0(%a6),%a0
12569 mov.l L_SCR3(%a6),%d1
12570 bsr.l unf_res
12571 or.b %d0,FPSR_CC(%a6)
12572 fmovm.x FP_SCR0(%a6),&0x80
12573 rts
12574
12575
12576
12577
12578fdiv_unfl_ena:
12579 fmovm.x FP_SCR1(%a6),&0x40
12580
12581 mov.l L_SCR3(%a6),%d1
12582 andi.b &0xc0,%d1
12583 bne.b fdiv_unfl_ena_sd
12584
12585 fmov.l L_SCR3(%a6),%fpcr
12586
12587fdiv_unfl_ena_cont:
12588 fmov.l &0x0,%fpsr
12589
12590 fdiv.x FP_SCR0(%a6),%fp1
12591
12592 fmov.l &0x0,%fpcr
12593
12594 fmovm.x &0x40,FP_SCR0(%a6)
12595 mov.l %d2,-(%sp)
12596 mov.w FP_SCR0_EX(%a6),%d1
12597 mov.l %d1,%d2
12598 andi.l &0x7fff,%d1
12599 andi.w &0x8000,%d2
12600 sub.l %d0,%d1
12601 addi.l &0x6000,%d1
12602 andi.w &0x7fff,%d1
12603 or.w %d2,%d1
12604 mov.w %d1,FP_SCR0_EX(%a6)
12605 mov.l (%sp)+,%d2
12606 fmovm.x FP_SCR0(%a6),&0x40
12607 bra.w fdiv_unfl_dis
12608
12609fdiv_unfl_ena_sd:
12610 mov.l L_SCR3(%a6),%d1
12611 andi.b &0x30,%d1
12612 fmov.l %d1,%fpcr
12613
12614 bra.b fdiv_unfl_ena_cont
12615
12616
12617
12618
12619fdiv_may_unfl:
12620 fmovm.x FP_SCR1(%a6),&0x80
12621
12622 fmov.l L_SCR3(%a6),%fpcr
12623 fmov.l &0x0,%fpsr
12624
12625 fdiv.x FP_SCR0(%a6),%fp0
12626
12627 fmov.l %fpsr,%d1
12628 fmov.l &0x0,%fpcr
12629
12630 or.l %d1,USER_FPSR(%a6)
12631
12632 fabs.x %fp0,%fp1
12633 fcmp.b %fp1,&0x1
12634 fbgt.w fdiv_normal_exit
12635 fblt.w fdiv_unfl
12636
12637
12638
12639
12640
12641
12642
12643
12644 fmovm.x FP_SCR1(%a6),&0x40
12645
12646 mov.l L_SCR3(%a6),%d1
12647 andi.b &0xc0,%d1
12648 ori.b &rz_mode*0x10,%d1
12649
12650 fmov.l %d1,%fpcr
12651 fmov.l &0x0,%fpsr
12652
12653 fdiv.x FP_SCR0(%a6),%fp1
12654
12655 fmov.l &0x0,%fpcr
12656 fabs.x %fp1
12657 fcmp.b %fp1,&0x1
12658 fbge.w fdiv_normal_exit
12659 bra.w fdiv_unfl
12660
12661
12662
12663
12664
12665
12666fdiv_not_norm:
12667 mov.w (tbl_fdiv_op.b,%pc,%d1.w*2),%d1
12668 jmp (tbl_fdiv_op.b,%pc,%d1.w*1)
12669
12670 swbeg &48
12671tbl_fdiv_op:
12672 short fdiv_norm - tbl_fdiv_op
12673 short fdiv_inf_load - tbl_fdiv_op
12674 short fdiv_zero_load - tbl_fdiv_op
12675 short fdiv_res_qnan - tbl_fdiv_op
12676 short fdiv_norm - tbl_fdiv_op
12677 short fdiv_res_snan - tbl_fdiv_op
12678 short tbl_fdiv_op - tbl_fdiv_op
12679 short tbl_fdiv_op - tbl_fdiv_op
12680
12681 short fdiv_zero_load - tbl_fdiv_op
12682 short fdiv_res_operr - tbl_fdiv_op
12683 short fdiv_zero_load - tbl_fdiv_op
12684 short fdiv_res_qnan - tbl_fdiv_op
12685 short fdiv_zero_load - tbl_fdiv_op
12686 short fdiv_res_snan - tbl_fdiv_op
12687 short tbl_fdiv_op - tbl_fdiv_op
12688 short tbl_fdiv_op - tbl_fdiv_op
12689
12690 short fdiv_inf_dst - tbl_fdiv_op
12691 short fdiv_inf_dst - tbl_fdiv_op
12692 short fdiv_res_operr - tbl_fdiv_op
12693 short fdiv_res_qnan - tbl_fdiv_op
12694 short fdiv_inf_dst - tbl_fdiv_op
12695 short fdiv_res_snan - tbl_fdiv_op
12696 short tbl_fdiv_op - tbl_fdiv_op
12697 short tbl_fdiv_op - tbl_fdiv_op
12698
12699 short fdiv_res_qnan - tbl_fdiv_op
12700 short fdiv_res_qnan - tbl_fdiv_op
12701 short fdiv_res_qnan - tbl_fdiv_op
12702 short fdiv_res_qnan - tbl_fdiv_op
12703 short fdiv_res_qnan - tbl_fdiv_op
12704 short fdiv_res_snan - tbl_fdiv_op
12705 short tbl_fdiv_op - tbl_fdiv_op
12706 short tbl_fdiv_op - tbl_fdiv_op
12707
12708 short fdiv_norm - tbl_fdiv_op
12709 short fdiv_inf_load - tbl_fdiv_op
12710 short fdiv_zero_load - tbl_fdiv_op
12711 short fdiv_res_qnan - tbl_fdiv_op
12712 short fdiv_norm - tbl_fdiv_op
12713 short fdiv_res_snan - tbl_fdiv_op
12714 short tbl_fdiv_op - tbl_fdiv_op
12715 short tbl_fdiv_op - tbl_fdiv_op
12716
12717 short fdiv_res_snan - tbl_fdiv_op
12718 short fdiv_res_snan - tbl_fdiv_op
12719 short fdiv_res_snan - tbl_fdiv_op
12720 short fdiv_res_snan - tbl_fdiv_op
12721 short fdiv_res_snan - tbl_fdiv_op
12722 short fdiv_res_snan - tbl_fdiv_op
12723 short tbl_fdiv_op - tbl_fdiv_op
12724 short tbl_fdiv_op - tbl_fdiv_op
12725
12726fdiv_res_qnan:
12727 bra.l res_qnan
12728fdiv_res_snan:
12729 bra.l res_snan
12730fdiv_res_operr:
12731 bra.l res_operr
12732
12733 global fdiv_zero_load
12734fdiv_zero_load:
12735 mov.b SRC_EX(%a0),%d0
12736 mov.b DST_EX(%a1),%d1
12737 eor.b %d0,%d1
12738 bpl.b fdiv_zero_load_p
12739 fmov.s &0x80000000,%fp0
12740 mov.b &z_bmask+neg_bmask,FPSR_CC(%a6)
12741 rts
12742fdiv_zero_load_p:
12743 fmov.s &0x00000000,%fp0
12744 mov.b &z_bmask,FPSR_CC(%a6)
12745 rts
12746
12747
12748
12749
12750
12751
12752 global fdiv_inf_load
12753fdiv_inf_load:
12754 ori.w &dz_mask+adz_mask,2+USER_FPSR(%a6)
12755 mov.b SRC_EX(%a0),%d0
12756 mov.b DST_EX(%a1),%d1
12757 eor.b %d0,%d1
12758 bpl.b fdiv_inf_load_p
12759 fmov.s &0xff800000,%fp0
12760 mov.b &inf_bmask+neg_bmask,FPSR_CC(%a6)
12761 rts
12762fdiv_inf_load_p:
12763 fmov.s &0x7f800000,%fp0
12764 mov.b &inf_bmask,FPSR_CC(%a6)
12765 rts
12766
12767
12768
12769
12770
12771
12772
12773 global fdiv_inf_dst
12774fdiv_inf_dst:
12775 mov.b DST_EX(%a1),%d0
12776 mov.b SRC_EX(%a0),%d1
12777 eor.b %d0,%d1
12778 bpl.b fdiv_inf_dst_p
12779
12780 fmovm.x DST(%a1),&0x80
12781 fabs.x %fp0
12782 fneg.x %fp0
12783 mov.b &inf_bmask+neg_bmask,FPSR_CC(%a6)
12784 rts
12785
12786fdiv_inf_dst_p:
12787 fmovm.x DST(%a1),&0x80
12788 fabs.x %fp0
12789 mov.b &inf_bmask,FPSR_CC(%a6)
12790 rts
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825 global fsneg
12826fsneg:
12827 andi.b &0x30,%d0
12828 ori.b &s_mode*0x10,%d0
12829 bra.b fneg
12830
12831 global fdneg
12832fdneg:
12833 andi.b &0x30,%d0
12834 ori.b &d_mode*0x10,%d0
12835
12836 global fneg
12837fneg:
12838 mov.l %d0,L_SCR3(%a6)
12839 mov.b STAG(%a6),%d1
12840 bne.w fneg_not_norm
12841
12842
12843
12844
12845fneg_norm:
12846 andi.b &0xc0,%d0
12847 bne.w fneg_not_ext
12848
12849
12850
12851
12852
12853
12854 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
12855 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
12856 mov.w SRC_EX(%a0),%d0
12857 eori.w &0x8000,%d0
12858 bpl.b fneg_norm_load
12859 mov.b &neg_bmask,FPSR_CC(%a6)
12860fneg_norm_load:
12861 mov.w %d0,FP_SCR0_EX(%a6)
12862 fmovm.x FP_SCR0(%a6),&0x80
12863 rts
12864
12865
12866
12867
12868
12869fneg_denorm:
12870 andi.b &0xc0,%d0
12871 bne.b fneg_not_ext
12872
12873 bset &unfl_bit,FPSR_EXCEPT(%a6)
12874
12875 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
12876 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
12877 mov.w SRC_EX(%a0),%d0
12878 eori.w &0x8000,%d0
12879 bpl.b fneg_denorm_done
12880 mov.b &neg_bmask,FPSR_CC(%a6)
12881fneg_denorm_done:
12882 mov.w %d0,FP_SCR0_EX(%a6)
12883 fmovm.x FP_SCR0(%a6),&0x80
12884
12885 btst &unfl_bit,FPCR_ENABLE(%a6)
12886 bne.b fneg_ext_unfl_ena
12887 rts
12888
12889
12890
12891
12892
12893
12894fneg_ext_unfl_ena:
12895 lea FP_SCR0(%a6),%a0
12896 bsr.l norm
12897 neg.w %d0
12898 addi.w &0x6000,%d0
12899 mov.w FP_SCR0_EX(%a6),%d1
12900 andi.w &0x8000,%d1
12901 andi.w &0x7fff,%d0
12902 or.w %d1,%d0
12903 mov.w %d0,FP_SCR0_EX(%a6)
12904 fmovm.x FP_SCR0(%a6),&0x40
12905 rts
12906
12907
12908
12909
12910fneg_not_ext:
12911 cmpi.b %d0,&s_mode*0x10
12912 bne.b fneg_dbl
12913
12914
12915
12916
12917fneg_sgl:
12918 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
12919 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
12920 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
12921 bsr.l scale_to_zero_src
12922
12923 cmpi.l %d0,&0x3fff-0x3f80
12924 bge.w fneg_sd_unfl
12925 cmpi.l %d0,&0x3fff-0x407e
12926 beq.w fneg_sd_may_ovfl
12927 blt.w fneg_sd_ovfl
12928
12929
12930
12931
12932fneg_sd_normal:
12933 fmov.l &0x0,%fpsr
12934 fmov.l L_SCR3(%a6),%fpcr
12935
12936 fneg.x FP_SCR0(%a6),%fp0
12937
12938 fmov.l %fpsr,%d1
12939 fmov.l &0x0,%fpcr
12940
12941 or.l %d1,USER_FPSR(%a6)
12942
12943fneg_sd_normal_exit:
12944 mov.l %d2,-(%sp)
12945 fmovm.x &0x80,FP_SCR0(%a6)
12946 mov.w FP_SCR0_EX(%a6),%d1
12947 mov.w %d1,%d2
12948 andi.l &0x7fff,%d1
12949 sub.l %d0,%d1
12950 andi.w &0x8000,%d2
12951 or.w %d1,%d2
12952 mov.w %d2,FP_SCR0_EX(%a6)
12953 mov.l (%sp)+,%d2
12954 fmovm.x FP_SCR0(%a6),&0x80
12955 rts
12956
12957
12958
12959
12960fneg_dbl:
12961 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
12962 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
12963 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
12964 bsr.l scale_to_zero_src
12965
12966 cmpi.l %d0,&0x3fff-0x3c00
12967 bge.b fneg_sd_unfl
12968 cmpi.l %d0,&0x3fff-0x43fe
12969 beq.w fneg_sd_may_ovfl
12970 blt.w fneg_sd_ovfl
12971 bra.w fneg_sd_normal
12972
12973
12974
12975
12976fneg_sd_unfl:
12977 bset &unfl_bit,FPSR_EXCEPT(%a6)
12978
12979 eori.b &0x80,FP_SCR0_EX(%a6)
12980 bpl.b fneg_sd_unfl_tst
12981 bset &neg_bit,FPSR_CC(%a6)
12982
12983
12984fneg_sd_unfl_tst:
12985 mov.b FPCR_ENABLE(%a6),%d1
12986 andi.b &0x0b,%d1
12987 bne.b fneg_sd_unfl_ena
12988
12989fneg_sd_unfl_dis:
12990 lea FP_SCR0(%a6),%a0
12991 mov.l L_SCR3(%a6),%d1
12992 bsr.l unf_res
12993 or.b %d0,FPSR_CC(%a6)
12994 fmovm.x FP_SCR0(%a6),&0x80
12995 rts
12996
12997
12998
12999
13000
13001fneg_sd_unfl_ena:
13002 mov.l FP_SCR0_HI(%a6),FP_SCR1_HI(%a6)
13003 mov.l FP_SCR0_LO(%a6),FP_SCR1_LO(%a6)
13004 mov.w FP_SCR0_EX(%a6),%d1
13005
13006 mov.l %d2,-(%sp)
13007 mov.l %d1,%d2
13008 andi.l &0x7fff,%d1
13009 andi.w &0x8000,%d2
13010 sub.l %d0,%d1
13011 addi.l &0x6000,%d1
13012 andi.w &0x7fff,%d1
13013 or.w %d2,%d1
13014 mov.w %d1,FP_SCR1_EX(%a6)
13015 fmovm.x FP_SCR1(%a6),&0x40
13016 mov.l (%sp)+,%d2
13017 bra.b fneg_sd_unfl_dis
13018
13019
13020
13021
13022fneg_sd_ovfl:
13023 fmov.l &0x0,%fpsr
13024 fmov.l L_SCR3(%a6),%fpcr
13025
13026 fneg.x FP_SCR0(%a6),%fp0
13027
13028 fmov.l &0x0,%fpcr
13029 fmov.l %fpsr,%d1
13030
13031 or.l %d1,USER_FPSR(%a6)
13032
13033fneg_sd_ovfl_tst:
13034 or.l &ovfl_inx_mask,USER_FPSR(%a6)
13035
13036 mov.b FPCR_ENABLE(%a6),%d1
13037 andi.b &0x13,%d1
13038 bne.b fneg_sd_ovfl_ena
13039
13040
13041
13042
13043
13044fneg_sd_ovfl_dis:
13045 btst &neg_bit,FPSR_CC(%a6)
13046 sne %d1
13047 mov.l L_SCR3(%a6),%d0
13048 bsr.l ovf_res
13049 or.b %d0,FPSR_CC(%a6)
13050 fmovm.x (%a0),&0x80
13051 rts
13052
13053
13054
13055
13056
13057
13058fneg_sd_ovfl_ena:
13059 mov.l %d2,-(%sp)
13060 mov.w FP_SCR0_EX(%a6),%d1
13061 mov.l %d1,%d2
13062 andi.l &0x7fff,%d1
13063 andi.w &0x8000,%d2
13064 sub.l %d0,%d1
13065 subi.l &0x6000,%d1
13066 andi.w &0x7fff,%d1
13067 or.w %d2,%d1
13068 mov.w %d1,FP_SCR0_EX(%a6)
13069 fmovm.x FP_SCR0(%a6),&0x40
13070 mov.l (%sp)+,%d2
13071 bra.b fneg_sd_ovfl_dis
13072
13073
13074
13075
13076fneg_sd_may_ovfl:
13077 fmov.l &0x0,%fpsr
13078 fmov.l L_SCR3(%a6),%fpcr
13079
13080 fneg.x FP_SCR0(%a6),%fp0
13081
13082 fmov.l %fpsr,%d1
13083 fmov.l &0x0,%fpcr
13084
13085 or.l %d1,USER_FPSR(%a6)
13086
13087 fabs.x %fp0,%fp1
13088 fcmp.b %fp1,&0x2
13089 fbge.w fneg_sd_ovfl_tst
13090
13091
13092 bra.w fneg_sd_normal_exit
13093
13094
13095
13096
13097
13098
13099fneg_not_norm:
13100 cmpi.b %d1,&DENORM
13101 beq.w fneg_denorm
13102 cmpi.b %d1,&SNAN
13103 beq.l res_snan_1op
13104 cmpi.b %d1,&QNAN
13105 beq.l res_qnan_1op
13106
13107
13108
13109
13110
13111
13112 fneg.x SRC_EX(%a0),%fp0
13113 fmov.l %fpsr,%d0
13114 rol.l &0x8,%d0
13115 mov.b %d0,FPSR_CC(%a6)
13116 rts
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137 global ftst
13138ftst:
13139 mov.b STAG(%a6),%d1
13140 bne.b ftst_not_norm
13141
13142
13143
13144
13145ftst_norm:
13146 tst.b SRC_EX(%a0)
13147 bmi.b ftst_norm_m
13148 rts
13149ftst_norm_m:
13150 mov.b &neg_bmask,FPSR_CC(%a6)
13151 rts
13152
13153
13154
13155
13156ftst_not_norm:
13157 cmpi.b %d1,&ZERO
13158 beq.b ftst_zero
13159 cmpi.b %d1,&INF
13160 beq.b ftst_inf
13161 cmpi.b %d1,&SNAN
13162 beq.l res_snan_1op
13163 cmpi.b %d1,&QNAN
13164 beq.l res_qnan_1op
13165
13166
13167
13168
13169ftst_denorm:
13170 tst.b SRC_EX(%a0)
13171 bmi.b ftst_denorm_m
13172 rts
13173ftst_denorm_m:
13174 mov.b &neg_bmask,FPSR_CC(%a6)
13175 rts
13176
13177
13178
13179
13180ftst_inf:
13181 tst.b SRC_EX(%a0)
13182 bmi.b ftst_inf_m
13183ftst_inf_p:
13184 mov.b &inf_bmask,FPSR_CC(%a6)
13185 rts
13186ftst_inf_m:
13187 mov.b &inf_bmask+neg_bmask,FPSR_CC(%a6)
13188 rts
13189
13190
13191
13192
13193ftst_zero:
13194 tst.b SRC_EX(%a0)
13195 bmi.b ftst_zero_m
13196ftst_zero_p:
13197 mov.b &z_bmask,FPSR_CC(%a6)
13198 rts
13199ftst_zero_m:
13200 mov.b &z_bmask+neg_bmask,FPSR_CC(%a6)
13201 rts
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229 global fint
13230fint:
13231 mov.b STAG(%a6),%d1
13232 bne.b fint_not_norm
13233
13234
13235
13236
13237fint_norm:
13238 andi.b &0x30,%d0
13239
13240 fmov.l %d0,%fpcr
13241 fmov.l &0x0,%fpsr
13242
13243 fint.x SRC(%a0),%fp0
13244
13245 fmov.l &0x0,%fpcr
13246 fmov.l %fpsr,%d0
13247 or.l %d0,USER_FPSR(%a6)
13248
13249 rts
13250
13251
13252
13253
13254fint_not_norm:
13255 cmpi.b %d1,&ZERO
13256 beq.b fint_zero
13257 cmpi.b %d1,&INF
13258 beq.b fint_inf
13259 cmpi.b %d1,&DENORM
13260 beq.b fint_denorm
13261 cmpi.b %d1,&SNAN
13262 beq.l res_snan_1op
13263 bra.l res_qnan_1op
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274fint_denorm:
13275 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
13276 mov.b &0x80,FP_SCR0_HI(%a6)
13277 lea FP_SCR0(%a6),%a0
13278 bra.b fint_norm
13279
13280
13281
13282
13283fint_zero:
13284 tst.b SRC_EX(%a0)
13285 bmi.b fint_zero_m
13286fint_zero_p:
13287 fmov.s &0x00000000,%fp0
13288 mov.b &z_bmask,FPSR_CC(%a6)
13289 rts
13290fint_zero_m:
13291 fmov.s &0x80000000,%fp0
13292 mov.b &z_bmask+neg_bmask,FPSR_CC(%a6)
13293 rts
13294
13295
13296
13297
13298fint_inf:
13299 fmovm.x SRC(%a0),&0x80
13300 tst.b SRC_EX(%a0)
13301 bmi.b fint_inf_m
13302fint_inf_p:
13303 mov.b &inf_bmask,FPSR_CC(%a6)
13304 rts
13305fint_inf_m:
13306 mov.b &inf_bmask+neg_bmask,FPSR_CC(%a6)
13307 rts
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335 global fintrz
13336fintrz:
13337 mov.b STAG(%a6),%d1
13338 bne.b fintrz_not_norm
13339
13340
13341
13342
13343fintrz_norm:
13344 fmov.l &0x0,%fpsr
13345
13346 fintrz.x SRC(%a0),%fp0
13347
13348 fmov.l %fpsr,%d0
13349 or.l %d0,USER_FPSR(%a6)
13350
13351 rts
13352
13353
13354
13355
13356fintrz_not_norm:
13357 cmpi.b %d1,&ZERO
13358 beq.b fintrz_zero
13359 cmpi.b %d1,&INF
13360 beq.b fintrz_inf
13361 cmpi.b %d1,&DENORM
13362 beq.b fintrz_denorm
13363 cmpi.b %d1,&SNAN
13364 beq.l res_snan_1op
13365 bra.l res_qnan_1op
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376fintrz_denorm:
13377 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
13378 mov.b &0x80,FP_SCR0_HI(%a6)
13379 lea FP_SCR0(%a6),%a0
13380 bra.b fintrz_norm
13381
13382
13383
13384
13385fintrz_zero:
13386 tst.b SRC_EX(%a0)
13387 bmi.b fintrz_zero_m
13388fintrz_zero_p:
13389 fmov.s &0x00000000,%fp0
13390 mov.b &z_bmask,FPSR_CC(%a6)
13391 rts
13392fintrz_zero_m:
13393 fmov.s &0x80000000,%fp0
13394 mov.b &z_bmask+neg_bmask,FPSR_CC(%a6)
13395 rts
13396
13397
13398
13399
13400fintrz_inf:
13401 fmovm.x SRC(%a0),&0x80
13402 tst.b SRC_EX(%a0)
13403 bmi.b fintrz_inf_m
13404fintrz_inf_p:
13405 mov.b &inf_bmask,FPSR_CC(%a6)
13406 rts
13407fintrz_inf_m:
13408 mov.b &inf_bmask+neg_bmask,FPSR_CC(%a6)
13409 rts
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448 global fsabs
13449fsabs:
13450 andi.b &0x30,%d0
13451 ori.b &s_mode*0x10,%d0
13452 bra.b fabs
13453
13454 global fdabs
13455fdabs:
13456 andi.b &0x30,%d0
13457 ori.b &d_mode*0x10,%d0
13458
13459 global fabs
13460fabs:
13461 mov.l %d0,L_SCR3(%a6)
13462 mov.b STAG(%a6),%d1
13463 bne.w fabs_not_norm
13464
13465
13466
13467
13468fabs_norm:
13469 andi.b &0xc0,%d0
13470 bne.b fabs_not_ext
13471
13472
13473
13474
13475
13476
13477 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
13478 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
13479 mov.w SRC_EX(%a0),%d1
13480 bclr &15,%d1
13481 mov.w %d1,FP_SCR0_EX(%a6)
13482 fmovm.x FP_SCR0(%a6),&0x80
13483 rts
13484
13485
13486
13487
13488
13489fabs_denorm:
13490 andi.b &0xc0,%d0
13491 bne.b fabs_not_ext
13492
13493 bset &unfl_bit,FPSR_EXCEPT(%a6)
13494
13495 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
13496 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
13497 mov.w SRC_EX(%a0),%d0
13498 bclr &15,%d0
13499 mov.w %d0,FP_SCR0_EX(%a6)
13500
13501 fmovm.x FP_SCR0(%a6),&0x80
13502
13503 btst &unfl_bit,FPCR_ENABLE(%a6)
13504 bne.b fabs_ext_unfl_ena
13505 rts
13506
13507
13508
13509
13510
13511
13512fabs_ext_unfl_ena:
13513 lea FP_SCR0(%a6),%a0
13514 bsr.l norm
13515 neg.w %d0
13516 addi.w &0x6000,%d0
13517 mov.w FP_SCR0_EX(%a6),%d1
13518 andi.w &0x8000,%d1
13519 andi.w &0x7fff,%d0
13520 or.w %d1,%d0
13521 mov.w %d0,FP_SCR0_EX(%a6)
13522 fmovm.x FP_SCR0(%a6),&0x40
13523 rts
13524
13525
13526
13527
13528fabs_not_ext:
13529 cmpi.b %d0,&s_mode*0x10
13530 bne.b fabs_dbl
13531
13532
13533
13534
13535fabs_sgl:
13536 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
13537 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
13538 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
13539 bsr.l scale_to_zero_src
13540
13541 cmpi.l %d0,&0x3fff-0x3f80
13542 bge.w fabs_sd_unfl
13543 cmpi.l %d0,&0x3fff-0x407e
13544 beq.w fabs_sd_may_ovfl
13545 blt.w fabs_sd_ovfl
13546
13547
13548
13549
13550fabs_sd_normal:
13551 fmov.l &0x0,%fpsr
13552 fmov.l L_SCR3(%a6),%fpcr
13553
13554 fabs.x FP_SCR0(%a6),%fp0
13555
13556 fmov.l %fpsr,%d1
13557 fmov.l &0x0,%fpcr
13558
13559 or.l %d1,USER_FPSR(%a6)
13560
13561fabs_sd_normal_exit:
13562 mov.l %d2,-(%sp)
13563 fmovm.x &0x80,FP_SCR0(%a6)
13564 mov.w FP_SCR0_EX(%a6),%d1
13565 mov.l %d1,%d2
13566 andi.l &0x7fff,%d1
13567 sub.l %d0,%d1
13568 andi.w &0x8000,%d2
13569 or.w %d1,%d2
13570 mov.w %d2,FP_SCR0_EX(%a6)
13571 mov.l (%sp)+,%d2
13572 fmovm.x FP_SCR0(%a6),&0x80
13573 rts
13574
13575
13576
13577
13578fabs_dbl:
13579 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
13580 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
13581 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
13582 bsr.l scale_to_zero_src
13583
13584 cmpi.l %d0,&0x3fff-0x3c00
13585 bge.b fabs_sd_unfl
13586 cmpi.l %d0,&0x3fff-0x43fe
13587 beq.w fabs_sd_may_ovfl
13588 blt.w fabs_sd_ovfl
13589 bra.w fabs_sd_normal
13590
13591
13592
13593
13594fabs_sd_unfl:
13595 bset &unfl_bit,FPSR_EXCEPT(%a6)
13596
13597 bclr &0x7,FP_SCR0_EX(%a6)
13598
13599
13600 mov.b FPCR_ENABLE(%a6),%d1
13601 andi.b &0x0b,%d1
13602 bne.b fabs_sd_unfl_ena
13603
13604fabs_sd_unfl_dis:
13605 lea FP_SCR0(%a6),%a0
13606 mov.l L_SCR3(%a6),%d1
13607 bsr.l unf_res
13608 or.b %d0,FPSR_CC(%a6)
13609 fmovm.x FP_SCR0(%a6),&0x80
13610 rts
13611
13612
13613
13614
13615
13616fabs_sd_unfl_ena:
13617 mov.l FP_SCR0_HI(%a6),FP_SCR1_HI(%a6)
13618 mov.l FP_SCR0_LO(%a6),FP_SCR1_LO(%a6)
13619 mov.w FP_SCR0_EX(%a6),%d1
13620
13621 mov.l %d2,-(%sp)
13622 mov.l %d1,%d2
13623 andi.l &0x7fff,%d1
13624 andi.w &0x8000,%d2
13625 sub.l %d0,%d1
13626 addi.l &0x6000,%d1
13627 andi.w &0x7fff,%d1
13628 or.w %d2,%d1
13629 mov.w %d1,FP_SCR1_EX(%a6)
13630 fmovm.x FP_SCR1(%a6),&0x40
13631 mov.l (%sp)+,%d2
13632 bra.b fabs_sd_unfl_dis
13633
13634
13635
13636
13637fabs_sd_ovfl:
13638 fmov.l &0x0,%fpsr
13639 fmov.l L_SCR3(%a6),%fpcr
13640
13641 fabs.x FP_SCR0(%a6),%fp0
13642
13643 fmov.l &0x0,%fpcr
13644 fmov.l %fpsr,%d1
13645
13646 or.l %d1,USER_FPSR(%a6)
13647
13648fabs_sd_ovfl_tst:
13649 or.l &ovfl_inx_mask,USER_FPSR(%a6)
13650
13651 mov.b FPCR_ENABLE(%a6),%d1
13652 andi.b &0x13,%d1
13653 bne.b fabs_sd_ovfl_ena
13654
13655
13656
13657
13658
13659fabs_sd_ovfl_dis:
13660 btst &neg_bit,FPSR_CC(%a6)
13661 sne %d1
13662 mov.l L_SCR3(%a6),%d0
13663 bsr.l ovf_res
13664 or.b %d0,FPSR_CC(%a6)
13665 fmovm.x (%a0),&0x80
13666 rts
13667
13668
13669
13670
13671
13672
13673fabs_sd_ovfl_ena:
13674 mov.l %d2,-(%sp)
13675 mov.w FP_SCR0_EX(%a6),%d1
13676 mov.l %d1,%d2
13677 andi.l &0x7fff,%d1
13678 andi.w &0x8000,%d2
13679 sub.l %d0,%d1
13680 subi.l &0x6000,%d1
13681 andi.w &0x7fff,%d1
13682 or.w %d2,%d1
13683 mov.w %d1,FP_SCR0_EX(%a6)
13684 fmovm.x FP_SCR0(%a6),&0x40
13685 mov.l (%sp)+,%d2
13686 bra.b fabs_sd_ovfl_dis
13687
13688
13689
13690
13691fabs_sd_may_ovfl:
13692 fmov.l &0x0,%fpsr
13693 fmov.l L_SCR3(%a6),%fpcr
13694
13695 fabs.x FP_SCR0(%a6),%fp0
13696
13697 fmov.l %fpsr,%d1
13698 fmov.l &0x0,%fpcr
13699
13700 or.l %d1,USER_FPSR(%a6)
13701
13702 fabs.x %fp0,%fp1
13703 fcmp.b %fp1,&0x2
13704 fbge.w fabs_sd_ovfl_tst
13705
13706
13707 bra.w fabs_sd_normal_exit
13708
13709
13710
13711
13712
13713
13714fabs_not_norm:
13715 cmpi.b %d1,&DENORM
13716 beq.w fabs_denorm
13717 cmpi.b %d1,&SNAN
13718 beq.l res_snan_1op
13719 cmpi.b %d1,&QNAN
13720 beq.l res_qnan_1op
13721
13722 fabs.x SRC(%a0),%fp0
13723
13724 cmpi.b %d1,&INF
13725 beq.b fabs_inf
13726fabs_zero:
13727 mov.b &z_bmask,FPSR_CC(%a6)
13728 rts
13729fabs_inf:
13730 mov.b &inf_bmask,FPSR_CC(%a6)
13731 rts
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756 global fcmp
13757fcmp:
13758 clr.w %d1
13759 mov.b DTAG(%a6),%d1
13760 lsl.b &0x3,%d1
13761 or.b STAG(%a6),%d1
13762 bne.b fcmp_not_norm
13763
13764
13765
13766
13767fcmp_norm:
13768 fmovm.x DST(%a1),&0x80
13769
13770 fcmp.x %fp0,SRC(%a0)
13771
13772 fmov.l %fpsr,%d0
13773 rol.l &0x8,%d0
13774 mov.b %d0,FPSR_CC(%a6)
13775
13776 rts
13777
13778
13779
13780
13781fcmp_not_norm:
13782 mov.w (tbl_fcmp_op.b,%pc,%d1.w*2),%d1
13783 jmp (tbl_fcmp_op.b,%pc,%d1.w*1)
13784
13785 swbeg &48
13786tbl_fcmp_op:
13787 short fcmp_norm - tbl_fcmp_op
13788 short fcmp_norm - tbl_fcmp_op
13789 short fcmp_norm - tbl_fcmp_op
13790 short fcmp_res_qnan - tbl_fcmp_op
13791 short fcmp_nrm_dnrm - tbl_fcmp_op
13792 short fcmp_res_snan - tbl_fcmp_op
13793 short tbl_fcmp_op - tbl_fcmp_op
13794 short tbl_fcmp_op - tbl_fcmp_op
13795
13796 short fcmp_norm - tbl_fcmp_op
13797 short fcmp_norm - tbl_fcmp_op
13798 short fcmp_norm - tbl_fcmp_op
13799 short fcmp_res_qnan - tbl_fcmp_op
13800 short fcmp_dnrm_s - tbl_fcmp_op
13801 short fcmp_res_snan - tbl_fcmp_op
13802 short tbl_fcmp_op - tbl_fcmp_op
13803 short tbl_fcmp_op - tbl_fcmp_op
13804
13805 short fcmp_norm - tbl_fcmp_op
13806 short fcmp_norm - tbl_fcmp_op
13807 short fcmp_norm - tbl_fcmp_op
13808 short fcmp_res_qnan - tbl_fcmp_op
13809 short fcmp_dnrm_s - tbl_fcmp_op
13810 short fcmp_res_snan - tbl_fcmp_op
13811 short tbl_fcmp_op - tbl_fcmp_op
13812 short tbl_fcmp_op - tbl_fcmp_op
13813
13814 short fcmp_res_qnan - tbl_fcmp_op
13815 short fcmp_res_qnan - tbl_fcmp_op
13816 short fcmp_res_qnan - tbl_fcmp_op
13817 short fcmp_res_qnan - tbl_fcmp_op
13818 short fcmp_res_qnan - tbl_fcmp_op
13819 short fcmp_res_snan - tbl_fcmp_op
13820 short tbl_fcmp_op - tbl_fcmp_op
13821 short tbl_fcmp_op - tbl_fcmp_op
13822
13823 short fcmp_dnrm_nrm - tbl_fcmp_op
13824 short fcmp_dnrm_d - tbl_fcmp_op
13825 short fcmp_dnrm_d - tbl_fcmp_op
13826 short fcmp_res_qnan - tbl_fcmp_op
13827 short fcmp_dnrm_sd - tbl_fcmp_op
13828 short fcmp_res_snan - tbl_fcmp_op
13829 short tbl_fcmp_op - tbl_fcmp_op
13830 short tbl_fcmp_op - tbl_fcmp_op
13831
13832 short fcmp_res_snan - tbl_fcmp_op
13833 short fcmp_res_snan - tbl_fcmp_op
13834 short fcmp_res_snan - tbl_fcmp_op
13835 short fcmp_res_snan - tbl_fcmp_op
13836 short fcmp_res_snan - tbl_fcmp_op
13837 short fcmp_res_snan - tbl_fcmp_op
13838 short tbl_fcmp_op - tbl_fcmp_op
13839 short tbl_fcmp_op - tbl_fcmp_op
13840
13841
13842
13843fcmp_res_qnan:
13844 bsr.l res_qnan
13845 andi.b &0xf7,FPSR_CC(%a6)
13846 rts
13847fcmp_res_snan:
13848 bsr.l res_snan
13849 andi.b &0xf7,FPSR_CC(%a6)
13850 rts
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864fcmp_dnrm_s:
13865 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
13866 mov.l SRC_HI(%a0),%d0
13867 bset &31,%d0
13868 mov.l %d0,FP_SCR0_HI(%a6)
13869 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
13870 lea FP_SCR0(%a6),%a0
13871 bra.w fcmp_norm
13872
13873fcmp_dnrm_d:
13874 mov.l DST_EX(%a1),FP_SCR0_EX(%a6)
13875 mov.l DST_HI(%a1),%d0
13876 bset &31,%d0
13877 mov.l %d0,FP_SCR0_HI(%a6)
13878 mov.l DST_LO(%a1),FP_SCR0_LO(%a6)
13879 lea FP_SCR0(%a6),%a1
13880 bra.w fcmp_norm
13881
13882fcmp_dnrm_sd:
13883 mov.w DST_EX(%a1),FP_SCR1_EX(%a6)
13884 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
13885 mov.l DST_HI(%a1),%d0
13886 bset &31,%d0
13887 mov.l %d0,FP_SCR1_HI(%a6)
13888 mov.l SRC_HI(%a0),%d0
13889 bset &31,%d0
13890 mov.l %d0,FP_SCR0_HI(%a6)
13891 mov.l DST_LO(%a1),FP_SCR1_LO(%a6)
13892 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
13893 lea FP_SCR1(%a6),%a1
13894 lea FP_SCR0(%a6),%a0
13895 bra.w fcmp_norm
13896
13897fcmp_nrm_dnrm:
13898 mov.b SRC_EX(%a0),%d0
13899 mov.b DST_EX(%a1),%d1
13900 eor.b %d0,%d1
13901 bmi.w fcmp_dnrm_s
13902
13903
13904 tst.b %d0
13905 bmi.b fcmp_nrm_dnrm_m
13906 rts
13907fcmp_nrm_dnrm_m:
13908 mov.b &neg_bmask,FPSR_CC(%a6)
13909 rts
13910
13911fcmp_dnrm_nrm:
13912 mov.b SRC_EX(%a0),%d0
13913 mov.b DST_EX(%a1),%d1
13914 eor.b %d0,%d1
13915 bmi.w fcmp_dnrm_d
13916
13917
13918 tst.b %d0
13919 bpl.b fcmp_dnrm_nrm_m
13920 rts
13921fcmp_dnrm_nrm_m:
13922 mov.b &neg_bmask,FPSR_CC(%a6)
13923 rts
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958 global fsglmul
13959fsglmul:
13960 mov.l %d0,L_SCR3(%a6)
13961
13962 clr.w %d1
13963 mov.b DTAG(%a6),%d1
13964 lsl.b &0x3,%d1
13965 or.b STAG(%a6),%d1
13966
13967 bne.w fsglmul_not_norm
13968
13969fsglmul_norm:
13970 mov.w DST_EX(%a1),FP_SCR1_EX(%a6)
13971 mov.l DST_HI(%a1),FP_SCR1_HI(%a6)
13972 mov.l DST_LO(%a1),FP_SCR1_LO(%a6)
13973
13974 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
13975 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
13976 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
13977
13978 bsr.l scale_to_zero_src
13979 mov.l %d0,-(%sp)
13980
13981 bsr.l scale_to_zero_dst
13982
13983 add.l (%sp)+,%d0
13984
13985 cmpi.l %d0,&0x3fff-0x7ffe
13986 beq.w fsglmul_may_ovfl
13987 blt.w fsglmul_ovfl
13988
13989 cmpi.l %d0,&0x3fff+0x0001
13990 beq.w fsglmul_may_unfl
13991 bgt.w fsglmul_unfl
13992
13993fsglmul_normal:
13994 fmovm.x FP_SCR1(%a6),&0x80
13995
13996 fmov.l L_SCR3(%a6),%fpcr
13997 fmov.l &0x0,%fpsr
13998
13999 fsglmul.x FP_SCR0(%a6),%fp0
14000
14001 fmov.l %fpsr,%d1
14002 fmov.l &0x0,%fpcr
14003
14004 or.l %d1,USER_FPSR(%a6)
14005
14006fsglmul_normal_exit:
14007 fmovm.x &0x80,FP_SCR0(%a6)
14008 mov.l %d2,-(%sp)
14009 mov.w FP_SCR0_EX(%a6),%d1
14010 mov.l %d1,%d2
14011 andi.l &0x7fff,%d1
14012 andi.w &0x8000,%d2
14013 sub.l %d0,%d1
14014 or.w %d2,%d1
14015 mov.w %d1,FP_SCR0_EX(%a6)
14016 mov.l (%sp)+,%d2
14017 fmovm.x FP_SCR0(%a6),&0x80
14018 rts
14019
14020fsglmul_ovfl:
14021 fmovm.x FP_SCR1(%a6),&0x80
14022
14023 fmov.l L_SCR3(%a6),%fpcr
14024 fmov.l &0x0,%fpsr
14025
14026 fsglmul.x FP_SCR0(%a6),%fp0
14027
14028 fmov.l %fpsr,%d1
14029 fmov.l &0x0,%fpcr
14030
14031 or.l %d1,USER_FPSR(%a6)
14032
14033fsglmul_ovfl_tst:
14034
14035
14036 or.l &ovfl_inx_mask, USER_FPSR(%a6)
14037
14038 mov.b FPCR_ENABLE(%a6),%d1
14039 andi.b &0x13,%d1
14040 bne.b fsglmul_ovfl_ena
14041
14042fsglmul_ovfl_dis:
14043 btst &neg_bit,FPSR_CC(%a6)
14044 sne %d1
14045 mov.l L_SCR3(%a6),%d0
14046 andi.b &0x30,%d0
14047 bsr.l ovf_res
14048 or.b %d0,FPSR_CC(%a6)
14049 fmovm.x (%a0),&0x80
14050 rts
14051
14052fsglmul_ovfl_ena:
14053 fmovm.x &0x80,FP_SCR0(%a6)
14054
14055 mov.l %d2,-(%sp)
14056 mov.w FP_SCR0_EX(%a6),%d1
14057 mov.l %d1,%d2
14058 andi.l &0x7fff,%d1
14059 sub.l %d0,%d1
14060 subi.l &0x6000,%d1
14061 andi.w &0x7fff,%d1
14062 andi.w &0x8000,%d2
14063 or.w %d2,%d1
14064 mov.w %d1,FP_SCR0_EX(%a6)
14065 mov.l (%sp)+,%d2
14066 fmovm.x FP_SCR0(%a6),&0x40
14067 bra.b fsglmul_ovfl_dis
14068
14069fsglmul_may_ovfl:
14070 fmovm.x FP_SCR1(%a6),&0x80
14071
14072 fmov.l L_SCR3(%a6),%fpcr
14073 fmov.l &0x0,%fpsr
14074
14075 fsglmul.x FP_SCR0(%a6),%fp0
14076
14077 fmov.l %fpsr,%d1
14078 fmov.l &0x0,%fpcr
14079
14080 or.l %d1,USER_FPSR(%a6)
14081
14082 fabs.x %fp0,%fp1
14083 fcmp.b %fp1,&0x2
14084 fbge.w fsglmul_ovfl_tst
14085
14086
14087 bra.w fsglmul_normal_exit
14088
14089fsglmul_unfl:
14090 bset &unfl_bit,FPSR_EXCEPT(%a6)
14091
14092 fmovm.x FP_SCR1(%a6),&0x80
14093
14094 fmov.l &rz_mode*0x10,%fpcr
14095 fmov.l &0x0,%fpsr
14096
14097 fsglmul.x FP_SCR0(%a6),%fp0
14098
14099 fmov.l %fpsr,%d1
14100 fmov.l &0x0,%fpcr
14101
14102 or.l %d1,USER_FPSR(%a6)
14103
14104 mov.b FPCR_ENABLE(%a6),%d1
14105 andi.b &0x0b,%d1
14106 bne.b fsglmul_unfl_ena
14107
14108fsglmul_unfl_dis:
14109 fmovm.x &0x80,FP_SCR0(%a6)
14110
14111 lea FP_SCR0(%a6),%a0
14112 mov.l L_SCR3(%a6),%d1
14113 bsr.l unf_res4
14114 or.b %d0,FPSR_CC(%a6)
14115 fmovm.x FP_SCR0(%a6),&0x80
14116 rts
14117
14118
14119
14120
14121fsglmul_unfl_ena:
14122 fmovm.x FP_SCR1(%a6),&0x40
14123
14124 fmov.l L_SCR3(%a6),%fpcr
14125 fmov.l &0x0,%fpsr
14126
14127 fsglmul.x FP_SCR0(%a6),%fp1
14128
14129 fmov.l &0x0,%fpcr
14130
14131 fmovm.x &0x40,FP_SCR0(%a6)
14132 mov.l %d2,-(%sp)
14133 mov.w FP_SCR0_EX(%a6),%d1
14134 mov.l %d1,%d2
14135 andi.l &0x7fff,%d1
14136 andi.w &0x8000,%d2
14137 sub.l %d0,%d1
14138 addi.l &0x6000,%d1
14139 andi.w &0x7fff,%d1
14140 or.w %d2,%d1
14141 mov.w %d1,FP_SCR0_EX(%a6)
14142 mov.l (%sp)+,%d2
14143 fmovm.x FP_SCR0(%a6),&0x40
14144 bra.w fsglmul_unfl_dis
14145
14146fsglmul_may_unfl:
14147 fmovm.x FP_SCR1(%a6),&0x80
14148
14149 fmov.l L_SCR3(%a6),%fpcr
14150 fmov.l &0x0,%fpsr
14151
14152 fsglmul.x FP_SCR0(%a6),%fp0
14153
14154 fmov.l %fpsr,%d1
14155 fmov.l &0x0,%fpcr
14156
14157 or.l %d1,USER_FPSR(%a6)
14158
14159 fabs.x %fp0,%fp1
14160 fcmp.b %fp1,&0x2
14161 fbgt.w fsglmul_normal_exit
14162 fblt.w fsglmul_unfl
14163
14164
14165
14166
14167
14168
14169
14170
14171 fmovm.x FP_SCR1(%a6),&0x40
14172
14173 mov.l L_SCR3(%a6),%d1
14174 andi.b &0xc0,%d1
14175 ori.b &rz_mode*0x10,%d1
14176
14177 fmov.l %d1,%fpcr
14178 fmov.l &0x0,%fpsr
14179
14180 fsglmul.x FP_SCR0(%a6),%fp1
14181
14182 fmov.l &0x0,%fpcr
14183 fabs.x %fp1
14184 fcmp.b %fp1,&0x2
14185 fbge.w fsglmul_normal_exit
14186 bra.w fsglmul_unfl
14187
14188
14189
14190
14191
14192
14193fsglmul_not_norm:
14194 mov.w (tbl_fsglmul_op.b,%pc,%d1.w*2),%d1
14195 jmp (tbl_fsglmul_op.b,%pc,%d1.w*1)
14196
14197 swbeg &48
14198tbl_fsglmul_op:
14199 short fsglmul_norm - tbl_fsglmul_op
14200 short fsglmul_zero - tbl_fsglmul_op
14201 short fsglmul_inf_src - tbl_fsglmul_op
14202 short fsglmul_res_qnan - tbl_fsglmul_op
14203 short fsglmul_norm - tbl_fsglmul_op
14204 short fsglmul_res_snan - tbl_fsglmul_op
14205 short tbl_fsglmul_op - tbl_fsglmul_op
14206 short tbl_fsglmul_op - tbl_fsglmul_op
14207
14208 short fsglmul_zero - tbl_fsglmul_op
14209 short fsglmul_zero - tbl_fsglmul_op
14210 short fsglmul_res_operr - tbl_fsglmul_op
14211 short fsglmul_res_qnan - tbl_fsglmul_op
14212 short fsglmul_zero - tbl_fsglmul_op
14213 short fsglmul_res_snan - tbl_fsglmul_op
14214 short tbl_fsglmul_op - tbl_fsglmul_op
14215 short tbl_fsglmul_op - tbl_fsglmul_op
14216
14217 short fsglmul_inf_dst - tbl_fsglmul_op
14218 short fsglmul_res_operr - tbl_fsglmul_op
14219 short fsglmul_inf_dst - tbl_fsglmul_op
14220 short fsglmul_res_qnan - tbl_fsglmul_op
14221 short fsglmul_inf_dst - tbl_fsglmul_op
14222 short fsglmul_res_snan - tbl_fsglmul_op
14223 short tbl_fsglmul_op - tbl_fsglmul_op
14224 short tbl_fsglmul_op - tbl_fsglmul_op
14225
14226 short fsglmul_res_qnan - tbl_fsglmul_op
14227 short fsglmul_res_qnan - tbl_fsglmul_op
14228 short fsglmul_res_qnan - tbl_fsglmul_op
14229 short fsglmul_res_qnan - tbl_fsglmul_op
14230 short fsglmul_res_qnan - tbl_fsglmul_op
14231 short fsglmul_res_snan - tbl_fsglmul_op
14232 short tbl_fsglmul_op - tbl_fsglmul_op
14233 short tbl_fsglmul_op - tbl_fsglmul_op
14234
14235 short fsglmul_norm - tbl_fsglmul_op
14236 short fsglmul_zero - tbl_fsglmul_op
14237 short fsglmul_inf_src - tbl_fsglmul_op
14238 short fsglmul_res_qnan - tbl_fsglmul_op
14239 short fsglmul_norm - tbl_fsglmul_op
14240 short fsglmul_res_snan - tbl_fsglmul_op
14241 short tbl_fsglmul_op - tbl_fsglmul_op
14242 short tbl_fsglmul_op - tbl_fsglmul_op
14243
14244 short fsglmul_res_snan - tbl_fsglmul_op
14245 short fsglmul_res_snan - tbl_fsglmul_op
14246 short fsglmul_res_snan - tbl_fsglmul_op
14247 short fsglmul_res_snan - tbl_fsglmul_op
14248 short fsglmul_res_snan - tbl_fsglmul_op
14249 short fsglmul_res_snan - tbl_fsglmul_op
14250 short tbl_fsglmul_op - tbl_fsglmul_op
14251 short tbl_fsglmul_op - tbl_fsglmul_op
14252
14253fsglmul_res_operr:
14254 bra.l res_operr
14255fsglmul_res_snan:
14256 bra.l res_snan
14257fsglmul_res_qnan:
14258 bra.l res_qnan
14259fsglmul_zero:
14260 bra.l fmul_zero
14261fsglmul_inf_src:
14262 bra.l fmul_inf_src
14263fsglmul_inf_dst:
14264 bra.l fmul_inf_dst
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299 global fsgldiv
14300fsgldiv:
14301 mov.l %d0,L_SCR3(%a6)
14302
14303 clr.w %d1
14304 mov.b DTAG(%a6),%d1
14305 lsl.b &0x3,%d1
14306 or.b STAG(%a6),%d1
14307
14308 bne.w fsgldiv_not_norm
14309
14310
14311
14312
14313fsgldiv_norm:
14314 mov.w DST_EX(%a1),FP_SCR1_EX(%a6)
14315 mov.l DST_HI(%a1),FP_SCR1_HI(%a6)
14316 mov.l DST_LO(%a1),FP_SCR1_LO(%a6)
14317
14318 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
14319 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
14320 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
14321
14322 bsr.l scale_to_zero_src
14323 mov.l %d0,-(%sp)
14324
14325 bsr.l scale_to_zero_dst
14326
14327 neg.l (%sp)
14328 add.l %d0,(%sp)
14329
14330 mov.w 2+L_SCR3(%a6),%d1
14331 lsr.b &0x6,%d1
14332 mov.l (%sp)+,%d0
14333 cmpi.l %d0,&0x3fff-0x7ffe
14334 ble.w fsgldiv_may_ovfl
14335
14336 cmpi.l %d0,&0x3fff-0x0000
14337 beq.w fsgldiv_may_unfl
14338 bgt.w fsgldiv_unfl
14339
14340fsgldiv_normal:
14341 fmovm.x FP_SCR1(%a6),&0x80
14342
14343 fmov.l L_SCR3(%a6),%fpcr
14344 fmov.l &0x0,%fpsr
14345
14346 fsgldiv.x FP_SCR0(%a6),%fp0
14347
14348 fmov.l %fpsr,%d1
14349 fmov.l &0x0,%fpcr
14350
14351 or.l %d1,USER_FPSR(%a6)
14352
14353fsgldiv_normal_exit:
14354 fmovm.x &0x80,FP_SCR0(%a6)
14355 mov.l %d2,-(%sp)
14356 mov.w FP_SCR0_EX(%a6),%d1
14357 mov.l %d1,%d2
14358 andi.l &0x7fff,%d1
14359 andi.w &0x8000,%d2
14360 sub.l %d0,%d1
14361 or.w %d2,%d1
14362 mov.w %d1,FP_SCR0_EX(%a6)
14363 mov.l (%sp)+,%d2
14364 fmovm.x FP_SCR0(%a6),&0x80
14365 rts
14366
14367fsgldiv_may_ovfl:
14368 fmovm.x FP_SCR1(%a6),&0x80
14369
14370 fmov.l L_SCR3(%a6),%fpcr
14371 fmov.l &0x0,%fpsr
14372
14373 fsgldiv.x FP_SCR0(%a6),%fp0
14374
14375 fmov.l %fpsr,%d1
14376 fmov.l &0x0,%fpcr
14377
14378 or.l %d1,USER_FPSR(%a6)
14379
14380 fmovm.x &0x01,-(%sp)
14381 mov.w (%sp),%d1
14382 add.l &0xc,%sp
14383 andi.l &0x7fff,%d1
14384 sub.l %d0,%d1
14385 cmp.l %d1,&0x7fff
14386 blt.b fsgldiv_normal_exit
14387
14388fsgldiv_ovfl_tst:
14389 or.w &ovfl_inx_mask,2+USER_FPSR(%a6)
14390
14391 mov.b FPCR_ENABLE(%a6),%d1
14392 andi.b &0x13,%d1
14393 bne.b fsgldiv_ovfl_ena
14394
14395fsgldiv_ovfl_dis:
14396 btst &neg_bit,FPSR_CC(%a6)
14397 sne %d1
14398 mov.l L_SCR3(%a6),%d0
14399 andi.b &0x30,%d0
14400 bsr.l ovf_res
14401 or.b %d0,FPSR_CC(%a6)
14402 fmovm.x (%a0),&0x80
14403 rts
14404
14405fsgldiv_ovfl_ena:
14406 fmovm.x &0x80,FP_SCR0(%a6)
14407
14408 mov.l %d2,-(%sp)
14409 mov.w FP_SCR0_EX(%a6),%d1
14410 mov.l %d1,%d2
14411 andi.l &0x7fff,%d1
14412 andi.w &0x8000,%d2
14413 sub.l %d0,%d1
14414 subi.l &0x6000,%d1
14415 andi.w &0x7fff,%d1
14416 or.w %d2,%d1
14417 mov.w %d1,FP_SCR0_EX(%a6)
14418 mov.l (%sp)+,%d2
14419 fmovm.x FP_SCR0(%a6),&0x40
14420 bra.b fsgldiv_ovfl_dis
14421
14422fsgldiv_unfl:
14423 bset &unfl_bit,FPSR_EXCEPT(%a6)
14424
14425 fmovm.x FP_SCR1(%a6),&0x80
14426
14427 fmov.l &rz_mode*0x10,%fpcr
14428 fmov.l &0x0,%fpsr
14429
14430 fsgldiv.x FP_SCR0(%a6),%fp0
14431
14432 fmov.l %fpsr,%d1
14433 fmov.l &0x0,%fpcr
14434
14435 or.l %d1,USER_FPSR(%a6)
14436
14437 mov.b FPCR_ENABLE(%a6),%d1
14438 andi.b &0x0b,%d1
14439 bne.b fsgldiv_unfl_ena
14440
14441fsgldiv_unfl_dis:
14442 fmovm.x &0x80,FP_SCR0(%a6)
14443
14444 lea FP_SCR0(%a6),%a0
14445 mov.l L_SCR3(%a6),%d1
14446 bsr.l unf_res4
14447 or.b %d0,FPSR_CC(%a6)
14448 fmovm.x FP_SCR0(%a6),&0x80
14449 rts
14450
14451
14452
14453
14454fsgldiv_unfl_ena:
14455 fmovm.x FP_SCR1(%a6),&0x40
14456
14457 fmov.l L_SCR3(%a6),%fpcr
14458 fmov.l &0x0,%fpsr
14459
14460 fsgldiv.x FP_SCR0(%a6),%fp1
14461
14462 fmov.l &0x0,%fpcr
14463
14464 fmovm.x &0x40,FP_SCR0(%a6)
14465 mov.l %d2,-(%sp)
14466 mov.w FP_SCR0_EX(%a6),%d1
14467 mov.l %d1,%d2
14468 andi.l &0x7fff,%d1
14469 andi.w &0x8000,%d2
14470 sub.l %d0,%d1
14471 addi.l &0x6000,%d1
14472 andi.w &0x7fff,%d1
14473 or.w %d2,%d1
14474 mov.w %d1,FP_SCR0_EX(%a6)
14475 mov.l (%sp)+,%d2
14476 fmovm.x FP_SCR0(%a6),&0x40
14477 bra.b fsgldiv_unfl_dis
14478
14479
14480
14481
14482fsgldiv_may_unfl:
14483 fmovm.x FP_SCR1(%a6),&0x80
14484
14485 fmov.l L_SCR3(%a6),%fpcr
14486 fmov.l &0x0,%fpsr
14487
14488 fsgldiv.x FP_SCR0(%a6),%fp0
14489
14490 fmov.l %fpsr,%d1
14491 fmov.l &0x0,%fpcr
14492
14493 or.l %d1,USER_FPSR(%a6)
14494
14495 fabs.x %fp0,%fp1
14496 fcmp.b %fp1,&0x1
14497 fbgt.w fsgldiv_normal_exit
14498 fblt.w fsgldiv_unfl
14499
14500
14501
14502
14503
14504
14505
14506
14507 fmovm.x FP_SCR1(%a6),&0x40
14508
14509 clr.l %d1
14510 ori.b &rz_mode*0x10,%d1
14511
14512 fmov.l %d1,%fpcr
14513 fmov.l &0x0,%fpsr
14514
14515 fsgldiv.x FP_SCR0(%a6),%fp1
14516
14517 fmov.l &0x0,%fpcr
14518 fabs.x %fp1
14519 fcmp.b %fp1,&0x1
14520 fbge.w fsgldiv_normal_exit
14521 bra.w fsgldiv_unfl
14522
14523
14524
14525
14526
14527
14528fsgldiv_not_norm:
14529 mov.w (tbl_fsgldiv_op.b,%pc,%d1.w*2),%d1
14530 jmp (tbl_fsgldiv_op.b,%pc,%d1.w*1)
14531
14532 swbeg &48
14533tbl_fsgldiv_op:
14534 short fsgldiv_norm - tbl_fsgldiv_op
14535 short fsgldiv_inf_load - tbl_fsgldiv_op
14536 short fsgldiv_zero_load - tbl_fsgldiv_op
14537 short fsgldiv_res_qnan - tbl_fsgldiv_op
14538 short fsgldiv_norm - tbl_fsgldiv_op
14539 short fsgldiv_res_snan - tbl_fsgldiv_op
14540 short tbl_fsgldiv_op - tbl_fsgldiv_op
14541 short tbl_fsgldiv_op - tbl_fsgldiv_op
14542
14543 short fsgldiv_zero_load - tbl_fsgldiv_op
14544 short fsgldiv_res_operr - tbl_fsgldiv_op
14545 short fsgldiv_zero_load - tbl_fsgldiv_op
14546 short fsgldiv_res_qnan - tbl_fsgldiv_op
14547 short fsgldiv_zero_load - tbl_fsgldiv_op
14548 short fsgldiv_res_snan - tbl_fsgldiv_op
14549 short tbl_fsgldiv_op - tbl_fsgldiv_op
14550 short tbl_fsgldiv_op - tbl_fsgldiv_op
14551
14552 short fsgldiv_inf_dst - tbl_fsgldiv_op
14553 short fsgldiv_inf_dst - tbl_fsgldiv_op
14554 short fsgldiv_res_operr - tbl_fsgldiv_op
14555 short fsgldiv_res_qnan - tbl_fsgldiv_op
14556 short fsgldiv_inf_dst - tbl_fsgldiv_op
14557 short fsgldiv_res_snan - tbl_fsgldiv_op
14558 short tbl_fsgldiv_op - tbl_fsgldiv_op
14559 short tbl_fsgldiv_op - tbl_fsgldiv_op
14560
14561 short fsgldiv_res_qnan - tbl_fsgldiv_op
14562 short fsgldiv_res_qnan - tbl_fsgldiv_op
14563 short fsgldiv_res_qnan - tbl_fsgldiv_op
14564 short fsgldiv_res_qnan - tbl_fsgldiv_op
14565 short fsgldiv_res_qnan - tbl_fsgldiv_op
14566 short fsgldiv_res_snan - tbl_fsgldiv_op
14567 short tbl_fsgldiv_op - tbl_fsgldiv_op
14568 short tbl_fsgldiv_op - tbl_fsgldiv_op
14569
14570 short fsgldiv_norm - tbl_fsgldiv_op
14571 short fsgldiv_inf_load - tbl_fsgldiv_op
14572 short fsgldiv_zero_load - tbl_fsgldiv_op
14573 short fsgldiv_res_qnan - tbl_fsgldiv_op
14574 short fsgldiv_norm - tbl_fsgldiv_op
14575 short fsgldiv_res_snan - tbl_fsgldiv_op
14576 short tbl_fsgldiv_op - tbl_fsgldiv_op
14577 short tbl_fsgldiv_op - tbl_fsgldiv_op
14578
14579 short fsgldiv_res_snan - tbl_fsgldiv_op
14580 short fsgldiv_res_snan - tbl_fsgldiv_op
14581 short fsgldiv_res_snan - tbl_fsgldiv_op
14582 short fsgldiv_res_snan - tbl_fsgldiv_op
14583 short fsgldiv_res_snan - tbl_fsgldiv_op
14584 short fsgldiv_res_snan - tbl_fsgldiv_op
14585 short tbl_fsgldiv_op - tbl_fsgldiv_op
14586 short tbl_fsgldiv_op - tbl_fsgldiv_op
14587
14588fsgldiv_res_qnan:
14589 bra.l res_qnan
14590fsgldiv_res_snan:
14591 bra.l res_snan
14592fsgldiv_res_operr:
14593 bra.l res_operr
14594fsgldiv_inf_load:
14595 bra.l fdiv_inf_load
14596fsgldiv_zero_load:
14597 bra.l fdiv_zero_load
14598fsgldiv_inf_dst:
14599 bra.l fdiv_inf_dst
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635 global fsadd
14636fsadd:
14637 andi.b &0x30,%d0
14638 ori.b &s_mode*0x10,%d0
14639 bra.b fadd
14640
14641 global fdadd
14642fdadd:
14643 andi.b &0x30,%d0
14644 ori.b &d_mode*0x10,%d0
14645
14646 global fadd
14647fadd:
14648 mov.l %d0,L_SCR3(%a6)
14649
14650 clr.w %d1
14651 mov.b DTAG(%a6),%d1
14652 lsl.b &0x3,%d1
14653 or.b STAG(%a6),%d1
14654
14655 bne.w fadd_not_norm
14656
14657
14658
14659
14660fadd_norm:
14661 bsr.l addsub_scaler2
14662
14663fadd_zero_entry:
14664 fmovm.x FP_SCR1(%a6),&0x80
14665
14666 fmov.l &0x0,%fpsr
14667 fmov.l L_SCR3(%a6),%fpcr
14668
14669 fadd.x FP_SCR0(%a6),%fp0
14670
14671 fmov.l &0x0,%fpcr
14672 fmov.l %fpsr,%d1
14673
14674 or.l %d1,USER_FPSR(%a6)
14675
14676 fbeq.w fadd_zero_exit
14677
14678 mov.l %d2,-(%sp)
14679
14680 fmovm.x &0x01,-(%sp)
14681
14682 mov.w 2+L_SCR3(%a6),%d1
14683 lsr.b &0x6,%d1
14684
14685 mov.w (%sp),%d2
14686 andi.l &0x7fff,%d2
14687 sub.l %d0,%d2
14688
14689 cmp.l %d2,(tbl_fadd_ovfl.b,%pc,%d1.w*4)
14690 bge.b fadd_ovfl
14691
14692 cmp.l %d2,(tbl_fadd_unfl.b,%pc,%d1.w*4)
14693 blt.w fadd_unfl
14694 beq.w fadd_may_unfl
14695
14696fadd_normal:
14697 mov.w (%sp),%d1
14698 andi.w &0x8000,%d1
14699 or.w %d2,%d1
14700 mov.w %d1,(%sp)
14701
14702 fmovm.x (%sp)+,&0x80
14703
14704 mov.l (%sp)+,%d2
14705 rts
14706
14707fadd_zero_exit:
14708
14709 rts
14710
14711tbl_fadd_ovfl:
14712 long 0x7fff
14713 long 0x407f
14714 long 0x43ff
14715
14716tbl_fadd_unfl:
14717 long 0x0000
14718 long 0x3f81
14719 long 0x3c01
14720
14721fadd_ovfl:
14722 or.l &ovfl_inx_mask,USER_FPSR(%a6)
14723
14724 mov.b FPCR_ENABLE(%a6),%d1
14725 andi.b &0x13,%d1
14726 bne.b fadd_ovfl_ena
14727
14728 add.l &0xc,%sp
14729fadd_ovfl_dis:
14730 btst &neg_bit,FPSR_CC(%a6)
14731 sne %d1
14732 mov.l L_SCR3(%a6),%d0
14733 bsr.l ovf_res
14734 or.b %d0,FPSR_CC(%a6)
14735 fmovm.x (%a0),&0x80
14736 mov.l (%sp)+,%d2
14737 rts
14738
14739fadd_ovfl_ena:
14740 mov.b L_SCR3(%a6),%d1
14741 andi.b &0xc0,%d1
14742 bne.b fadd_ovfl_ena_sd
14743
14744fadd_ovfl_ena_cont:
14745 mov.w (%sp),%d1
14746 andi.w &0x8000,%d1
14747 subi.l &0x6000,%d2
14748 andi.w &0x7fff,%d2
14749 or.w %d2,%d1
14750 mov.w %d1,(%sp)
14751
14752 fmovm.x (%sp)+,&0x40
14753 bra.b fadd_ovfl_dis
14754
14755fadd_ovfl_ena_sd:
14756 fmovm.x FP_SCR1(%a6),&0x80
14757
14758 mov.l L_SCR3(%a6),%d1
14759 andi.b &0x30,%d1
14760 fmov.l %d1,%fpcr
14761
14762 fadd.x FP_SCR0(%a6),%fp0
14763
14764 fmov.l &0x0,%fpcr
14765
14766 add.l &0xc,%sp
14767 fmovm.x &0x01,-(%sp)
14768 bra.b fadd_ovfl_ena_cont
14769
14770fadd_unfl:
14771 bset &unfl_bit,FPSR_EXCEPT(%a6)
14772
14773 add.l &0xc,%sp
14774
14775 fmovm.x FP_SCR1(%a6),&0x80
14776
14777 fmov.l &rz_mode*0x10,%fpcr
14778 fmov.l &0x0,%fpsr
14779
14780 fadd.x FP_SCR0(%a6),%fp0
14781
14782 fmov.l &0x0,%fpcr
14783 fmov.l %fpsr,%d1
14784
14785 or.l %d1,USER_FPSR(%a6)
14786
14787 mov.b FPCR_ENABLE(%a6),%d1
14788 andi.b &0x0b,%d1
14789 bne.b fadd_unfl_ena
14790
14791fadd_unfl_dis:
14792 fmovm.x &0x80,FP_SCR0(%a6)
14793
14794 lea FP_SCR0(%a6),%a0
14795 mov.l L_SCR3(%a6),%d1
14796 bsr.l unf_res
14797 or.b %d0,FPSR_CC(%a6)
14798 fmovm.x FP_SCR0(%a6),&0x80
14799 mov.l (%sp)+,%d2
14800 rts
14801
14802fadd_unfl_ena:
14803 fmovm.x FP_SCR1(%a6),&0x40
14804
14805 mov.l L_SCR3(%a6),%d1
14806 andi.b &0xc0,%d1
14807 bne.b fadd_unfl_ena_sd
14808
14809 fmov.l L_SCR3(%a6),%fpcr
14810
14811fadd_unfl_ena_cont:
14812 fmov.l &0x0,%fpsr
14813
14814 fadd.x FP_SCR0(%a6),%fp1
14815
14816 fmov.l &0x0,%fpcr
14817
14818 fmovm.x &0x40,FP_SCR0(%a6)
14819 mov.w FP_SCR0_EX(%a6),%d1
14820 mov.l %d1,%d2
14821 andi.l &0x7fff,%d1
14822 andi.w &0x8000,%d2
14823 sub.l %d0,%d1
14824 addi.l &0x6000,%d1
14825 andi.w &0x7fff,%d1
14826 or.w %d2,%d1
14827 mov.w %d1,FP_SCR0_EX(%a6)
14828 fmovm.x FP_SCR0(%a6),&0x40
14829 bra.w fadd_unfl_dis
14830
14831fadd_unfl_ena_sd:
14832 mov.l L_SCR3(%a6),%d1
14833 andi.b &0x30,%d1
14834 fmov.l %d1,%fpcr
14835
14836 bra.b fadd_unfl_ena_cont
14837
14838
14839
14840
14841
14842
14843fadd_may_unfl:
14844 mov.l L_SCR3(%a6),%d1
14845 andi.b &0xc0,%d1
14846 beq.w fadd_normal
14847
14848 mov.l 0x4(%sp),%d1
14849 cmpi.l %d1,&0x80000000
14850 bne.w fadd_normal
14851
14852 tst.l 0x8(%sp)
14853 bne.w fadd_normal
14854
14855 btst &inex2_bit,FPSR_EXCEPT(%a6)
14856 beq.w fadd_normal
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868 fmovm.x FP_SCR1(%a6),&0x40
14869
14870 mov.l L_SCR3(%a6),%d1
14871 andi.b &0xc0,%d1
14872 ori.b &rz_mode*0x10,%d1
14873 fmov.l %d1,%fpcr
14874 fmov.l &0x0,%fpsr
14875
14876 fadd.x FP_SCR0(%a6),%fp1
14877
14878 fmov.l &0x0,%fpcr
14879
14880 fabs.x %fp0
14881 fabs.x %fp1
14882 fcmp.x %fp0,%fp1
14883
14884 fbgt.w fadd_unfl
14885 bra.w fadd_normal
14886
14887
14888
14889
14890
14891
14892fadd_not_norm:
14893 mov.w (tbl_fadd_op.b,%pc,%d1.w*2),%d1
14894 jmp (tbl_fadd_op.b,%pc,%d1.w*1)
14895
14896 swbeg &48
14897tbl_fadd_op:
14898 short fadd_norm - tbl_fadd_op
14899 short fadd_zero_src - tbl_fadd_op
14900 short fadd_inf_src - tbl_fadd_op
14901 short fadd_res_qnan - tbl_fadd_op
14902 short fadd_norm - tbl_fadd_op
14903 short fadd_res_snan - tbl_fadd_op
14904 short tbl_fadd_op - tbl_fadd_op
14905 short tbl_fadd_op - tbl_fadd_op
14906
14907 short fadd_zero_dst - tbl_fadd_op
14908 short fadd_zero_2 - tbl_fadd_op
14909 short fadd_inf_src - tbl_fadd_op
14910 short fadd_res_qnan - tbl_fadd_op
14911 short fadd_zero_dst - tbl_fadd_op
14912 short fadd_res_snan - tbl_fadd_op
14913 short tbl_fadd_op - tbl_fadd_op
14914 short tbl_fadd_op - tbl_fadd_op
14915
14916 short fadd_inf_dst - tbl_fadd_op
14917 short fadd_inf_dst - tbl_fadd_op
14918 short fadd_inf_2 - tbl_fadd_op
14919 short fadd_res_qnan - tbl_fadd_op
14920 short fadd_inf_dst - tbl_fadd_op
14921 short fadd_res_snan - tbl_fadd_op
14922 short tbl_fadd_op - tbl_fadd_op
14923 short tbl_fadd_op - tbl_fadd_op
14924
14925 short fadd_res_qnan - tbl_fadd_op
14926 short fadd_res_qnan - tbl_fadd_op
14927 short fadd_res_qnan - tbl_fadd_op
14928 short fadd_res_qnan - tbl_fadd_op
14929 short fadd_res_qnan - tbl_fadd_op
14930 short fadd_res_snan - tbl_fadd_op
14931 short tbl_fadd_op - tbl_fadd_op
14932 short tbl_fadd_op - tbl_fadd_op
14933
14934 short fadd_norm - tbl_fadd_op
14935 short fadd_zero_src - tbl_fadd_op
14936 short fadd_inf_src - tbl_fadd_op
14937 short fadd_res_qnan - tbl_fadd_op
14938 short fadd_norm - tbl_fadd_op
14939 short fadd_res_snan - tbl_fadd_op
14940 short tbl_fadd_op - tbl_fadd_op
14941 short tbl_fadd_op - tbl_fadd_op
14942
14943 short fadd_res_snan - tbl_fadd_op
14944 short fadd_res_snan - tbl_fadd_op
14945 short fadd_res_snan - tbl_fadd_op
14946 short fadd_res_snan - tbl_fadd_op
14947 short fadd_res_snan - tbl_fadd_op
14948 short fadd_res_snan - tbl_fadd_op
14949 short tbl_fadd_op - tbl_fadd_op
14950 short tbl_fadd_op - tbl_fadd_op
14951
14952fadd_res_qnan:
14953 bra.l res_qnan
14954fadd_res_snan:
14955 bra.l res_snan
14956
14957
14958
14959
14960fadd_zero_2:
14961 mov.b SRC_EX(%a0),%d0
14962 mov.b DST_EX(%a1),%d1
14963 eor.b %d0,%d1
14964 bmi.w fadd_zero_2_chk_rm
14965
14966
14967
14968 tst.b %d0
14969 bmi.b fadd_zero_rm
14970 fmov.s &0x00000000,%fp0
14971 mov.b &z_bmask,FPSR_CC(%a6)
14972 rts
14973
14974
14975
14976
14977
14978
14979fadd_zero_2_chk_rm:
14980 mov.b 3+L_SCR3(%a6),%d1
14981 andi.b &0x30,%d1
14982 cmpi.b %d1,&rm_mode*0x10
14983 beq.b fadd_zero_rm
14984 fmov.s &0x00000000,%fp0
14985 mov.b &z_bmask,FPSR_CC(%a6)
14986 rts
14987
14988fadd_zero_rm:
14989 fmov.s &0x80000000,%fp0
14990 mov.b &neg_bmask+z_bmask,FPSR_CC(%a6)
14991 rts
14992
14993
14994
14995
14996
14997fadd_zero_dst:
14998 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
14999 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
15000 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
15001 bsr.l scale_to_zero_src
15002 clr.w FP_SCR1_EX(%a6)
15003 clr.l FP_SCR1_HI(%a6)
15004 clr.l FP_SCR1_LO(%a6)
15005 bra.w fadd_zero_entry
15006
15007fadd_zero_src:
15008 mov.w DST_EX(%a1),FP_SCR1_EX(%a6)
15009 mov.l DST_HI(%a1),FP_SCR1_HI(%a6)
15010 mov.l DST_LO(%a1),FP_SCR1_LO(%a6)
15011 bsr.l scale_to_zero_dst
15012 clr.w FP_SCR0_EX(%a6)
15013 clr.l FP_SCR0_HI(%a6)
15014 clr.l FP_SCR0_LO(%a6)
15015 bra.w fadd_zero_entry
15016
15017
15018
15019
15020
15021fadd_inf_2:
15022 mov.b SRC_EX(%a0),%d0
15023 mov.b DST_EX(%a1),%d1
15024 eor.b %d1,%d0
15025 bmi.l res_operr
15026
15027
15028
15029
15030
15031
15032
15033fadd_inf_src:
15034 fmovm.x SRC(%a0),&0x80
15035 tst.b SRC_EX(%a0)
15036 bpl.b fadd_inf_done
15037 mov.b &neg_bmask+inf_bmask,FPSR_CC(%a6)
15038 rts
15039
15040
15041
15042
15043fadd_inf_dst:
15044 fmovm.x DST(%a1),&0x80
15045 tst.b DST_EX(%a1)
15046 bpl.b fadd_inf_done
15047 mov.b &neg_bmask+inf_bmask,FPSR_CC(%a6)
15048 rts
15049
15050fadd_inf_done:
15051 mov.b &inf_bmask,FPSR_CC(%a6)
15052 rts
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088 global fssub
15089fssub:
15090 andi.b &0x30,%d0
15091 ori.b &s_mode*0x10,%d0
15092 bra.b fsub
15093
15094 global fdsub
15095fdsub:
15096 andi.b &0x30,%d0
15097 ori.b &d_mode*0x10,%d0
15098
15099 global fsub
15100fsub:
15101 mov.l %d0,L_SCR3(%a6)
15102
15103 clr.w %d1
15104 mov.b DTAG(%a6),%d1
15105 lsl.b &0x3,%d1
15106 or.b STAG(%a6),%d1
15107
15108 bne.w fsub_not_norm
15109
15110
15111
15112
15113fsub_norm:
15114 bsr.l addsub_scaler2
15115
15116fsub_zero_entry:
15117 fmovm.x FP_SCR1(%a6),&0x80
15118
15119 fmov.l &0x0,%fpsr
15120 fmov.l L_SCR3(%a6),%fpcr
15121
15122 fsub.x FP_SCR0(%a6),%fp0
15123
15124 fmov.l &0x0,%fpcr
15125 fmov.l %fpsr,%d1
15126
15127 or.l %d1,USER_FPSR(%a6)
15128
15129 fbeq.w fsub_zero_exit
15130
15131 mov.l %d2,-(%sp)
15132
15133 fmovm.x &0x01,-(%sp)
15134
15135 mov.w 2+L_SCR3(%a6),%d1
15136 lsr.b &0x6,%d1
15137
15138 mov.w (%sp),%d2
15139 andi.l &0x7fff,%d2
15140 sub.l %d0,%d2
15141
15142 cmp.l %d2,(tbl_fsub_ovfl.b,%pc,%d1.w*4)
15143 bge.b fsub_ovfl
15144
15145 cmp.l %d2,(tbl_fsub_unfl.b,%pc,%d1.w*4)
15146 blt.w fsub_unfl
15147 beq.w fsub_may_unfl
15148
15149fsub_normal:
15150 mov.w (%sp),%d1
15151 andi.w &0x8000,%d1
15152 or.w %d2,%d1
15153 mov.w %d1,(%sp)
15154
15155 fmovm.x (%sp)+,&0x80
15156
15157 mov.l (%sp)+,%d2
15158 rts
15159
15160fsub_zero_exit:
15161
15162 rts
15163
15164tbl_fsub_ovfl:
15165 long 0x7fff
15166 long 0x407f
15167 long 0x43ff
15168
15169tbl_fsub_unfl:
15170 long 0x0000
15171 long 0x3f81
15172 long 0x3c01
15173
15174fsub_ovfl:
15175 or.l &ovfl_inx_mask,USER_FPSR(%a6)
15176
15177 mov.b FPCR_ENABLE(%a6),%d1
15178 andi.b &0x13,%d1
15179 bne.b fsub_ovfl_ena
15180
15181 add.l &0xc,%sp
15182fsub_ovfl_dis:
15183 btst &neg_bit,FPSR_CC(%a6)
15184 sne %d1
15185 mov.l L_SCR3(%a6),%d0
15186 bsr.l ovf_res
15187 or.b %d0,FPSR_CC(%a6)
15188 fmovm.x (%a0),&0x80
15189 mov.l (%sp)+,%d2
15190 rts
15191
15192fsub_ovfl_ena:
15193 mov.b L_SCR3(%a6),%d1
15194 andi.b &0xc0,%d1
15195 bne.b fsub_ovfl_ena_sd
15196
15197fsub_ovfl_ena_cont:
15198 mov.w (%sp),%d1
15199 andi.w &0x8000,%d1
15200 subi.l &0x6000,%d2
15201 andi.w &0x7fff,%d2
15202 or.w %d2,%d1
15203 mov.w %d1,(%sp)
15204
15205 fmovm.x (%sp)+,&0x40
15206 bra.b fsub_ovfl_dis
15207
15208fsub_ovfl_ena_sd:
15209 fmovm.x FP_SCR1(%a6),&0x80
15210
15211 mov.l L_SCR3(%a6),%d1
15212 andi.b &0x30,%d1
15213 fmov.l %d1,%fpcr
15214
15215 fsub.x FP_SCR0(%a6),%fp0
15216
15217 fmov.l &0x0,%fpcr
15218
15219 add.l &0xc,%sp
15220 fmovm.x &0x01,-(%sp)
15221 bra.b fsub_ovfl_ena_cont
15222
15223fsub_unfl:
15224 bset &unfl_bit,FPSR_EXCEPT(%a6)
15225
15226 add.l &0xc,%sp
15227
15228 fmovm.x FP_SCR1(%a6),&0x80
15229
15230 fmov.l &rz_mode*0x10,%fpcr
15231 fmov.l &0x0,%fpsr
15232
15233 fsub.x FP_SCR0(%a6),%fp0
15234
15235 fmov.l &0x0,%fpcr
15236 fmov.l %fpsr,%d1
15237
15238 or.l %d1,USER_FPSR(%a6)
15239
15240 mov.b FPCR_ENABLE(%a6),%d1
15241 andi.b &0x0b,%d1
15242 bne.b fsub_unfl_ena
15243
15244fsub_unfl_dis:
15245 fmovm.x &0x80,FP_SCR0(%a6)
15246
15247 lea FP_SCR0(%a6),%a0
15248 mov.l L_SCR3(%a6),%d1
15249 bsr.l unf_res
15250 or.b %d0,FPSR_CC(%a6)
15251 fmovm.x FP_SCR0(%a6),&0x80
15252 mov.l (%sp)+,%d2
15253 rts
15254
15255fsub_unfl_ena:
15256 fmovm.x FP_SCR1(%a6),&0x40
15257
15258 mov.l L_SCR3(%a6),%d1
15259 andi.b &0xc0,%d1
15260 bne.b fsub_unfl_ena_sd
15261
15262 fmov.l L_SCR3(%a6),%fpcr
15263
15264fsub_unfl_ena_cont:
15265 fmov.l &0x0,%fpsr
15266
15267 fsub.x FP_SCR0(%a6),%fp1
15268
15269 fmov.l &0x0,%fpcr
15270
15271 fmovm.x &0x40,FP_SCR0(%a6)
15272 mov.w FP_SCR0_EX(%a6),%d1
15273 mov.l %d1,%d2
15274 andi.l &0x7fff,%d1
15275 andi.w &0x8000,%d2
15276 sub.l %d0,%d1
15277 addi.l &0x6000,%d1
15278 andi.w &0x7fff,%d1
15279 or.w %d2,%d1
15280 mov.w %d1,FP_SCR0_EX(%a6)
15281 fmovm.x FP_SCR0(%a6),&0x40
15282 bra.w fsub_unfl_dis
15283
15284fsub_unfl_ena_sd:
15285 mov.l L_SCR3(%a6),%d1
15286 andi.b &0x30,%d1
15287 fmov.l %d1,%fpcr
15288
15289 bra.b fsub_unfl_ena_cont
15290
15291
15292
15293
15294
15295
15296fsub_may_unfl:
15297 mov.l L_SCR3(%a6),%d1
15298 andi.b &0xc0,%d1
15299 beq.w fsub_normal
15300
15301 mov.l 0x4(%sp),%d1
15302 cmpi.l %d1,&0x80000000
15303 bne.w fsub_normal
15304
15305 tst.l 0x8(%sp)
15306 bne.w fsub_normal
15307
15308 btst &inex2_bit,FPSR_EXCEPT(%a6)
15309 beq.w fsub_normal
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321 fmovm.x FP_SCR1(%a6),&0x40
15322
15323 mov.l L_SCR3(%a6),%d1
15324 andi.b &0xc0,%d1
15325 ori.b &rz_mode*0x10,%d1
15326 fmov.l %d1,%fpcr
15327 fmov.l &0x0,%fpsr
15328
15329 fsub.x FP_SCR0(%a6),%fp1
15330
15331 fmov.l &0x0,%fpcr
15332
15333 fabs.x %fp0
15334 fabs.x %fp1
15335 fcmp.x %fp0,%fp1
15336
15337 fbgt.w fsub_unfl
15338 bra.w fsub_normal
15339
15340
15341
15342
15343
15344
15345fsub_not_norm:
15346 mov.w (tbl_fsub_op.b,%pc,%d1.w*2),%d1
15347 jmp (tbl_fsub_op.b,%pc,%d1.w*1)
15348
15349 swbeg &48
15350tbl_fsub_op:
15351 short fsub_norm - tbl_fsub_op
15352 short fsub_zero_src - tbl_fsub_op
15353 short fsub_inf_src - tbl_fsub_op
15354 short fsub_res_qnan - tbl_fsub_op
15355 short fsub_norm - tbl_fsub_op
15356 short fsub_res_snan - tbl_fsub_op
15357 short tbl_fsub_op - tbl_fsub_op
15358 short tbl_fsub_op - tbl_fsub_op
15359
15360 short fsub_zero_dst - tbl_fsub_op
15361 short fsub_zero_2 - tbl_fsub_op
15362 short fsub_inf_src - tbl_fsub_op
15363 short fsub_res_qnan - tbl_fsub_op
15364 short fsub_zero_dst - tbl_fsub_op
15365 short fsub_res_snan - tbl_fsub_op
15366 short tbl_fsub_op - tbl_fsub_op
15367 short tbl_fsub_op - tbl_fsub_op
15368
15369 short fsub_inf_dst - tbl_fsub_op
15370 short fsub_inf_dst - tbl_fsub_op
15371 short fsub_inf_2 - tbl_fsub_op
15372 short fsub_res_qnan - tbl_fsub_op
15373 short fsub_inf_dst - tbl_fsub_op
15374 short fsub_res_snan - tbl_fsub_op
15375 short tbl_fsub_op - tbl_fsub_op
15376 short tbl_fsub_op - tbl_fsub_op
15377
15378 short fsub_res_qnan - tbl_fsub_op
15379 short fsub_res_qnan - tbl_fsub_op
15380 short fsub_res_qnan - tbl_fsub_op
15381 short fsub_res_qnan - tbl_fsub_op
15382 short fsub_res_qnan - tbl_fsub_op
15383 short fsub_res_snan - tbl_fsub_op
15384 short tbl_fsub_op - tbl_fsub_op
15385 short tbl_fsub_op - tbl_fsub_op
15386
15387 short fsub_norm - tbl_fsub_op
15388 short fsub_zero_src - tbl_fsub_op
15389 short fsub_inf_src - tbl_fsub_op
15390 short fsub_res_qnan - tbl_fsub_op
15391 short fsub_norm - tbl_fsub_op
15392 short fsub_res_snan - tbl_fsub_op
15393 short tbl_fsub_op - tbl_fsub_op
15394 short tbl_fsub_op - tbl_fsub_op
15395
15396 short fsub_res_snan - tbl_fsub_op
15397 short fsub_res_snan - tbl_fsub_op
15398 short fsub_res_snan - tbl_fsub_op
15399 short fsub_res_snan - tbl_fsub_op
15400 short fsub_res_snan - tbl_fsub_op
15401 short fsub_res_snan - tbl_fsub_op
15402 short tbl_fsub_op - tbl_fsub_op
15403 short tbl_fsub_op - tbl_fsub_op
15404
15405fsub_res_qnan:
15406 bra.l res_qnan
15407fsub_res_snan:
15408 bra.l res_snan
15409
15410
15411
15412
15413fsub_zero_2:
15414 mov.b SRC_EX(%a0),%d0
15415 mov.b DST_EX(%a1),%d1
15416 eor.b %d1,%d0
15417 bpl.b fsub_zero_2_chk_rm
15418
15419
15420 tst.b %d0
15421 bmi.b fsub_zero_2_rm
15422 fmov.s &0x00000000,%fp0
15423 mov.b &z_bmask,FPSR_CC(%a6)
15424 rts
15425
15426
15427
15428
15429
15430
15431fsub_zero_2_chk_rm:
15432 mov.b 3+L_SCR3(%a6),%d1
15433 andi.b &0x30,%d1
15434 cmpi.b %d1,&rm_mode*0x10
15435 beq.b fsub_zero_2_rm
15436 fmov.s &0x00000000,%fp0
15437 mov.b &z_bmask,FPSR_CC(%a6)
15438 rts
15439
15440fsub_zero_2_rm:
15441 fmov.s &0x80000000,%fp0
15442 mov.b &z_bmask+neg_bmask,FPSR_CC(%a6)
15443 rts
15444
15445
15446
15447
15448
15449fsub_zero_dst:
15450 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
15451 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
15452 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
15453 bsr.l scale_to_zero_src
15454 clr.w FP_SCR1_EX(%a6)
15455 clr.l FP_SCR1_HI(%a6)
15456 clr.l FP_SCR1_LO(%a6)
15457 bra.w fsub_zero_entry
15458
15459fsub_zero_src:
15460 mov.w DST_EX(%a1),FP_SCR1_EX(%a6)
15461 mov.l DST_HI(%a1),FP_SCR1_HI(%a6)
15462 mov.l DST_LO(%a1),FP_SCR1_LO(%a6)
15463 bsr.l scale_to_zero_dst
15464 clr.w FP_SCR0_EX(%a6)
15465 clr.l FP_SCR0_HI(%a6)
15466 clr.l FP_SCR0_LO(%a6)
15467 bra.w fsub_zero_entry
15468
15469
15470
15471
15472
15473fsub_inf_2:
15474 mov.b SRC_EX(%a0),%d0
15475 mov.b DST_EX(%a1),%d1
15476 eor.b %d1,%d0
15477 bpl.l res_operr
15478
15479
15480
15481
15482fsub_inf_src:
15483 fmovm.x SRC(%a0),&0x80
15484 fneg.x %fp0
15485 fbge.w fsub_inf_done
15486 mov.b &neg_bmask+inf_bmask,FPSR_CC(%a6)
15487 rts
15488
15489fsub_inf_dst:
15490 fmovm.x DST(%a1),&0x80
15491 tst.b DST_EX(%a1)
15492 bpl.b fsub_inf_done
15493 mov.b &neg_bmask+inf_bmask,FPSR_CC(%a6)
15494 rts
15495
15496fsub_inf_done:
15497 mov.b &inf_bmask,FPSR_CC(%a6)
15498 rts
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533 global fssqrt
15534fssqrt:
15535 andi.b &0x30,%d0
15536 ori.b &s_mode*0x10,%d0
15537 bra.b fsqrt
15538
15539 global fdsqrt
15540fdsqrt:
15541 andi.b &0x30,%d0
15542 ori.b &d_mode*0x10,%d0
15543
15544 global fsqrt
15545fsqrt:
15546 mov.l %d0,L_SCR3(%a6)
15547 clr.w %d1
15548 mov.b STAG(%a6),%d1
15549 bne.w fsqrt_not_norm
15550
15551
15552
15553
15554fsqrt_norm:
15555 tst.b SRC_EX(%a0)
15556 bmi.l res_operr
15557
15558 andi.b &0xc0,%d0
15559 bne.b fsqrt_not_ext
15560
15561 fmov.l L_SCR3(%a6),%fpcr
15562 fmov.l &0x0,%fpsr
15563
15564 fsqrt.x (%a0),%fp0
15565
15566 fmov.l %fpsr,%d1
15567 or.l %d1,USER_FPSR(%a6)
15568
15569 rts
15570
15571fsqrt_denorm:
15572 tst.b SRC_EX(%a0)
15573 bmi.l res_operr
15574
15575 andi.b &0xc0,%d0
15576 bne.b fsqrt_not_ext
15577
15578 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
15579 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
15580 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
15581
15582 bsr.l scale_sqrt
15583
15584 bra.w fsqrt_sd_normal
15585
15586
15587
15588
15589fsqrt_not_ext:
15590 cmpi.b %d0,&s_mode*0x10
15591 bne.w fsqrt_dbl
15592
15593
15594
15595
15596fsqrt_sgl:
15597 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
15598 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
15599 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
15600
15601 bsr.l scale_sqrt
15602
15603 cmpi.l %d0,&0x3fff-0x3f81
15604 beq.w fsqrt_sd_may_unfl
15605 bgt.w fsqrt_sd_unfl
15606 cmpi.l %d0,&0x3fff-0x407f
15607 beq.w fsqrt_sd_may_ovfl
15608 blt.w fsqrt_sd_ovfl
15609
15610
15611
15612
15613fsqrt_sd_normal:
15614 fmov.l &0x0,%fpsr
15615 fmov.l L_SCR3(%a6),%fpcr
15616
15617 fsqrt.x FP_SCR0(%a6),%fp0
15618
15619 fmov.l %fpsr,%d1
15620 fmov.l &0x0,%fpcr
15621
15622 or.l %d1,USER_FPSR(%a6)
15623
15624fsqrt_sd_normal_exit:
15625 mov.l %d2,-(%sp)
15626 fmovm.x &0x80,FP_SCR0(%a6)
15627 mov.w FP_SCR0_EX(%a6),%d1
15628 mov.l %d1,%d2
15629 andi.l &0x7fff,%d1
15630 sub.l %d0,%d1
15631 andi.w &0x8000,%d2
15632 or.w %d1,%d2
15633 mov.w %d2,FP_SCR0_EX(%a6)
15634 mov.l (%sp)+,%d2
15635 fmovm.x FP_SCR0(%a6),&0x80
15636 rts
15637
15638
15639
15640
15641fsqrt_dbl:
15642 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
15643 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
15644 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
15645
15646 bsr.l scale_sqrt
15647
15648 cmpi.l %d0,&0x3fff-0x3c01
15649 beq.w fsqrt_sd_may_unfl
15650 bgt.b fsqrt_sd_unfl
15651 cmpi.l %d0,&0x3fff-0x43ff
15652 beq.w fsqrt_sd_may_ovfl
15653 blt.w fsqrt_sd_ovfl
15654 bra.w fsqrt_sd_normal
15655
15656
15657
15658# elsewise fall through to underflow.
15659fsqrt_sd_may_unfl:
15660 btst &0x0,1+FP_SCR0_EX(%a6)
15661 bne.w fsqrt_sd_normal
15662
15663
15664
15665
15666fsqrt_sd_unfl:
15667 bset &unfl_bit,FPSR_EXCEPT(%a6)
15668
15669 fmov.l &rz_mode*0x10,%fpcr
15670 fmov.l &0x0,%fpsr
15671
15672 fsqrt.x FP_SCR0(%a6),%fp0
15673
15674 fmov.l %fpsr,%d1
15675 fmov.l &0x0,%fpcr
15676
15677 or.l %d1,USER_FPSR(%a6)
15678
15679
15680 mov.b FPCR_ENABLE(%a6),%d1
15681 andi.b &0x0b,%d1
15682 bne.b fsqrt_sd_unfl_ena
15683
15684fsqrt_sd_unfl_dis:
15685 fmovm.x &0x80,FP_SCR0(%a6)
15686
15687 lea FP_SCR0(%a6),%a0
15688 mov.l L_SCR3(%a6),%d1
15689 bsr.l unf_res
15690 or.b %d0,FPSR_CC(%a6)
15691 fmovm.x FP_SCR0(%a6),&0x80
15692 rts
15693
15694
15695
15696
15697
15698fsqrt_sd_unfl_ena:
15699 mov.l FP_SCR0_HI(%a6),FP_SCR1_HI(%a6)
15700 mov.l FP_SCR0_LO(%a6),FP_SCR1_LO(%a6)
15701 mov.w FP_SCR0_EX(%a6),%d1
15702
15703 mov.l %d2,-(%sp)
15704 mov.l %d1,%d2
15705 andi.l &0x7fff,%d1
15706 andi.w &0x8000,%d2
15707 sub.l %d0,%d1
15708 addi.l &0x6000,%d1
15709 andi.w &0x7fff,%d1
15710 or.w %d2,%d1
15711 mov.w %d1,FP_SCR1_EX(%a6)
15712 fmovm.x FP_SCR1(%a6),&0x40
15713 mov.l (%sp)+,%d2
15714 bra.b fsqrt_sd_unfl_dis
15715
15716
15717
15718
15719fsqrt_sd_ovfl:
15720 fmov.l &0x0,%fpsr
15721 fmov.l L_SCR3(%a6),%fpcr
15722
15723 fsqrt.x FP_SCR0(%a6),%fp0
15724
15725 fmov.l &0x0,%fpcr
15726 fmov.l %fpsr,%d1
15727
15728 or.l %d1,USER_FPSR(%a6)
15729
15730fsqrt_sd_ovfl_tst:
15731 or.l &ovfl_inx_mask,USER_FPSR(%a6)
15732
15733 mov.b FPCR_ENABLE(%a6),%d1
15734 andi.b &0x13,%d1
15735 bne.b fsqrt_sd_ovfl_ena
15736
15737
15738
15739
15740
15741fsqrt_sd_ovfl_dis:
15742 btst &neg_bit,FPSR_CC(%a6)
15743 sne %d1
15744 mov.l L_SCR3(%a6),%d0
15745 bsr.l ovf_res
15746 or.b %d0,FPSR_CC(%a6)
15747 fmovm.x (%a0),&0x80
15748 rts
15749
15750
15751
15752
15753
15754
15755fsqrt_sd_ovfl_ena:
15756 mov.l %d2,-(%sp)
15757 mov.w FP_SCR0_EX(%a6),%d1
15758 mov.l %d1,%d2
15759 andi.l &0x7fff,%d1
15760 andi.w &0x8000,%d2
15761 sub.l %d0,%d1
15762 subi.l &0x6000,%d1
15763 andi.w &0x7fff,%d1
15764 or.w %d2,%d1
15765 mov.w %d1,FP_SCR0_EX(%a6)
15766 fmovm.x FP_SCR0(%a6),&0x40
15767 mov.l (%sp)+,%d2
15768 bra.b fsqrt_sd_ovfl_dis
15769
15770
15771
15772
15773fsqrt_sd_may_ovfl:
15774 btst &0x0,1+FP_SCR0_EX(%a6)
15775 bne.w fsqrt_sd_ovfl
15776
15777 fmov.l &0x0,%fpsr
15778 fmov.l L_SCR3(%a6),%fpcr
15779
15780 fsqrt.x FP_SCR0(%a6),%fp0
15781
15782 fmov.l %fpsr,%d1
15783 fmov.l &0x0,%fpcr
15784
15785 or.l %d1,USER_FPSR(%a6)
15786
15787 fmov.x %fp0,%fp1
15788 fcmp.b %fp1,&0x1
15789 fbge.w fsqrt_sd_ovfl_tst
15790
15791
15792 bra.w fsqrt_sd_normal_exit
15793
15794
15795
15796
15797
15798
15799fsqrt_not_norm:
15800 cmpi.b %d1,&DENORM
15801 beq.w fsqrt_denorm
15802 cmpi.b %d1,&ZERO
15803 beq.b fsqrt_zero
15804 cmpi.b %d1,&INF
15805 beq.b fsqrt_inf
15806 cmpi.b %d1,&SNAN
15807 beq.l res_snan_1op
15808 bra.l res_qnan_1op
15809
15810
15811
15812
15813
15814
15815
15816fsqrt_zero:
15817 tst.b SRC_EX(%a0)
15818 bmi.b fsqrt_zero_m
15819fsqrt_zero_p:
15820 fmov.s &0x00000000,%fp0
15821 mov.b &z_bmask,FPSR_CC(%a6)
15822 rts
15823fsqrt_zero_m:
15824 fmov.s &0x80000000,%fp0
15825 mov.b &z_bmask+neg_bmask,FPSR_CC(%a6)
15826 rts
15827
15828fsqrt_inf:
15829 tst.b SRC_EX(%a0)
15830 bmi.l res_operr
15831fsqrt_inf_p:
15832 fmovm.x SRC(%a0),&0x80
15833 mov.b &inf_bmask,FPSR_CC(%a6)
15834 rts
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866 global addsub_scaler2
15867addsub_scaler2:
15868 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
15869 mov.l DST_HI(%a1),FP_SCR1_HI(%a6)
15870 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
15871 mov.l DST_LO(%a1),FP_SCR1_LO(%a6)
15872 mov.w SRC_EX(%a0),%d0
15873 mov.w DST_EX(%a1),%d1
15874 mov.w %d0,FP_SCR0_EX(%a6)
15875 mov.w %d1,FP_SCR1_EX(%a6)
15876
15877 andi.w &0x7fff,%d0
15878 andi.w &0x7fff,%d1
15879 mov.w %d0,L_SCR1(%a6)
15880 mov.w %d1,2+L_SCR1(%a6)
15881
15882 cmp.w %d0, %d1
15883 bge.l src_exp_ge2
15884
15885
15886dst_exp_gt2:
15887 bsr.l scale_to_zero_dst
15888 mov.l %d0,-(%sp)
15889
15890 cmpi.b STAG(%a6),&DENORM
15891 bne.b cmpexp12
15892
15893 lea FP_SCR0(%a6),%a0
15894 bsr.l norm
15895 neg.w %d0
15896 mov.w %d0,L_SCR1(%a6)
15897
15898cmpexp12:
15899 mov.w 2+L_SCR1(%a6),%d0
15900 subi.w &mantissalen+2,%d0
15901
15902 cmp.w %d0,L_SCR1(%a6)
15903 bge.b quick_scale12
15904
15905 mov.w L_SCR1(%a6),%d0
15906 add.w 0x2(%sp),%d0
15907 mov.w FP_SCR0_EX(%a6),%d1
15908 and.w &0x8000,%d1
15909 or.w %d1,%d0
15910 mov.w %d0,FP_SCR0_EX(%a6)
15911
15912 mov.l (%sp)+,%d0
15913 rts
15914
15915quick_scale12:
15916 andi.w &0x8000,FP_SCR0_EX(%a6)
15917 bset &0x0,1+FP_SCR0_EX(%a6)
15918
15919 mov.l (%sp)+,%d0
15920 rts
15921
15922
15923src_exp_ge2:
15924 bsr.l scale_to_zero_src
15925 mov.l %d0,-(%sp)
15926
15927 cmpi.b DTAG(%a6),&DENORM
15928 bne.b cmpexp22
15929 lea FP_SCR1(%a6),%a0
15930 bsr.l norm
15931 neg.w %d0
15932 mov.w %d0,2+L_SCR1(%a6)
15933
15934cmpexp22:
15935 mov.w L_SCR1(%a6),%d0
15936 subi.w &mantissalen+2,%d0
15937
15938 cmp.w %d0,2+L_SCR1(%a6)
15939 bge.b quick_scale22
15940
15941 mov.w 2+L_SCR1(%a6),%d0
15942 add.w 0x2(%sp),%d0
15943 mov.w FP_SCR1_EX(%a6),%d1
15944 andi.w &0x8000,%d1
15945 or.w %d1,%d0
15946 mov.w %d0,FP_SCR1_EX(%a6)
15947
15948 mov.l (%sp)+,%d0
15949 rts
15950
15951quick_scale22:
15952 andi.w &0x8000,FP_SCR1_EX(%a6)
15953 bset &0x0,1+FP_SCR1_EX(%a6)
15954
15955 mov.l (%sp)+,%d0
15956 rts
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983 global scale_to_zero_src
15984scale_to_zero_src:
15985 mov.w FP_SCR0_EX(%a6),%d1
15986 mov.w %d1,%d0
15987
15988 andi.l &0x7fff,%d1
15989
15990 andi.w &0x8000,%d0
15991 or.w &0x3fff,%d0
15992
15993 mov.w %d0,FP_SCR0_EX(%a6)
15994
15995 cmpi.b STAG(%a6),&DENORM
15996 beq.b stzs_denorm
15997
15998stzs_norm:
15999 mov.l &0x3fff,%d0
16000 sub.l %d1,%d0
16001
16002 rts
16003
16004stzs_denorm:
16005 lea FP_SCR0(%a6),%a0
16006 bsr.l norm
16007 neg.l %d0
16008 mov.l %d0,%d1
16009 bra.b stzs_norm
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037 global scale_sqrt
16038scale_sqrt:
16039 cmpi.b STAG(%a6),&DENORM
16040 beq.b ss_denorm
16041
16042 mov.w FP_SCR0_EX(%a6),%d1
16043 andi.l &0x7fff,%d1
16044
16045 andi.w &0x8000,FP_SCR0_EX(%a6)
16046
16047 btst &0x0,%d1
16048 beq.b ss_norm_even
16049
16050 ori.w &0x3fff,FP_SCR0_EX(%a6)
16051
16052 mov.l &0x3fff,%d0
16053 sub.l %d1,%d0
16054 asr.l &0x1,%d0
16055 rts
16056
16057ss_norm_even:
16058 ori.w &0x3ffe,FP_SCR0_EX(%a6)
16059
16060 mov.l &0x3ffe,%d0
16061 sub.l %d1,%d0
16062 asr.l &0x1,%d0
16063 rts
16064
16065ss_denorm:
16066 lea FP_SCR0(%a6),%a0
16067 bsr.l norm
16068
16069 btst &0x0,%d0
16070 beq.b ss_denorm_even
16071
16072 ori.w &0x3fff,FP_SCR0_EX(%a6)
16073
16074 add.l &0x3fff,%d0
16075 asr.l &0x1,%d0
16076 rts
16077
16078ss_denorm_even:
16079 ori.w &0x3ffe,FP_SCR0_EX(%a6)
16080
16081 add.l &0x3ffe,%d0
16082 asr.l &0x1,%d0
16083 rts
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110 global scale_to_zero_dst
16111scale_to_zero_dst:
16112 mov.w FP_SCR1_EX(%a6),%d1
16113 mov.w %d1,%d0
16114
16115 andi.l &0x7fff,%d1
16116
16117 andi.w &0x8000,%d0
16118 or.w &0x3fff,%d0
16119
16120 mov.w %d0,FP_SCR1_EX(%a6)
16121
16122 cmpi.b DTAG(%a6),&DENORM
16123 beq.b stzd_denorm
16124
16125stzd_norm:
16126 mov.l &0x3fff,%d0
16127 sub.l %d1,%d0
16128 rts
16129
16130stzd_denorm:
16131 lea FP_SCR1(%a6),%a0
16132 bsr.l norm
16133 neg.l %d0
16134 mov.l %d0,%d1
16135 bra.b stzd_norm
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172 global res_qnan
16173 global res_snan
16174res_qnan:
16175res_snan:
16176 cmp.b DTAG(%a6), &SNAN
16177 beq.b dst_snan2
16178 cmp.b DTAG(%a6), &QNAN
16179 beq.b dst_qnan2
16180src_nan:
16181 cmp.b STAG(%a6), &QNAN
16182 beq.b src_qnan2
16183 global res_snan_1op
16184res_snan_1op:
16185src_snan2:
16186 bset &0x6, FP_SRC_HI(%a6)
16187 or.l &nan_mask+aiop_mask+snan_mask, USER_FPSR(%a6)
16188 lea FP_SRC(%a6), %a0
16189 bra.b nan_comp
16190 global res_qnan_1op
16191res_qnan_1op:
16192src_qnan2:
16193 or.l &nan_mask, USER_FPSR(%a6)
16194 lea FP_SRC(%a6), %a0
16195 bra.b nan_comp
16196dst_snan2:
16197 or.l &nan_mask+aiop_mask+snan_mask, USER_FPSR(%a6)
16198 bset &0x6, FP_DST_HI(%a6)
16199 lea FP_DST(%a6), %a0
16200 bra.b nan_comp
16201dst_qnan2:
16202 lea FP_DST(%a6), %a0
16203 cmp.b STAG(%a6), &SNAN
16204 bne nan_done
16205 or.l &aiop_mask+snan_mask, USER_FPSR(%a6)
16206nan_done:
16207 or.l &nan_mask, USER_FPSR(%a6)
16208nan_comp:
16209 btst &0x7, FTEMP_EX(%a0)
16210 beq.b nan_not_neg
16211 or.l &neg_mask, USER_FPSR(%a6)
16212nan_not_neg:
16213 fmovm.x (%a0), &0x80
16214 rts
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238 global res_operr
16239res_operr:
16240 or.l &nan_mask+operr_mask+aiop_mask, USER_FPSR(%a6)
16241 fmovm.x nan_return(%pc), &0x80
16242 rts
16243
16244nan_return:
16245 long 0x7fff0000, 0xffffffff, 0xffffffff
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278 global _fdbcc
16279_fdbcc:
16280 mov.l %d0,L_SCR1(%a6)
16281
16282 mov.w EXC_CMDREG(%a6),%d0
16283
16284 clr.l %d1
16285 mov.b FPSR_CC(%a6),%d1
16286 ror.l &0x8,%d1
16287 fmov.l %d1,%fpsr
16288
16289 mov.w (tbl_fdbcc.b,%pc,%d0.w*2),%d1
16290 jmp (tbl_fdbcc.b,%pc,%d1.w)
16291
16292tbl_fdbcc:
16293 short fdbcc_f - tbl_fdbcc
16294 short fdbcc_eq - tbl_fdbcc
16295 short fdbcc_ogt - tbl_fdbcc
16296 short fdbcc_oge - tbl_fdbcc
16297 short fdbcc_olt - tbl_fdbcc
16298 short fdbcc_ole - tbl_fdbcc
16299 short fdbcc_ogl - tbl_fdbcc
16300 short fdbcc_or - tbl_fdbcc
16301 short fdbcc_un - tbl_fdbcc
16302 short fdbcc_ueq - tbl_fdbcc
16303 short fdbcc_ugt - tbl_fdbcc
16304 short fdbcc_uge - tbl_fdbcc
16305 short fdbcc_ult - tbl_fdbcc
16306 short fdbcc_ule - tbl_fdbcc
16307 short fdbcc_neq - tbl_fdbcc
16308 short fdbcc_t - tbl_fdbcc
16309 short fdbcc_sf - tbl_fdbcc
16310 short fdbcc_seq - tbl_fdbcc
16311 short fdbcc_gt - tbl_fdbcc
16312 short fdbcc_ge - tbl_fdbcc
16313 short fdbcc_lt - tbl_fdbcc
16314 short fdbcc_le - tbl_fdbcc
16315 short fdbcc_gl - tbl_fdbcc
16316 short fdbcc_gle - tbl_fdbcc
16317 short fdbcc_ngle - tbl_fdbcc
16318 short fdbcc_ngl - tbl_fdbcc
16319 short fdbcc_nle - tbl_fdbcc
16320 short fdbcc_nlt - tbl_fdbcc
16321 short fdbcc_nge - tbl_fdbcc
16322 short fdbcc_ngt - tbl_fdbcc
16323 short fdbcc_sneq - tbl_fdbcc
16324 short fdbcc_st - tbl_fdbcc
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349fdbcc_eq:
16350 fbeq.w fdbcc_eq_yes
16351fdbcc_eq_no:
16352 bra.w fdbcc_false
16353fdbcc_eq_yes:
16354 rts
16355
16356
16357
16358
16359
16360
16361fdbcc_neq:
16362 fbneq.w fdbcc_neq_yes
16363fdbcc_neq_no:
16364 bra.w fdbcc_false
16365fdbcc_neq_yes:
16366 rts
16367
16368
16369
16370
16371
16372
16373fdbcc_gt:
16374 fbgt.w fdbcc_gt_yes
16375 btst &nan_bit, FPSR_CC(%a6)
16376 beq.w fdbcc_false
16377 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
16378 btst &bsun_bit, FPCR_ENABLE(%a6)
16379 bne.w fdbcc_bsun
16380 bra.w fdbcc_false
16381fdbcc_gt_yes:
16382 rts
16383
16384
16385
16386
16387
16388
16389fdbcc_ngt:
16390 fbngt.w fdbcc_ngt_yes
16391fdbcc_ngt_no:
16392 bra.w fdbcc_false
16393fdbcc_ngt_yes:
16394 btst &nan_bit, FPSR_CC(%a6)
16395 beq.b fdbcc_ngt_done
16396 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
16397 btst &bsun_bit, FPCR_ENABLE(%a6)
16398 bne.w fdbcc_bsun
16399fdbcc_ngt_done:
16400 rts
16401
16402
16403
16404
16405
16406
16407fdbcc_ge:
16408 fbge.w fdbcc_ge_yes
16409fdbcc_ge_no:
16410 btst &nan_bit, FPSR_CC(%a6)
16411 beq.w fdbcc_false
16412 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
16413 btst &bsun_bit, FPCR_ENABLE(%a6)
16414 bne.w fdbcc_bsun
16415 bra.w fdbcc_false
16416fdbcc_ge_yes:
16417 btst &nan_bit, FPSR_CC(%a6)
16418 beq.b fdbcc_ge_yes_done
16419 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
16420 btst &bsun_bit, FPCR_ENABLE(%a6)
16421 bne.w fdbcc_bsun
16422fdbcc_ge_yes_done:
16423 rts
16424
16425
16426
16427
16428
16429
16430fdbcc_nge:
16431 fbnge.w fdbcc_nge_yes
16432fdbcc_nge_no:
16433 bra.w fdbcc_false
16434fdbcc_nge_yes:
16435 btst &nan_bit, FPSR_CC(%a6)
16436 beq.b fdbcc_nge_done
16437 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
16438 btst &bsun_bit, FPCR_ENABLE(%a6)
16439 bne.w fdbcc_bsun
16440fdbcc_nge_done:
16441 rts
16442
16443
16444
16445
16446
16447
16448fdbcc_lt:
16449 fblt.w fdbcc_lt_yes
16450fdbcc_lt_no:
16451 btst &nan_bit, FPSR_CC(%a6)
16452 beq.w fdbcc_false
16453 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
16454 btst &bsun_bit, FPCR_ENABLE(%a6)
16455 bne.w fdbcc_bsun
16456 bra.w fdbcc_false
16457fdbcc_lt_yes:
16458 rts
16459
16460
16461
16462
16463
16464
16465fdbcc_nlt:
16466 fbnlt.w fdbcc_nlt_yes
16467fdbcc_nlt_no:
16468 bra.w fdbcc_false
16469fdbcc_nlt_yes:
16470 btst &nan_bit, FPSR_CC(%a6)
16471 beq.b fdbcc_nlt_done
16472 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
16473 btst &bsun_bit, FPCR_ENABLE(%a6)
16474 bne.w fdbcc_bsun
16475fdbcc_nlt_done:
16476 rts
16477
16478
16479
16480
16481
16482
16483fdbcc_le:
16484 fble.w fdbcc_le_yes
16485fdbcc_le_no:
16486 btst &nan_bit, FPSR_CC(%a6)
16487 beq.w fdbcc_false
16488 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
16489 btst &bsun_bit, FPCR_ENABLE(%a6)
16490 bne.w fdbcc_bsun
16491 bra.w fdbcc_false
16492fdbcc_le_yes:
16493 btst &nan_bit, FPSR_CC(%a6)
16494 beq.b fdbcc_le_yes_done
16495 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
16496 btst &bsun_bit, FPCR_ENABLE(%a6)
16497 bne.w fdbcc_bsun
16498fdbcc_le_yes_done:
16499 rts
16500
16501
16502
16503
16504
16505
16506fdbcc_nle:
16507 fbnle.w fdbcc_nle_yes
16508fdbcc_nle_no:
16509 bra.w fdbcc_false
16510fdbcc_nle_yes:
16511 btst &nan_bit, FPSR_CC(%a6)
16512 beq.w fdbcc_nle_done
16513 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
16514 btst &bsun_bit, FPCR_ENABLE(%a6)
16515 bne.w fdbcc_bsun
16516fdbcc_nle_done:
16517 rts
16518
16519
16520
16521
16522
16523
16524fdbcc_gl:
16525 fbgl.w fdbcc_gl_yes
16526fdbcc_gl_no:
16527 btst &nan_bit, FPSR_CC(%a6)
16528 beq.w fdbcc_false
16529 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
16530 btst &bsun_bit, FPCR_ENABLE(%a6)
16531 bne.w fdbcc_bsun
16532 bra.w fdbcc_false
16533fdbcc_gl_yes:
16534 rts
16535
16536
16537
16538
16539
16540
16541fdbcc_ngl:
16542 fbngl.w fdbcc_ngl_yes
16543fdbcc_ngl_no:
16544 bra.w fdbcc_false
16545fdbcc_ngl_yes:
16546 btst &nan_bit, FPSR_CC(%a6)
16547 beq.b fdbcc_ngl_done
16548 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
16549 btst &bsun_bit, FPCR_ENABLE(%a6)
16550 bne.w fdbcc_bsun
16551fdbcc_ngl_done:
16552 rts
16553
16554
16555
16556
16557
16558
16559fdbcc_gle:
16560 fbgle.w fdbcc_gle_yes
16561fdbcc_gle_no:
16562 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
16563 btst &bsun_bit, FPCR_ENABLE(%a6)
16564 bne.w fdbcc_bsun
16565 bra.w fdbcc_false
16566fdbcc_gle_yes:
16567 rts
16568
16569
16570
16571
16572
16573
16574fdbcc_ngle:
16575 fbngle.w fdbcc_ngle_yes
16576fdbcc_ngle_no:
16577 bra.w fdbcc_false
16578fdbcc_ngle_yes:
16579 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
16580 btst &bsun_bit, FPCR_ENABLE(%a6)
16581 bne.w fdbcc_bsun
16582 rts
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597fdbcc_f:
16598 bra.w fdbcc_false
16599
16600
16601
16602
16603
16604
16605fdbcc_t:
16606 rts
16607
16608
16609
16610
16611
16612
16613fdbcc_sf:
16614 btst &nan_bit, FPSR_CC(%a6)
16615 beq.w fdbcc_false
16616 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
16617 btst &bsun_bit, FPCR_ENABLE(%a6)
16618 bne.w fdbcc_bsun
16619 bra.w fdbcc_false
16620
16621
16622
16623
16624
16625
16626fdbcc_st:
16627 btst &nan_bit, FPSR_CC(%a6)
16628 beq.b fdbcc_st_done
16629 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
16630 btst &bsun_bit, FPCR_ENABLE(%a6)
16631 bne.w fdbcc_bsun
16632fdbcc_st_done:
16633 rts
16634
16635
16636
16637
16638
16639
16640fdbcc_seq:
16641 fbseq.w fdbcc_seq_yes
16642fdbcc_seq_no:
16643 btst &nan_bit, FPSR_CC(%a6)
16644 beq.w fdbcc_false
16645 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
16646 btst &bsun_bit, FPCR_ENABLE(%a6)
16647 bne.w fdbcc_bsun
16648 bra.w fdbcc_false
16649fdbcc_seq_yes:
16650 btst &nan_bit, FPSR_CC(%a6)
16651 beq.b fdbcc_seq_yes_done
16652 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
16653 btst &bsun_bit, FPCR_ENABLE(%a6)
16654 bne.w fdbcc_bsun
16655fdbcc_seq_yes_done:
16656 rts
16657
16658
16659
16660
16661
16662
16663fdbcc_sneq:
16664 fbsneq.w fdbcc_sneq_yes
16665fdbcc_sneq_no:
16666 btst &nan_bit, FPSR_CC(%a6)
16667 beq.w fdbcc_false
16668 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
16669 btst &bsun_bit, FPCR_ENABLE(%a6)
16670 bne.w fdbcc_bsun
16671 bra.w fdbcc_false
16672fdbcc_sneq_yes:
16673 btst &nan_bit, FPSR_CC(%a6)
16674 beq.w fdbcc_sneq_done
16675 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
16676 btst &bsun_bit, FPCR_ENABLE(%a6)
16677 bne.w fdbcc_bsun
16678fdbcc_sneq_done:
16679 rts
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697fdbcc_ogt:
16698 fbogt.w fdbcc_ogt_yes
16699fdbcc_ogt_no:
16700 bra.w fdbcc_false
16701fdbcc_ogt_yes:
16702 rts
16703
16704
16705
16706
16707
16708
16709fdbcc_ule:
16710 fbule.w fdbcc_ule_yes
16711fdbcc_ule_no:
16712 bra.w fdbcc_false
16713fdbcc_ule_yes:
16714 rts
16715
16716
16717
16718
16719
16720
16721fdbcc_oge:
16722 fboge.w fdbcc_oge_yes
16723fdbcc_oge_no:
16724 bra.w fdbcc_false
16725fdbcc_oge_yes:
16726 rts
16727
16728
16729
16730
16731
16732
16733fdbcc_ult:
16734 fbult.w fdbcc_ult_yes
16735fdbcc_ult_no:
16736 bra.w fdbcc_false
16737fdbcc_ult_yes:
16738 rts
16739
16740
16741
16742
16743
16744
16745fdbcc_olt:
16746 fbolt.w fdbcc_olt_yes
16747fdbcc_olt_no:
16748 bra.w fdbcc_false
16749fdbcc_olt_yes:
16750 rts
16751
16752
16753
16754
16755
16756
16757fdbcc_uge:
16758 fbuge.w fdbcc_uge_yes
16759fdbcc_uge_no:
16760 bra.w fdbcc_false
16761fdbcc_uge_yes:
16762 rts
16763
16764
16765
16766
16767
16768
16769fdbcc_ole:
16770 fbole.w fdbcc_ole_yes
16771fdbcc_ole_no:
16772 bra.w fdbcc_false
16773fdbcc_ole_yes:
16774 rts
16775
16776
16777
16778
16779
16780
16781fdbcc_ugt:
16782 fbugt.w fdbcc_ugt_yes
16783fdbcc_ugt_no:
16784 bra.w fdbcc_false
16785fdbcc_ugt_yes:
16786 rts
16787
16788
16789
16790
16791
16792
16793fdbcc_ogl:
16794 fbogl.w fdbcc_ogl_yes
16795fdbcc_ogl_no:
16796 bra.w fdbcc_false
16797fdbcc_ogl_yes:
16798 rts
16799
16800
16801
16802
16803
16804
16805fdbcc_ueq:
16806 fbueq.w fdbcc_ueq_yes
16807fdbcc_ueq_no:
16808 bra.w fdbcc_false
16809fdbcc_ueq_yes:
16810 rts
16811
16812
16813
16814
16815
16816
16817fdbcc_or:
16818 fbor.w fdbcc_or_yes
16819fdbcc_or_no:
16820 bra.w fdbcc_false
16821fdbcc_or_yes:
16822 rts
16823
16824
16825
16826
16827
16828
16829fdbcc_un:
16830 fbun.w fdbcc_un_yes
16831fdbcc_un_no:
16832 bra.w fdbcc_false
16833fdbcc_un_yes:
16834 rts
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844# else
16845
16846
16847fdbcc_false:
16848 mov.b 1+EXC_OPWORD(%a6), %d1
16849 andi.w &0x7, %d1
16850
16851 bsr.l fetch_dreg
16852
16853
16854 subq.w &0x1, %d0
16855
16856 bsr.l store_dreg_l
16857
16858 cmpi.w %d0, &-0x1
16859 bne.b fdbcc_false_cont
16860 rts
16861
16862fdbcc_false_cont:
16863 mov.l L_SCR1(%a6),%d0
16864 add.l USER_FPIAR(%a6),%d0
16865 addq.l &0x4,%d0
16866 mov.l %d0,EXC_PC(%a6)
16867 rts
16868
16869
16870
16871
16872
16873fdbcc_bsun:
16874 mov.b &fbsun_flg,SPCOND_FLG(%a6)
16875 rts
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908 global _ftrapcc
16909_ftrapcc:
16910 mov.w EXC_CMDREG(%a6),%d0
16911
16912 clr.l %d1
16913 mov.b FPSR_CC(%a6),%d1
16914 ror.l &0x8,%d1
16915 fmov.l %d1,%fpsr
16916
16917 mov.w (tbl_ftrapcc.b,%pc,%d0.w*2), %d1
16918 jmp (tbl_ftrapcc.b,%pc,%d1.w)
16919
16920tbl_ftrapcc:
16921 short ftrapcc_f - tbl_ftrapcc
16922 short ftrapcc_eq - tbl_ftrapcc
16923 short ftrapcc_ogt - tbl_ftrapcc
16924 short ftrapcc_oge - tbl_ftrapcc
16925 short ftrapcc_olt - tbl_ftrapcc
16926 short ftrapcc_ole - tbl_ftrapcc
16927 short ftrapcc_ogl - tbl_ftrapcc
16928 short ftrapcc_or - tbl_ftrapcc
16929 short ftrapcc_un - tbl_ftrapcc
16930 short ftrapcc_ueq - tbl_ftrapcc
16931 short ftrapcc_ugt - tbl_ftrapcc
16932 short ftrapcc_uge - tbl_ftrapcc
16933 short ftrapcc_ult - tbl_ftrapcc
16934 short ftrapcc_ule - tbl_ftrapcc
16935 short ftrapcc_neq - tbl_ftrapcc
16936 short ftrapcc_t - tbl_ftrapcc
16937 short ftrapcc_sf - tbl_ftrapcc
16938 short ftrapcc_seq - tbl_ftrapcc
16939 short ftrapcc_gt - tbl_ftrapcc
16940 short ftrapcc_ge - tbl_ftrapcc
16941 short ftrapcc_lt - tbl_ftrapcc
16942 short ftrapcc_le - tbl_ftrapcc
16943 short ftrapcc_gl - tbl_ftrapcc
16944 short ftrapcc_gle - tbl_ftrapcc
16945 short ftrapcc_ngle - tbl_ftrapcc
16946 short ftrapcc_ngl - tbl_ftrapcc
16947 short ftrapcc_nle - tbl_ftrapcc
16948 short ftrapcc_nlt - tbl_ftrapcc
16949 short ftrapcc_nge - tbl_ftrapcc
16950 short ftrapcc_ngt - tbl_ftrapcc
16951 short ftrapcc_sneq - tbl_ftrapcc
16952 short ftrapcc_st - tbl_ftrapcc
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975ftrapcc_eq:
16976 fbeq.w ftrapcc_trap
16977ftrapcc_eq_no:
16978 rts
16979
16980
16981
16982
16983
16984
16985ftrapcc_neq:
16986 fbneq.w ftrapcc_trap
16987ftrapcc_neq_no:
16988 rts
16989
16990
16991
16992
16993
16994
16995ftrapcc_gt:
16996 fbgt.w ftrapcc_trap
16997ftrapcc_gt_no:
16998 btst &nan_bit, FPSR_CC(%a6)
16999 beq.b ftrapcc_gt_done
17000 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17001 btst &bsun_bit, FPCR_ENABLE(%a6)
17002 bne.w ftrapcc_bsun
17003ftrapcc_gt_done:
17004 rts
17005
17006
17007
17008
17009
17010
17011ftrapcc_ngt:
17012 fbngt.w ftrapcc_ngt_yes
17013ftrapcc_ngt_no:
17014 rts
17015ftrapcc_ngt_yes:
17016 btst &nan_bit, FPSR_CC(%a6)
17017 beq.w ftrapcc_trap
17018 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17019 btst &bsun_bit, FPCR_ENABLE(%a6)
17020 bne.w ftrapcc_bsun
17021 bra.w ftrapcc_trap
17022
17023
17024
17025
17026
17027
17028ftrapcc_ge:
17029 fbge.w ftrapcc_ge_yes
17030ftrapcc_ge_no:
17031 btst &nan_bit, FPSR_CC(%a6)
17032 beq.b ftrapcc_ge_done
17033 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17034 btst &bsun_bit, FPCR_ENABLE(%a6)
17035 bne.w ftrapcc_bsun
17036ftrapcc_ge_done:
17037 rts
17038ftrapcc_ge_yes:
17039 btst &nan_bit, FPSR_CC(%a6)
17040 beq.w ftrapcc_trap
17041 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17042 btst &bsun_bit, FPCR_ENABLE(%a6)
17043 bne.w ftrapcc_bsun
17044 bra.w ftrapcc_trap
17045
17046
17047
17048
17049
17050
17051ftrapcc_nge:
17052 fbnge.w ftrapcc_nge_yes
17053ftrapcc_nge_no:
17054 rts
17055ftrapcc_nge_yes:
17056 btst &nan_bit, FPSR_CC(%a6)
17057 beq.w ftrapcc_trap
17058 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17059 btst &bsun_bit, FPCR_ENABLE(%a6)
17060 bne.w ftrapcc_bsun
17061 bra.w ftrapcc_trap
17062
17063
17064
17065
17066
17067
17068ftrapcc_lt:
17069 fblt.w ftrapcc_trap
17070ftrapcc_lt_no:
17071 btst &nan_bit, FPSR_CC(%a6)
17072 beq.b ftrapcc_lt_done
17073 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17074 btst &bsun_bit, FPCR_ENABLE(%a6)
17075 bne.w ftrapcc_bsun
17076ftrapcc_lt_done:
17077 rts
17078
17079
17080
17081
17082
17083
17084ftrapcc_nlt:
17085 fbnlt.w ftrapcc_nlt_yes
17086ftrapcc_nlt_no:
17087 rts
17088ftrapcc_nlt_yes:
17089 btst &nan_bit, FPSR_CC(%a6)
17090 beq.w ftrapcc_trap
17091 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17092 btst &bsun_bit, FPCR_ENABLE(%a6)
17093 bne.w ftrapcc_bsun
17094 bra.w ftrapcc_trap
17095
17096
17097
17098
17099
17100
17101ftrapcc_le:
17102 fble.w ftrapcc_le_yes
17103ftrapcc_le_no:
17104 btst &nan_bit, FPSR_CC(%a6)
17105 beq.b ftrapcc_le_done
17106 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17107 btst &bsun_bit, FPCR_ENABLE(%a6)
17108 bne.w ftrapcc_bsun
17109ftrapcc_le_done:
17110 rts
17111ftrapcc_le_yes:
17112 btst &nan_bit, FPSR_CC(%a6)
17113 beq.w ftrapcc_trap
17114 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17115 btst &bsun_bit, FPCR_ENABLE(%a6)
17116 bne.w ftrapcc_bsun
17117 bra.w ftrapcc_trap
17118
17119
17120
17121
17122
17123
17124ftrapcc_nle:
17125 fbnle.w ftrapcc_nle_yes
17126ftrapcc_nle_no:
17127 rts
17128ftrapcc_nle_yes:
17129 btst &nan_bit, FPSR_CC(%a6)
17130 beq.w ftrapcc_trap
17131 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17132 btst &bsun_bit, FPCR_ENABLE(%a6)
17133 bne.w ftrapcc_bsun
17134 bra.w ftrapcc_trap
17135
17136
17137
17138
17139
17140
17141ftrapcc_gl:
17142 fbgl.w ftrapcc_trap
17143ftrapcc_gl_no:
17144 btst &nan_bit, FPSR_CC(%a6)
17145 beq.b ftrapcc_gl_done
17146 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17147 btst &bsun_bit, FPCR_ENABLE(%a6)
17148 bne.w ftrapcc_bsun
17149ftrapcc_gl_done:
17150 rts
17151
17152
17153
17154
17155
17156
17157ftrapcc_ngl:
17158 fbngl.w ftrapcc_ngl_yes
17159ftrapcc_ngl_no:
17160 rts
17161ftrapcc_ngl_yes:
17162 btst &nan_bit, FPSR_CC(%a6)
17163 beq.w ftrapcc_trap
17164 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17165 btst &bsun_bit, FPCR_ENABLE(%a6)
17166 bne.w ftrapcc_bsun
17167 bra.w ftrapcc_trap
17168
17169
17170
17171
17172
17173
17174ftrapcc_gle:
17175 fbgle.w ftrapcc_trap
17176ftrapcc_gle_no:
17177 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17178 btst &bsun_bit, FPCR_ENABLE(%a6)
17179 bne.w ftrapcc_bsun
17180 rts
17181
17182
17183
17184
17185
17186
17187ftrapcc_ngle:
17188 fbngle.w ftrapcc_ngle_yes
17189ftrapcc_ngle_no:
17190 rts
17191ftrapcc_ngle_yes:
17192 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17193 btst &bsun_bit, FPCR_ENABLE(%a6)
17194 bne.w ftrapcc_bsun
17195 bra.w ftrapcc_trap
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212ftrapcc_f:
17213 rts
17214
17215
17216
17217
17218
17219
17220ftrapcc_t:
17221 bra.w ftrapcc_trap
17222
17223
17224
17225
17226
17227
17228ftrapcc_sf:
17229 btst &nan_bit, FPSR_CC(%a6)
17230 beq.b ftrapcc_sf_done
17231 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17232 btst &bsun_bit, FPCR_ENABLE(%a6)
17233 bne.w ftrapcc_bsun
17234ftrapcc_sf_done:
17235 rts
17236
17237
17238
17239
17240
17241
17242ftrapcc_st:
17243 btst &nan_bit, FPSR_CC(%a6)
17244 beq.w ftrapcc_trap
17245 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17246 btst &bsun_bit, FPCR_ENABLE(%a6)
17247 bne.w ftrapcc_bsun
17248 bra.w ftrapcc_trap
17249
17250
17251
17252
17253
17254
17255ftrapcc_seq:
17256 fbseq.w ftrapcc_seq_yes
17257ftrapcc_seq_no:
17258 btst &nan_bit, FPSR_CC(%a6)
17259 beq.w ftrapcc_seq_done
17260 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17261 btst &bsun_bit, FPCR_ENABLE(%a6)
17262 bne.w ftrapcc_bsun
17263ftrapcc_seq_done:
17264 rts
17265ftrapcc_seq_yes:
17266 btst &nan_bit, FPSR_CC(%a6)
17267 beq.w ftrapcc_trap
17268 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17269 btst &bsun_bit, FPCR_ENABLE(%a6)
17270 bne.w ftrapcc_bsun
17271 bra.w ftrapcc_trap
17272
17273
17274
17275
17276
17277
17278ftrapcc_sneq:
17279 fbsneq.w ftrapcc_sneq_yes
17280ftrapcc_sneq_no:
17281 btst &nan_bit, FPSR_CC(%a6)
17282 beq.w ftrapcc_sneq_no_done
17283 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17284 btst &bsun_bit, FPCR_ENABLE(%a6)
17285 bne.w ftrapcc_bsun
17286ftrapcc_sneq_no_done:
17287 rts
17288ftrapcc_sneq_yes:
17289 btst &nan_bit, FPSR_CC(%a6)
17290 beq.w ftrapcc_trap
17291 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17292 btst &bsun_bit, FPCR_ENABLE(%a6)
17293 bne.w ftrapcc_bsun
17294 bra.w ftrapcc_trap
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311ftrapcc_ogt:
17312 fbogt.w ftrapcc_trap
17313ftrapcc_ogt_no:
17314 rts
17315
17316
17317
17318
17319
17320
17321ftrapcc_ule:
17322 fbule.w ftrapcc_trap
17323ftrapcc_ule_no:
17324 rts
17325
17326
17327
17328
17329
17330
17331ftrapcc_oge:
17332 fboge.w ftrapcc_trap
17333ftrapcc_oge_no:
17334 rts
17335
17336
17337
17338
17339
17340
17341ftrapcc_ult:
17342 fbult.w ftrapcc_trap
17343ftrapcc_ult_no:
17344 rts
17345
17346
17347
17348
17349
17350
17351ftrapcc_olt:
17352 fbolt.w ftrapcc_trap
17353ftrapcc_olt_no:
17354 rts
17355
17356
17357
17358
17359
17360
17361ftrapcc_uge:
17362 fbuge.w ftrapcc_trap
17363ftrapcc_uge_no:
17364 rts
17365
17366
17367
17368
17369
17370
17371ftrapcc_ole:
17372 fbole.w ftrapcc_trap
17373ftrapcc_ole_no:
17374 rts
17375
17376
17377
17378
17379
17380
17381ftrapcc_ugt:
17382 fbugt.w ftrapcc_trap
17383ftrapcc_ugt_no:
17384 rts
17385
17386
17387
17388
17389
17390
17391ftrapcc_ogl:
17392 fbogl.w ftrapcc_trap
17393ftrapcc_ogl_no:
17394 rts
17395
17396
17397
17398
17399
17400
17401ftrapcc_ueq:
17402 fbueq.w ftrapcc_trap
17403ftrapcc_ueq_no:
17404 rts
17405
17406
17407
17408
17409
17410
17411ftrapcc_or:
17412 fbor.w ftrapcc_trap
17413ftrapcc_or_no:
17414 rts
17415
17416
17417
17418
17419
17420
17421ftrapcc_un:
17422 fbun.w ftrapcc_trap
17423ftrapcc_un_no:
17424 rts
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434ftrapcc_trap:
17435 mov.b &ftrapcc_flg,SPCOND_FLG(%a6)
17436 rts
17437
17438
17439
17440
17441
17442ftrapcc_bsun:
17443 mov.b &fbsun_flg,SPCOND_FLG(%a6)
17444 rts
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478 global _fscc
17479_fscc:
17480 mov.w EXC_CMDREG(%a6),%d0
17481
17482 clr.l %d1
17483 mov.b FPSR_CC(%a6),%d1
17484 ror.l &0x8,%d1
17485 fmov.l %d1,%fpsr
17486
17487 mov.w (tbl_fscc.b,%pc,%d0.w*2),%d1
17488 jmp (tbl_fscc.b,%pc,%d1.w)
17489
17490tbl_fscc:
17491 short fscc_f - tbl_fscc
17492 short fscc_eq - tbl_fscc
17493 short fscc_ogt - tbl_fscc
17494 short fscc_oge - tbl_fscc
17495 short fscc_olt - tbl_fscc
17496 short fscc_ole - tbl_fscc
17497 short fscc_ogl - tbl_fscc
17498 short fscc_or - tbl_fscc
17499 short fscc_un - tbl_fscc
17500 short fscc_ueq - tbl_fscc
17501 short fscc_ugt - tbl_fscc
17502 short fscc_uge - tbl_fscc
17503 short fscc_ult - tbl_fscc
17504 short fscc_ule - tbl_fscc
17505 short fscc_neq - tbl_fscc
17506 short fscc_t - tbl_fscc
17507 short fscc_sf - tbl_fscc
17508 short fscc_seq - tbl_fscc
17509 short fscc_gt - tbl_fscc
17510 short fscc_ge - tbl_fscc
17511 short fscc_lt - tbl_fscc
17512 short fscc_le - tbl_fscc
17513 short fscc_gl - tbl_fscc
17514 short fscc_gle - tbl_fscc
17515 short fscc_ngle - tbl_fscc
17516 short fscc_ngl - tbl_fscc
17517 short fscc_nle - tbl_fscc
17518 short fscc_nlt - tbl_fscc
17519 short fscc_nge - tbl_fscc
17520 short fscc_ngt - tbl_fscc
17521 short fscc_sneq - tbl_fscc
17522 short fscc_st - tbl_fscc
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545fscc_eq:
17546 fbeq.w fscc_eq_yes
17547fscc_eq_no:
17548 clr.b %d0
17549 bra.w fscc_done
17550fscc_eq_yes:
17551 st %d0
17552 bra.w fscc_done
17553
17554
17555
17556
17557
17558
17559fscc_neq:
17560 fbneq.w fscc_neq_yes
17561fscc_neq_no:
17562 clr.b %d0
17563 bra.w fscc_done
17564fscc_neq_yes:
17565 st %d0
17566 bra.w fscc_done
17567
17568
17569
17570
17571
17572
17573fscc_gt:
17574 fbgt.w fscc_gt_yes
17575fscc_gt_no:
17576 clr.b %d0
17577 btst &nan_bit, FPSR_CC(%a6)
17578 beq.w fscc_done
17579 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17580 bra.w fscc_chk_bsun
17581fscc_gt_yes:
17582 st %d0
17583 bra.w fscc_done
17584
17585
17586
17587
17588
17589
17590fscc_ngt:
17591 fbngt.w fscc_ngt_yes
17592fscc_ngt_no:
17593 clr.b %d0
17594 bra.w fscc_done
17595fscc_ngt_yes:
17596 st %d0
17597 btst &nan_bit, FPSR_CC(%a6)
17598 beq.w fscc_done
17599 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17600 bra.w fscc_chk_bsun
17601
17602
17603
17604
17605
17606
17607fscc_ge:
17608 fbge.w fscc_ge_yes
17609fscc_ge_no:
17610 clr.b %d0
17611 btst &nan_bit, FPSR_CC(%a6)
17612 beq.w fscc_done
17613 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17614 bra.w fscc_chk_bsun
17615fscc_ge_yes:
17616 st %d0
17617 btst &nan_bit, FPSR_CC(%a6)
17618 beq.w fscc_done
17619 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17620 bra.w fscc_chk_bsun
17621
17622
17623
17624
17625
17626
17627fscc_nge:
17628 fbnge.w fscc_nge_yes
17629fscc_nge_no:
17630 clr.b %d0
17631 bra.w fscc_done
17632fscc_nge_yes:
17633 st %d0
17634 btst &nan_bit, FPSR_CC(%a6)
17635 beq.w fscc_done
17636 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17637 bra.w fscc_chk_bsun
17638
17639
17640
17641
17642
17643
17644fscc_lt:
17645 fblt.w fscc_lt_yes
17646fscc_lt_no:
17647 clr.b %d0
17648 btst &nan_bit, FPSR_CC(%a6)
17649 beq.w fscc_done
17650 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17651 bra.w fscc_chk_bsun
17652fscc_lt_yes:
17653 st %d0
17654 bra.w fscc_done
17655
17656
17657
17658
17659
17660
17661fscc_nlt:
17662 fbnlt.w fscc_nlt_yes
17663fscc_nlt_no:
17664 clr.b %d0
17665 bra.w fscc_done
17666fscc_nlt_yes:
17667 st %d0
17668 btst &nan_bit, FPSR_CC(%a6)
17669 beq.w fscc_done
17670 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17671 bra.w fscc_chk_bsun
17672
17673
17674
17675
17676
17677
17678fscc_le:
17679 fble.w fscc_le_yes
17680fscc_le_no:
17681 clr.b %d0
17682 btst &nan_bit, FPSR_CC(%a6)
17683 beq.w fscc_done
17684 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17685 bra.w fscc_chk_bsun
17686fscc_le_yes:
17687 st %d0
17688 btst &nan_bit, FPSR_CC(%a6)
17689 beq.w fscc_done
17690 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17691 bra.w fscc_chk_bsun
17692
17693
17694
17695
17696
17697
17698fscc_nle:
17699 fbnle.w fscc_nle_yes
17700fscc_nle_no:
17701 clr.b %d0
17702 bra.w fscc_done
17703fscc_nle_yes:
17704 st %d0
17705 btst &nan_bit, FPSR_CC(%a6)
17706 beq.w fscc_done
17707 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17708 bra.w fscc_chk_bsun
17709
17710
17711
17712
17713
17714
17715fscc_gl:
17716 fbgl.w fscc_gl_yes
17717fscc_gl_no:
17718 clr.b %d0
17719 btst &nan_bit, FPSR_CC(%a6)
17720 beq.w fscc_done
17721 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17722 bra.w fscc_chk_bsun
17723fscc_gl_yes:
17724 st %d0
17725 bra.w fscc_done
17726
17727
17728
17729
17730
17731
17732fscc_ngl:
17733 fbngl.w fscc_ngl_yes
17734fscc_ngl_no:
17735 clr.b %d0
17736 bra.w fscc_done
17737fscc_ngl_yes:
17738 st %d0
17739 btst &nan_bit, FPSR_CC(%a6)
17740 beq.w fscc_done
17741 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17742 bra.w fscc_chk_bsun
17743
17744
17745
17746
17747
17748
17749fscc_gle:
17750 fbgle.w fscc_gle_yes
17751fscc_gle_no:
17752 clr.b %d0
17753 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17754 bra.w fscc_chk_bsun
17755fscc_gle_yes:
17756 st %d0
17757 bra.w fscc_done
17758
17759
17760
17761
17762
17763
17764fscc_ngle:
17765 fbngle.w fscc_ngle_yes
17766fscc_ngle_no:
17767 clr.b %d0
17768 bra.w fscc_done
17769fscc_ngle_yes:
17770 st %d0
17771 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17772 bra.w fscc_chk_bsun
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789fscc_f:
17790 clr.b %d0
17791 bra.w fscc_done
17792
17793
17794
17795
17796
17797
17798fscc_t:
17799 st %d0
17800 bra.w fscc_done
17801
17802
17803
17804
17805
17806
17807fscc_sf:
17808 clr.b %d0
17809 btst &nan_bit, FPSR_CC(%a6)
17810 beq.w fscc_done
17811 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17812 bra.w fscc_chk_bsun
17813
17814
17815
17816
17817
17818
17819fscc_st:
17820 st %d0
17821 btst &nan_bit, FPSR_CC(%a6)
17822 beq.w fscc_done
17823 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17824 bra.w fscc_chk_bsun
17825
17826
17827
17828
17829
17830
17831fscc_seq:
17832 fbseq.w fscc_seq_yes
17833fscc_seq_no:
17834 clr.b %d0
17835 btst &nan_bit, FPSR_CC(%a6)
17836 beq.w fscc_done
17837 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17838 bra.w fscc_chk_bsun
17839fscc_seq_yes:
17840 st %d0
17841 btst &nan_bit, FPSR_CC(%a6)
17842 beq.w fscc_done
17843 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17844 bra.w fscc_chk_bsun
17845
17846
17847
17848
17849
17850
17851fscc_sneq:
17852 fbsneq.w fscc_sneq_yes
17853fscc_sneq_no:
17854 clr.b %d0
17855 btst &nan_bit, FPSR_CC(%a6)
17856 beq.w fscc_done
17857 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17858 bra.w fscc_chk_bsun
17859fscc_sneq_yes:
17860 st %d0
17861 btst &nan_bit, FPSR_CC(%a6)
17862 beq.w fscc_done
17863 ori.l &bsun_mask+aiop_mask, USER_FPSR(%a6)
17864 bra.w fscc_chk_bsun
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881fscc_ogt:
17882 fbogt.w fscc_ogt_yes
17883fscc_ogt_no:
17884 clr.b %d0
17885 bra.w fscc_done
17886fscc_ogt_yes:
17887 st %d0
17888 bra.w fscc_done
17889
17890
17891
17892
17893
17894
17895fscc_ule:
17896 fbule.w fscc_ule_yes
17897fscc_ule_no:
17898 clr.b %d0
17899 bra.w fscc_done
17900fscc_ule_yes:
17901 st %d0
17902 bra.w fscc_done
17903
17904
17905
17906
17907
17908
17909fscc_oge:
17910 fboge.w fscc_oge_yes
17911fscc_oge_no:
17912 clr.b %d0
17913 bra.w fscc_done
17914fscc_oge_yes:
17915 st %d0
17916 bra.w fscc_done
17917
17918
17919
17920
17921
17922
17923fscc_ult:
17924 fbult.w fscc_ult_yes
17925fscc_ult_no:
17926 clr.b %d0
17927 bra.w fscc_done
17928fscc_ult_yes:
17929 st %d0
17930 bra.w fscc_done
17931
17932
17933
17934
17935
17936
17937fscc_olt:
17938 fbolt.w fscc_olt_yes
17939fscc_olt_no:
17940 clr.b %d0
17941 bra.w fscc_done
17942fscc_olt_yes:
17943 st %d0
17944 bra.w fscc_done
17945
17946
17947
17948
17949
17950
17951fscc_uge:
17952 fbuge.w fscc_uge_yes
17953fscc_uge_no:
17954 clr.b %d0
17955 bra.w fscc_done
17956fscc_uge_yes:
17957 st %d0
17958 bra.w fscc_done
17959
17960
17961
17962
17963
17964
17965fscc_ole:
17966 fbole.w fscc_ole_yes
17967fscc_ole_no:
17968 clr.b %d0
17969 bra.w fscc_done
17970fscc_ole_yes:
17971 st %d0
17972 bra.w fscc_done
17973
17974
17975
17976
17977
17978
17979fscc_ugt:
17980 fbugt.w fscc_ugt_yes
17981fscc_ugt_no:
17982 clr.b %d0
17983 bra.w fscc_done
17984fscc_ugt_yes:
17985 st %d0
17986 bra.w fscc_done
17987
17988
17989
17990
17991
17992
17993fscc_ogl:
17994 fbogl.w fscc_ogl_yes
17995fscc_ogl_no:
17996 clr.b %d0
17997 bra.w fscc_done
17998fscc_ogl_yes:
17999 st %d0
18000 bra.w fscc_done
18001
18002
18003
18004
18005
18006
18007fscc_ueq:
18008 fbueq.w fscc_ueq_yes
18009fscc_ueq_no:
18010 clr.b %d0
18011 bra.w fscc_done
18012fscc_ueq_yes:
18013 st %d0
18014 bra.w fscc_done
18015
18016
18017
18018
18019
18020
18021fscc_or:
18022 fbor.w fscc_or_yes
18023fscc_or_no:
18024 clr.b %d0
18025 bra.w fscc_done
18026fscc_or_yes:
18027 st %d0
18028 bra.w fscc_done
18029
18030
18031
18032
18033
18034
18035fscc_un:
18036 fbun.w fscc_un_yes
18037fscc_un_no:
18038 clr.b %d0
18039 bra.w fscc_done
18040fscc_un_yes:
18041 st %d0
18042 bra.w fscc_done
18043
18044
18045
18046
18047
18048
18049
18050
18051fscc_chk_bsun:
18052 btst &bsun_bit,FPCR_ENABLE(%a6)
18053 bne.w fscc_bsun
18054
18055
18056
18057
18058
18059
18060
18061fscc_done:
18062 mov.l %d0,%a0
18063
18064 mov.b 1+EXC_OPWORD(%a6),%d1
18065 mov.l %d1,%d0
18066 andi.b &0x38,%d1
18067
18068 bne.b fscc_mem_op
18069
18070 mov.l %d0,%d1
18071 andi.w &0x7,%d1
18072 mov.l %a0,%d0
18073 bsr.l store_dreg_b
18074 rts
18075
18076
18077
18078
18079
18080
18081
18082
18083fscc_mem_op:
18084 cmpi.b %d1,&0x18
18085 beq.b fscc_mem_inc
18086 cmpi.b %d1,&0x20
18087 beq.b fscc_mem_dec
18088
18089 mov.l %a0,%d0
18090 mov.l EXC_EA(%a6),%a0
18091 bsr.l _dmem_write_byte
18092
18093 tst.l %d1
18094 bne.w fscc_err
18095
18096 rts
18097
18098
18099
18100
18101fscc_mem_inc:
18102 mov.l %a0,%d0
18103 mov.l EXC_EA(%a6),%a0
18104 bsr.l _dmem_write_byte
18105
18106 tst.l %d1
18107 bne.w fscc_err
18108
18109 mov.b 0x1+EXC_OPWORD(%a6),%d1
18110 andi.w &0x7,%d1
18111 movq.l &0x1,%d0
18112 bsr.l inc_areg
18113
18114 rts
18115
18116
18117
18118
18119fscc_mem_dec:
18120 mov.l %a0,%d0
18121 mov.l EXC_EA(%a6),%a0
18122 bsr.l _dmem_write_byte
18123
18124 tst.l %d1
18125 bne.w fscc_err
18126
18127 mov.b 0x1+EXC_OPWORD(%a6),%d1
18128 andi.w &0x7,%d1
18129 movq.l &0x1,%d0
18130 bsr.l dec_areg
18131
18132 rts
18133
18134
18135
18136
18137
18138fscc_bsun:
18139 mov.b &fbsun_flg,SPCOND_FLG(%a6)
18140 rts
18141
18142
18143
18144fscc_err:
18145 mov.w &0x00a1,EXC_VOFF(%a6)
18146 bra.l facc_finish
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215 global fmovm_dynamic
18216fmovm_dynamic:
18217
18218
18219 mov.b 1+EXC_EXTWORD(%a6),%d1
18220 andi.w &0x70,%d1
18221 lsr.b &0x4,%d1
18222
18223
18224 bsr.l fetch_dreg
18225
18226 andi.l &0x000000ff,%d0
18227
18228 mov.l %d0,-(%sp)
18229 mov.b (tbl_fmovm_size.w,%pc,%d0),%d0
18230 mov.l %d0,-(%sp)
18231 bsr.l fmovm_calc_ea
18232 mov.l (%sp)+,%d0
18233 mov.l (%sp)+,%d1
18234
18235
18236
18237 beq.w fmovm_data_done
18238
18239
18240 btst &0x5,EXC_EXTWORD(%a6)
18241 beq.w fmovm_data_in
18242
18243
18244
18245
18246fmovm_data_out:
18247 btst &0x4,EXC_EXTWORD(%a6)
18248 bne.w fmovm_out_ctrl
18249
18250
18251fmovm_out_predec:
18252
18253
18254
18255 mov.b (tbl_fmovm_convert.w,%pc,%d1.w*1),%d1
18256
18257 btst &0x5,EXC_SR(%a6)
18258 beq.b fmovm_out_ctrl
18259
18260fmovm_out_predec_s:
18261 cmpi.b SPCOND_FLG(%a6),&mda7_flg
18262 bne.b fmovm_out_ctrl
18263
18264
18265
18266
18267 rts
18268
18269
18270fmovm_out_ctrl:
18271 mov.l %a0,%a1
18272
18273 sub.l %d0,%sp
18274 lea (%sp),%a0
18275
18276 tst.b %d1
18277 bpl.b fmovm_out_ctrl_fp1
18278
18279 mov.l 0x0+EXC_FP0(%a6),(%a0)+
18280 mov.l 0x4+EXC_FP0(%a6),(%a0)+
18281 mov.l 0x8+EXC_FP0(%a6),(%a0)+
18282
18283fmovm_out_ctrl_fp1:
18284 lsl.b &0x1,%d1
18285 bpl.b fmovm_out_ctrl_fp2
18286
18287 mov.l 0x0+EXC_FP1(%a6),(%a0)+
18288 mov.l 0x4+EXC_FP1(%a6),(%a0)+
18289 mov.l 0x8+EXC_FP1(%a6),(%a0)+
18290
18291fmovm_out_ctrl_fp2:
18292 lsl.b &0x1,%d1
18293 bpl.b fmovm_out_ctrl_fp3
18294
18295 fmovm.x &0x20,(%a0)
18296 add.l &0xc,%a0
18297
18298fmovm_out_ctrl_fp3:
18299 lsl.b &0x1,%d1
18300 bpl.b fmovm_out_ctrl_fp4
18301
18302 fmovm.x &0x10,(%a0)
18303 add.l &0xc,%a0
18304
18305fmovm_out_ctrl_fp4:
18306 lsl.b &0x1,%d1
18307 bpl.b fmovm_out_ctrl_fp5
18308
18309 fmovm.x &0x08,(%a0)
18310 add.l &0xc,%a0
18311
18312fmovm_out_ctrl_fp5:
18313 lsl.b &0x1,%d1
18314 bpl.b fmovm_out_ctrl_fp6
18315
18316 fmovm.x &0x04,(%a0)
18317 add.l &0xc,%a0
18318
18319fmovm_out_ctrl_fp6:
18320 lsl.b &0x1,%d1
18321 bpl.b fmovm_out_ctrl_fp7
18322
18323 fmovm.x &0x02,(%a0)
18324 add.l &0xc,%a0
18325
18326fmovm_out_ctrl_fp7:
18327 lsl.b &0x1,%d1
18328 bpl.b fmovm_out_ctrl_done
18329
18330 fmovm.x &0x01,(%a0)
18331 add.l &0xc,%a0
18332
18333fmovm_out_ctrl_done:
18334 mov.l %a1,L_SCR1(%a6)
18335
18336 lea (%sp),%a0
18337 mov.l %d0,-(%sp)
18338 bsr.l _dmem_write
18339
18340 mov.l (%sp)+,%d0
18341 add.l %d0,%sp
18342
18343 tst.l %d1
18344 bne.w fmovm_out_err
18345
18346 rts
18347
18348
18349
18350
18351fmovm_data_in:
18352 mov.l %a0,L_SCR1(%a6)
18353
18354 sub.l %d0,%sp
18355 lea (%sp),%a1
18356
18357 mov.l %d1,-(%sp)
18358 mov.l %d0,-(%sp)
18359
18360 bsr.l _dmem_read
18361
18362 mov.l (%sp)+,%d0
18363
18364 tst.l %d1
18365 bne.w fmovm_in_err
18366
18367 mov.l (%sp)+,%d1
18368
18369 lea (%sp),%a0
18370
18371 tst.b %d1
18372 bpl.b fmovm_data_in_fp1
18373
18374 mov.l (%a0)+,0x0+EXC_FP0(%a6)
18375 mov.l (%a0)+,0x4+EXC_FP0(%a6)
18376 mov.l (%a0)+,0x8+EXC_FP0(%a6)
18377
18378fmovm_data_in_fp1:
18379 lsl.b &0x1,%d1
18380 bpl.b fmovm_data_in_fp2
18381
18382 mov.l (%a0)+,0x0+EXC_FP1(%a6)
18383 mov.l (%a0)+,0x4+EXC_FP1(%a6)
18384 mov.l (%a0)+,0x8+EXC_FP1(%a6)
18385
18386fmovm_data_in_fp2:
18387 lsl.b &0x1,%d1
18388 bpl.b fmovm_data_in_fp3
18389
18390 fmovm.x (%a0)+,&0x20
18391
18392fmovm_data_in_fp3:
18393 lsl.b &0x1,%d1
18394 bpl.b fmovm_data_in_fp4
18395
18396 fmovm.x (%a0)+,&0x10
18397
18398fmovm_data_in_fp4:
18399 lsl.b &0x1,%d1
18400 bpl.b fmovm_data_in_fp5
18401
18402 fmovm.x (%a0)+,&0x08
18403
18404fmovm_data_in_fp5:
18405 lsl.b &0x1,%d1
18406 bpl.b fmovm_data_in_fp6
18407
18408 fmovm.x (%a0)+,&0x04
18409
18410fmovm_data_in_fp6:
18411 lsl.b &0x1,%d1
18412 bpl.b fmovm_data_in_fp7
18413
18414 fmovm.x (%a0)+,&0x02
18415
18416fmovm_data_in_fp7:
18417 lsl.b &0x1,%d1
18418 bpl.b fmovm_data_in_done
18419
18420 fmovm.x (%a0)+,&0x01
18421
18422fmovm_data_in_done:
18423 add.l %d0,%sp
18424 rts
18425
18426
18427
18428fmovm_data_done:
18429 rts
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439tbl_fmovm_size:
18440 byte 0x00,0x0c,0x0c,0x18,0x0c,0x18,0x18,0x24
18441 byte 0x0c,0x18,0x18,0x24,0x18,0x24,0x24,0x30
18442 byte 0x0c,0x18,0x18,0x24,0x18,0x24,0x24,0x30
18443 byte 0x18,0x24,0x24,0x30,0x24,0x30,0x30,0x3c
18444 byte 0x0c,0x18,0x18,0x24,0x18,0x24,0x24,0x30
18445 byte 0x18,0x24,0x24,0x30,0x24,0x30,0x30,0x3c
18446 byte 0x18,0x24,0x24,0x30,0x24,0x30,0x30,0x3c
18447 byte 0x24,0x30,0x30,0x3c,0x30,0x3c,0x3c,0x48
18448 byte 0x0c,0x18,0x18,0x24,0x18,0x24,0x24,0x30
18449 byte 0x18,0x24,0x24,0x30,0x24,0x30,0x30,0x3c
18450 byte 0x18,0x24,0x24,0x30,0x24,0x30,0x30,0x3c
18451 byte 0x24,0x30,0x30,0x3c,0x30,0x3c,0x3c,0x48
18452 byte 0x18,0x24,0x24,0x30,0x24,0x30,0x30,0x3c
18453 byte 0x24,0x30,0x30,0x3c,0x30,0x3c,0x3c,0x48
18454 byte 0x24,0x30,0x30,0x3c,0x30,0x3c,0x3c,0x48
18455 byte 0x30,0x3c,0x3c,0x48,0x3c,0x48,0x48,0x54
18456 byte 0x0c,0x18,0x18,0x24,0x18,0x24,0x24,0x30
18457 byte 0x18,0x24,0x24,0x30,0x24,0x30,0x30,0x3c
18458 byte 0x18,0x24,0x24,0x30,0x24,0x30,0x30,0x3c
18459 byte 0x24,0x30,0x30,0x3c,0x30,0x3c,0x3c,0x48
18460 byte 0x18,0x24,0x24,0x30,0x24,0x30,0x30,0x3c
18461 byte 0x24,0x30,0x30,0x3c,0x30,0x3c,0x3c,0x48
18462 byte 0x24,0x30,0x30,0x3c,0x30,0x3c,0x3c,0x48
18463 byte 0x30,0x3c,0x3c,0x48,0x3c,0x48,0x48,0x54
18464 byte 0x18,0x24,0x24,0x30,0x24,0x30,0x30,0x3c
18465 byte 0x24,0x30,0x30,0x3c,0x30,0x3c,0x3c,0x48
18466 byte 0x24,0x30,0x30,0x3c,0x30,0x3c,0x3c,0x48
18467 byte 0x30,0x3c,0x3c,0x48,0x3c,0x48,0x48,0x54
18468 byte 0x24,0x30,0x30,0x3c,0x30,0x3c,0x3c,0x48
18469 byte 0x30,0x3c,0x3c,0x48,0x3c,0x48,0x48,0x54
18470 byte 0x30,0x3c,0x3c,0x48,0x3c,0x48,0x48,0x54
18471 byte 0x3c,0x48,0x48,0x54,0x48,0x54,0x54,0x60
18472
18473
18474
18475
18476
18477
18478
18479
18480
18481
18482
18483
18484
18485tbl_fmovm_convert:
18486 byte 0x00,0x80,0x40,0xc0,0x20,0xa0,0x60,0xe0
18487 byte 0x10,0x90,0x50,0xd0,0x30,0xb0,0x70,0xf0
18488 byte 0x08,0x88,0x48,0xc8,0x28,0xa8,0x68,0xe8
18489 byte 0x18,0x98,0x58,0xd8,0x38,0xb8,0x78,0xf8
18490 byte 0x04,0x84,0x44,0xc4,0x24,0xa4,0x64,0xe4
18491 byte 0x14,0x94,0x54,0xd4,0x34,0xb4,0x74,0xf4
18492 byte 0x0c,0x8c,0x4c,0xcc,0x2c,0xac,0x6c,0xec
18493 byte 0x1c,0x9c,0x5c,0xdc,0x3c,0xbc,0x7c,0xfc
18494 byte 0x02,0x82,0x42,0xc2,0x22,0xa2,0x62,0xe2
18495 byte 0x12,0x92,0x52,0xd2,0x32,0xb2,0x72,0xf2
18496 byte 0x0a,0x8a,0x4a,0xca,0x2a,0xaa,0x6a,0xea
18497 byte 0x1a,0x9a,0x5a,0xda,0x3a,0xba,0x7a,0xfa
18498 byte 0x06,0x86,0x46,0xc6,0x26,0xa6,0x66,0xe6
18499 byte 0x16,0x96,0x56,0xd6,0x36,0xb6,0x76,0xf6
18500 byte 0x0e,0x8e,0x4e,0xce,0x2e,0xae,0x6e,0xee
18501 byte 0x1e,0x9e,0x5e,0xde,0x3e,0xbe,0x7e,0xfe
18502 byte 0x01,0x81,0x41,0xc1,0x21,0xa1,0x61,0xe1
18503 byte 0x11,0x91,0x51,0xd1,0x31,0xb1,0x71,0xf1
18504 byte 0x09,0x89,0x49,0xc9,0x29,0xa9,0x69,0xe9
18505 byte 0x19,0x99,0x59,0xd9,0x39,0xb9,0x79,0xf9
18506 byte 0x05,0x85,0x45,0xc5,0x25,0xa5,0x65,0xe5
18507 byte 0x15,0x95,0x55,0xd5,0x35,0xb5,0x75,0xf5
18508 byte 0x0d,0x8d,0x4d,0xcd,0x2d,0xad,0x6d,0xed
18509 byte 0x1d,0x9d,0x5d,0xdd,0x3d,0xbd,0x7d,0xfd
18510 byte 0x03,0x83,0x43,0xc3,0x23,0xa3,0x63,0xe3
18511 byte 0x13,0x93,0x53,0xd3,0x33,0xb3,0x73,0xf3
18512 byte 0x0b,0x8b,0x4b,0xcb,0x2b,0xab,0x6b,0xeb
18513 byte 0x1b,0x9b,0x5b,0xdb,0x3b,0xbb,0x7b,0xfb
18514 byte 0x07,0x87,0x47,0xc7,0x27,0xa7,0x67,0xe7
18515 byte 0x17,0x97,0x57,0xd7,0x37,0xb7,0x77,0xf7
18516 byte 0x0f,0x8f,0x4f,0xcf,0x2f,0xaf,0x6f,0xef
18517 byte 0x1f,0x9f,0x5f,0xdf,0x3f,0xbf,0x7f,0xff
18518
18519 global fmovm_calc_ea
18520
18521
18522
18523fmovm_calc_ea:
18524 mov.l %d0,%a0
18525
18526
18527
18528 mov.w EXC_OPWORD(%a6),%d0
18529 mov.w %d0,%d1
18530
18531 andi.w &0x3f,%d0
18532 andi.l &0x7,%d1
18533
18534
18535 mov.w (tbl_fea_mode.b,%pc,%d0.w*2),%d0
18536 jmp (tbl_fea_mode.b,%pc,%d0.w*1)
18537
18538 swbeg &64
18539tbl_fea_mode:
18540 short tbl_fea_mode - tbl_fea_mode
18541 short tbl_fea_mode - tbl_fea_mode
18542 short tbl_fea_mode - tbl_fea_mode
18543 short tbl_fea_mode - tbl_fea_mode
18544 short tbl_fea_mode - tbl_fea_mode
18545 short tbl_fea_mode - tbl_fea_mode
18546 short tbl_fea_mode - tbl_fea_mode
18547 short tbl_fea_mode - tbl_fea_mode
18548
18549 short tbl_fea_mode - tbl_fea_mode
18550 short tbl_fea_mode - tbl_fea_mode
18551 short tbl_fea_mode - tbl_fea_mode
18552 short tbl_fea_mode - tbl_fea_mode
18553 short tbl_fea_mode - tbl_fea_mode
18554 short tbl_fea_mode - tbl_fea_mode
18555 short tbl_fea_mode - tbl_fea_mode
18556 short tbl_fea_mode - tbl_fea_mode
18557
18558 short faddr_ind_a0 - tbl_fea_mode
18559 short faddr_ind_a1 - tbl_fea_mode
18560 short faddr_ind_a2 - tbl_fea_mode
18561 short faddr_ind_a3 - tbl_fea_mode
18562 short faddr_ind_a4 - tbl_fea_mode
18563 short faddr_ind_a5 - tbl_fea_mode
18564 short faddr_ind_a6 - tbl_fea_mode
18565 short faddr_ind_a7 - tbl_fea_mode
18566
18567 short faddr_ind_p_a0 - tbl_fea_mode
18568 short faddr_ind_p_a1 - tbl_fea_mode
18569 short faddr_ind_p_a2 - tbl_fea_mode
18570 short faddr_ind_p_a3 - tbl_fea_mode
18571 short faddr_ind_p_a4 - tbl_fea_mode
18572 short faddr_ind_p_a5 - tbl_fea_mode
18573 short faddr_ind_p_a6 - tbl_fea_mode
18574 short faddr_ind_p_a7 - tbl_fea_mode
18575
18576 short faddr_ind_m_a0 - tbl_fea_mode
18577 short faddr_ind_m_a1 - tbl_fea_mode
18578 short faddr_ind_m_a2 - tbl_fea_mode
18579 short faddr_ind_m_a3 - tbl_fea_mode
18580 short faddr_ind_m_a4 - tbl_fea_mode
18581 short faddr_ind_m_a5 - tbl_fea_mode
18582 short faddr_ind_m_a6 - tbl_fea_mode
18583 short faddr_ind_m_a7 - tbl_fea_mode
18584
18585 short faddr_ind_disp_a0 - tbl_fea_mode
18586 short faddr_ind_disp_a1 - tbl_fea_mode
18587 short faddr_ind_disp_a2 - tbl_fea_mode
18588 short faddr_ind_disp_a3 - tbl_fea_mode
18589 short faddr_ind_disp_a4 - tbl_fea_mode
18590 short faddr_ind_disp_a5 - tbl_fea_mode
18591 short faddr_ind_disp_a6 - tbl_fea_mode
18592 short faddr_ind_disp_a7 - tbl_fea_mode
18593
18594 short faddr_ind_ext - tbl_fea_mode
18595 short faddr_ind_ext - tbl_fea_mode
18596 short faddr_ind_ext - tbl_fea_mode
18597 short faddr_ind_ext - tbl_fea_mode
18598 short faddr_ind_ext - tbl_fea_mode
18599 short faddr_ind_ext - tbl_fea_mode
18600 short faddr_ind_ext - tbl_fea_mode
18601 short faddr_ind_ext - tbl_fea_mode
18602
18603 short fabs_short - tbl_fea_mode
18604 short fabs_long - tbl_fea_mode
18605 short fpc_ind - tbl_fea_mode
18606 short fpc_ind_ext - tbl_fea_mode
18607 short tbl_fea_mode - tbl_fea_mode
18608 short tbl_fea_mode - tbl_fea_mode
18609 short tbl_fea_mode - tbl_fea_mode
18610 short tbl_fea_mode - tbl_fea_mode
18611
18612
18613
18614
18615faddr_ind_a0:
18616 mov.l EXC_DREGS+0x8(%a6),%a0
18617 rts
18618
18619faddr_ind_a1:
18620 mov.l EXC_DREGS+0xc(%a6),%a0
18621 rts
18622
18623faddr_ind_a2:
18624 mov.l %a2,%a0
18625 rts
18626
18627faddr_ind_a3:
18628 mov.l %a3,%a0
18629 rts
18630
18631faddr_ind_a4:
18632 mov.l %a4,%a0
18633 rts
18634
18635faddr_ind_a5:
18636 mov.l %a5,%a0
18637 rts
18638
18639faddr_ind_a6:
18640 mov.l (%a6),%a0
18641 rts
18642
18643faddr_ind_a7:
18644 mov.l EXC_A7(%a6),%a0
18645 rts
18646
18647
18648
18649
18650faddr_ind_p_a0:
18651 mov.l EXC_DREGS+0x8(%a6),%d0
18652 mov.l %d0,%d1
18653 add.l %a0,%d1
18654 mov.l %d1,EXC_DREGS+0x8(%a6)
18655 mov.l %d0,%a0
18656 rts
18657
18658faddr_ind_p_a1:
18659 mov.l EXC_DREGS+0xc(%a6),%d0
18660 mov.l %d0,%d1
18661 add.l %a0,%d1
18662 mov.l %d1,EXC_DREGS+0xc(%a6)
18663 mov.l %d0,%a0
18664 rts
18665
18666faddr_ind_p_a2:
18667 mov.l %a2,%d0
18668 mov.l %d0,%d1
18669 add.l %a0,%d1
18670 mov.l %d1,%a2
18671 mov.l %d0,%a0
18672 rts
18673
18674faddr_ind_p_a3:
18675 mov.l %a3,%d0
18676 mov.l %d0,%d1
18677 add.l %a0,%d1
18678 mov.l %d1,%a3
18679 mov.l %d0,%a0
18680 rts
18681
18682faddr_ind_p_a4:
18683 mov.l %a4,%d0
18684 mov.l %d0,%d1
18685 add.l %a0,%d1
18686 mov.l %d1,%a4
18687 mov.l %d0,%a0
18688 rts
18689
18690faddr_ind_p_a5:
18691 mov.l %a5,%d0
18692 mov.l %d0,%d1
18693 add.l %a0,%d1
18694 mov.l %d1,%a5
18695 mov.l %d0,%a0
18696 rts
18697
18698faddr_ind_p_a6:
18699 mov.l (%a6),%d0
18700 mov.l %d0,%d1
18701 add.l %a0,%d1
18702 mov.l %d1,(%a6)
18703 mov.l %d0,%a0
18704 rts
18705
18706faddr_ind_p_a7:
18707 mov.b &mia7_flg,SPCOND_FLG(%a6)
18708
18709 mov.l EXC_A7(%a6),%d0
18710 mov.l %d0,%d1
18711 add.l %a0,%d1
18712 mov.l %d1,EXC_A7(%a6)
18713 mov.l %d0,%a0
18714 rts
18715
18716
18717
18718
18719faddr_ind_m_a0:
18720 mov.l EXC_DREGS+0x8(%a6),%d0
18721 sub.l %a0,%d0
18722 mov.l %d0,EXC_DREGS+0x8(%a6)
18723 mov.l %d0,%a0
18724 rts
18725
18726faddr_ind_m_a1:
18727 mov.l EXC_DREGS+0xc(%a6),%d0
18728 sub.l %a0,%d0
18729 mov.l %d0,EXC_DREGS+0xc(%a6)
18730 mov.l %d0,%a0
18731 rts
18732
18733faddr_ind_m_a2:
18734 mov.l %a2,%d0
18735 sub.l %a0,%d0
18736 mov.l %d0,%a2
18737 mov.l %d0,%a0
18738 rts
18739
18740faddr_ind_m_a3:
18741 mov.l %a3,%d0
18742 sub.l %a0,%d0
18743 mov.l %d0,%a3
18744 mov.l %d0,%a0
18745 rts
18746
18747faddr_ind_m_a4:
18748 mov.l %a4,%d0
18749 sub.l %a0,%d0
18750 mov.l %d0,%a4
18751 mov.l %d0,%a0
18752 rts
18753
18754faddr_ind_m_a5:
18755 mov.l %a5,%d0
18756 sub.l %a0,%d0
18757 mov.l %d0,%a5
18758 mov.l %d0,%a0
18759 rts
18760
18761faddr_ind_m_a6:
18762 mov.l (%a6),%d0
18763 sub.l %a0,%d0
18764 mov.l %d0,(%a6)
18765 mov.l %d0,%a0
18766 rts
18767
18768faddr_ind_m_a7:
18769 mov.b &mda7_flg,SPCOND_FLG(%a6)
18770
18771 mov.l EXC_A7(%a6),%d0
18772 sub.l %a0,%d0
18773 mov.l %d0,EXC_A7(%a6)
18774 mov.l %d0,%a0
18775 rts
18776
18777
18778
18779
18780faddr_ind_disp_a0:
18781 mov.l EXC_EXTWPTR(%a6),%a0
18782 addq.l &0x2,EXC_EXTWPTR(%a6)
18783 bsr.l _imem_read_word
18784
18785 tst.l %d1
18786 bne.l iea_iacc
18787
18788 mov.w %d0,%a0
18789
18790 add.l EXC_DREGS+0x8(%a6),%a0
18791 rts
18792
18793faddr_ind_disp_a1:
18794 mov.l EXC_EXTWPTR(%a6),%a0
18795 addq.l &0x2,EXC_EXTWPTR(%a6)
18796 bsr.l _imem_read_word
18797
18798 tst.l %d1
18799 bne.l iea_iacc
18800
18801 mov.w %d0,%a0
18802
18803 add.l EXC_DREGS+0xc(%a6),%a0
18804 rts
18805
18806faddr_ind_disp_a2:
18807 mov.l EXC_EXTWPTR(%a6),%a0
18808 addq.l &0x2,EXC_EXTWPTR(%a6)
18809 bsr.l _imem_read_word
18810
18811 tst.l %d1
18812 bne.l iea_iacc
18813
18814 mov.w %d0,%a0
18815
18816 add.l %a2,%a0
18817 rts
18818
18819faddr_ind_disp_a3:
18820 mov.l EXC_EXTWPTR(%a6),%a0
18821 addq.l &0x2,EXC_EXTWPTR(%a6)
18822 bsr.l _imem_read_word
18823
18824 tst.l %d1
18825 bne.l iea_iacc
18826
18827 mov.w %d0,%a0
18828
18829 add.l %a3,%a0
18830 rts
18831
18832faddr_ind_disp_a4:
18833 mov.l EXC_EXTWPTR(%a6),%a0
18834 addq.l &0x2,EXC_EXTWPTR(%a6)
18835 bsr.l _imem_read_word
18836
18837 tst.l %d1
18838 bne.l iea_iacc
18839
18840 mov.w %d0,%a0
18841
18842 add.l %a4,%a0
18843 rts
18844
18845faddr_ind_disp_a5:
18846 mov.l EXC_EXTWPTR(%a6),%a0
18847 addq.l &0x2,EXC_EXTWPTR(%a6)
18848 bsr.l _imem_read_word
18849
18850 tst.l %d1
18851 bne.l iea_iacc
18852
18853 mov.w %d0,%a0
18854
18855 add.l %a5,%a0
18856 rts
18857
18858faddr_ind_disp_a6:
18859 mov.l EXC_EXTWPTR(%a6),%a0
18860 addq.l &0x2,EXC_EXTWPTR(%a6)
18861 bsr.l _imem_read_word
18862
18863 tst.l %d1
18864 bne.l iea_iacc
18865
18866 mov.w %d0,%a0
18867
18868 add.l (%a6),%a0
18869 rts
18870
18871faddr_ind_disp_a7:
18872 mov.l EXC_EXTWPTR(%a6),%a0
18873 addq.l &0x2,EXC_EXTWPTR(%a6)
18874 bsr.l _imem_read_word
18875
18876 tst.l %d1
18877 bne.l iea_iacc
18878
18879 mov.w %d0,%a0
18880
18881 add.l EXC_A7(%a6),%a0
18882 rts
18883
18884
18885
18886
18887
18888
18889
18890faddr_ind_ext:
18891 addq.l &0x8,%d1
18892 bsr.l fetch_dreg
18893 mov.l %d0,-(%sp)
18894
18895 mov.l EXC_EXTWPTR(%a6),%a0
18896 addq.l &0x2,EXC_EXTWPTR(%a6)
18897 bsr.l _imem_read_word
18898
18899 tst.l %d1
18900 bne.l iea_iacc
18901
18902 mov.l (%sp)+,%a0
18903
18904 btst &0x8,%d0
18905 bne.w fcalc_mem_ind
18906
18907 mov.l %d0,L_SCR1(%a6)
18908
18909 mov.l %d0,%d1
18910 rol.w &0x4,%d1
18911 andi.w &0xf,%d1
18912
18913
18914 bsr.l fetch_dreg
18915
18916 mov.l %d2,-(%sp)
18917 mov.l L_SCR1(%a6),%d2
18918
18919 btst &0xb,%d2
18920 bne.b faii8_long
18921 ext.l %d0
18922faii8_long:
18923 mov.l %d2,%d1
18924 rol.w &0x7,%d1
18925 andi.l &0x3,%d1
18926
18927 lsl.l %d1,%d0
18928
18929 extb.l %d2
18930 add.l %d2,%d0
18931 add.l %d0,%a0
18932
18933 mov.l (%sp)+,%d2
18934 rts
18935
18936
18937
18938
18939fabs_short:
18940 mov.l EXC_EXTWPTR(%a6),%a0
18941 addq.l &0x2,EXC_EXTWPTR(%a6)
18942 bsr.l _imem_read_word
18943
18944 tst.l %d1
18945 bne.l iea_iacc
18946
18947 mov.w %d0,%a0
18948 rts
18949
18950
18951
18952
18953fabs_long:
18954 mov.l EXC_EXTWPTR(%a6),%a0
18955 addq.l &0x4,EXC_EXTWPTR(%a6)
18956 bsr.l _imem_read_long
18957
18958 tst.l %d1
18959 bne.l iea_iacc
18960
18961 mov.l %d0,%a0
18962 rts
18963
18964
18965
18966
18967fpc_ind:
18968 mov.l EXC_EXTWPTR(%a6),%a0
18969 addq.l &0x2,EXC_EXTWPTR(%a6)
18970 bsr.l _imem_read_word
18971
18972 tst.l %d1
18973 bne.l iea_iacc
18974
18975 mov.w %d0,%a0
18976
18977 add.l EXC_EXTWPTR(%a6),%a0
18978
18979
18980 subq.l &0x2,%a0
18981 rts
18982
18983
18984
18985
18986
18987
18988
18989fpc_ind_ext:
18990 mov.l EXC_EXTWPTR(%a6),%a0
18991 addq.l &0x2,EXC_EXTWPTR(%a6)
18992 bsr.l _imem_read_word
18993
18994 tst.l %d1
18995 bne.l iea_iacc
18996
18997 mov.l EXC_EXTWPTR(%a6),%a0
18998 subq.l &0x2,%a0
18999
19000 btst &0x8,%d0
19001 bne.w fcalc_mem_ind
19002
19003 mov.l %d0,L_SCR1(%a6)
19004
19005 mov.l %d0,%d1
19006 rol.w &0x4,%d1
19007 andi.w &0xf,%d1
19008
19009
19010 bsr.l fetch_dreg
19011
19012 mov.l %d2,-(%sp)
19013 mov.l L_SCR1(%a6),%d2
19014
19015 btst &0xb,%d2
19016 bne.b fpii8_long
19017 ext.l %d0
19018fpii8_long:
19019 mov.l %d2,%d1
19020 rol.w &0x7,%d1
19021 andi.l &0x3,%d1
19022
19023 lsl.l %d1,%d0
19024
19025 extb.l %d2
19026 add.l %d2,%d0
19027 add.l %d0,%a0
19028
19029 mov.l (%sp)+,%d2
19030 rts
19031
19032
19033
19034
19035
19036fcalc_mem_ind:
19037 btst &0x6,%d0
19038 beq.b fcalc_index
19039
19040 movm.l &0x3c00,-(%sp)
19041
19042 mov.l %d0,%d5
19043 mov.l %a0,%d3
19044
19045 clr.l %d2
19046 bra.b fbase_supp_ck
19047
19048
19049fcalc_index:
19050 mov.l %d0,L_SCR1(%a6)
19051 bfextu %d0{&16:&4},%d1
19052 bsr.l fetch_dreg
19053
19054 movm.l &0x3c00,-(%sp)
19055 mov.l %d0,%d2
19056 mov.l L_SCR1(%a6),%d5
19057 mov.l %a0,%d3
19058
19059 btst &0xb,%d5
19060 bne.b fno_ext
19061 ext.l %d2
19062
19063fno_ext:
19064 bfextu %d5{&21:&2},%d0
19065 lsl.l %d0,%d2
19066
19067
19068
19069fbase_supp_ck:
19070 btst &0x7,%d5
19071 beq.b fno_base_sup
19072 clr.l %d3
19073
19074
19075fno_base_sup:
19076 bfextu %d5{&26:&2},%d0
19077
19078
19079 cmpi.b %d0,&0x2
19080 blt.b fno_bd
19081 beq.b fget_word_bd
19082
19083 mov.l EXC_EXTWPTR(%a6),%a0
19084 addq.l &0x4,EXC_EXTWPTR(%a6)
19085 bsr.l _imem_read_long
19086
19087 tst.l %d1
19088 bne.l fcea_iacc
19089
19090 bra.b fchk_ind
19091
19092fget_word_bd:
19093 mov.l EXC_EXTWPTR(%a6),%a0
19094 addq.l &0x2,EXC_EXTWPTR(%a6)
19095 bsr.l _imem_read_word
19096
19097 tst.l %d1
19098 bne.l fcea_iacc
19099
19100 ext.l %d0
19101
19102fchk_ind:
19103 add.l %d0,%d3
19104
19105
19106fno_bd:
19107 bfextu %d5{&30:&2},%d0
19108 beq.w faii_bd
19109
19110 cmpi.b %d0,&0x2
19111 blt.b fnull_od
19112 beq.b fword_od
19113
19114 mov.l EXC_EXTWPTR(%a6),%a0
19115 addq.l &0x4,EXC_EXTWPTR(%a6)
19116 bsr.l _imem_read_long
19117
19118 tst.l %d1
19119 bne.l fcea_iacc
19120
19121 bra.b fadd_them
19122
19123fword_od:
19124 mov.l EXC_EXTWPTR(%a6),%a0
19125 addq.l &0x2,EXC_EXTWPTR(%a6)
19126 bsr.l _imem_read_word
19127
19128 tst.l %d1
19129 bne.l fcea_iacc
19130
19131 ext.l %d0
19132 bra.b fadd_them
19133
19134fnull_od:
19135 clr.l %d0
19136
19137fadd_them:
19138 mov.l %d0,%d4
19139
19140 btst &0x2,%d5
19141 beq.b fpre_indexed
19142
19143 mov.l %d3,%a0
19144 bsr.l _dmem_read_long
19145
19146 tst.l %d1
19147 bne.w fcea_err
19148
19149 add.l %d2,%d0
19150 add.l %d4,%d0
19151 bra.b fdone_ea
19152
19153fpre_indexed:
19154 add.l %d2,%d3
19155 mov.l %d3,%a0
19156 bsr.l _dmem_read_long
19157
19158 tst.l %d1
19159 bne.w fcea_err
19160
19161 add.l %d4,%d0
19162 bra.b fdone_ea
19163
19164faii_bd:
19165 add.l %d2,%d3
19166 mov.l %d3,%d0
19167fdone_ea:
19168 mov.l %d0,%a0
19169
19170 movm.l (%sp)+,&0x003c
19171 rts
19172
19173
19174fcea_err:
19175 mov.l %d3,%a0
19176
19177 movm.l (%sp)+,&0x003c
19178 mov.w &0x0101,%d0
19179 bra.l iea_dacc
19180
19181fcea_iacc:
19182 movm.l (%sp)+,&0x003c
19183 bra.l iea_iacc
19184
19185fmovm_out_err:
19186 bsr.l restore
19187 mov.w &0x00e1,%d0
19188 bra.b fmovm_err
19189
19190fmovm_in_err:
19191 bsr.l restore
19192 mov.w &0x0161,%d0
19193
19194fmovm_err:
19195 mov.l L_SCR1(%a6),%a0
19196 bra.l iea_dacc
19197
19198
19199
19200
19201
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
19223
19224
19225
19226
19227
19228
19229
19230
19231
19232
19233
19234
19235 global fmovm_ctrl
19236fmovm_ctrl:
19237 mov.b EXC_EXTWORD(%a6),%d0
19238 cmpi.b %d0,&0x9c
19239 beq.w fctrl_in_7
19240 cmpi.b %d0,&0x98
19241 beq.w fctrl_in_6
19242 cmpi.b %d0,&0x94
19243 beq.b fctrl_in_5
19244
19245
19246fctrl_in_3:
19247 mov.l EXC_EXTWPTR(%a6),%a0
19248 addq.l &0x4,EXC_EXTWPTR(%a6)
19249 bsr.l _imem_read_long
19250
19251 tst.l %d1
19252 bne.l iea_iacc
19253
19254 mov.l %d0,USER_FPSR(%a6)
19255 mov.l EXC_EXTWPTR(%a6),%a0
19256 addq.l &0x4,EXC_EXTWPTR(%a6)
19257 bsr.l _imem_read_long
19258
19259 tst.l %d1
19260 bne.l iea_iacc
19261
19262 mov.l %d0,USER_FPIAR(%a6)
19263 rts
19264
19265
19266fctrl_in_5:
19267 mov.l EXC_EXTWPTR(%a6),%a0
19268 addq.l &0x4,EXC_EXTWPTR(%a6)
19269 bsr.l _imem_read_long
19270
19271 tst.l %d1
19272 bne.l iea_iacc
19273
19274 mov.l %d0,USER_FPCR(%a6)
19275 mov.l EXC_EXTWPTR(%a6),%a0
19276 addq.l &0x4,EXC_EXTWPTR(%a6)
19277 bsr.l _imem_read_long
19278
19279 tst.l %d1
19280 bne.l iea_iacc
19281
19282 mov.l %d0,USER_FPIAR(%a6)
19283 rts
19284
19285
19286fctrl_in_6:
19287 mov.l EXC_EXTWPTR(%a6),%a0
19288 addq.l &0x4,EXC_EXTWPTR(%a6)
19289 bsr.l _imem_read_long
19290
19291 tst.l %d1
19292 bne.l iea_iacc
19293
19294 mov.l %d0,USER_FPCR(%a6)
19295 mov.l EXC_EXTWPTR(%a6),%a0
19296 addq.l &0x4,EXC_EXTWPTR(%a6)
19297 bsr.l _imem_read_long
19298
19299 tst.l %d1
19300 bne.l iea_iacc
19301
19302 mov.l %d0,USER_FPSR(%a6)
19303 rts
19304
19305
19306fctrl_in_7:
19307 mov.l EXC_EXTWPTR(%a6),%a0
19308 addq.l &0x4,EXC_EXTWPTR(%a6)
19309 bsr.l _imem_read_long
19310
19311 tst.l %d1
19312 bne.l iea_iacc
19313
19314 mov.l %d0,USER_FPCR(%a6)
19315 mov.l EXC_EXTWPTR(%a6),%a0
19316 addq.l &0x4,EXC_EXTWPTR(%a6)
19317 bsr.l _imem_read_long
19318
19319 tst.l %d1
19320 bne.l iea_iacc
19321
19322 mov.l %d0,USER_FPSR(%a6)
19323 mov.l EXC_EXTWPTR(%a6),%a0
19324 addq.l &0x4,EXC_EXTWPTR(%a6)
19325 bsr.l _imem_read_long
19326
19327 tst.l %d1
19328 bne.l iea_iacc
19329
19330 mov.l %d0,USER_FPIAR(%a6)
19331 rts
19332
19333
19334
19335
19336
19337
19338
19339
19340
19341
19342
19343
19344
19345
19346
19347
19348
19349
19350
19351
19352
19353
19354
19355
19356
19357
19358
19359
19360
19361
19362 global _dcalc_ea
19363_dcalc_ea:
19364 mov.l %d0, %a0
19365
19366 mov.b 1+EXC_OPWORD(%a6), %d0
19367 mov.l %d0, %d1
19368
19369 andi.w &0x38, %d0
19370 andi.l &0x7, %d1
19371
19372 cmpi.b %d0,&0x18
19373 beq.b dcea_pi
19374
19375 cmpi.b %d0,&0x20
19376 beq.b dcea_pd
19377
19378 or.w %d1,%d0
19379 cmpi.b %d0,&0x3c
19380
19381 beq.b dcea_imm
19382
19383 mov.l EXC_EA(%a6),%a0
19384 rts
19385
19386
19387
19388dcea_imm:
19389 mov.b &immed_flg,SPCOND_FLG(%a6)
19390 lea ([USER_FPIAR,%a6],0x4),%a0
19391 rts
19392
19393
19394
19395dcea_pi:
19396 mov.l %a0,%d0
19397 bsr.l inc_areg
19398
19399 mov.l EXC_EA(%a6),%a0
19400 rts
19401
19402
19403
19404
19405
19406dcea_pd:
19407 mov.l %a0,%d0
19408 bsr.l dec_areg
19409
19410 mov.l EXC_EA(%a6),%a0
19411
19412 cmpi.b %d0,&0xc
19413 beq.b dcea_pd2
19414 rts
19415dcea_pd2:
19416 sub.l &0x8,%a0
19417 mov.l %a0,EXC_EA(%a6)
19418 rts
19419
19420
19421
19422
19423
19424
19425
19426
19427
19428
19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
19444
19445
19446
19447 global _calc_ea_fout
19448_calc_ea_fout:
19449 mov.b 1+EXC_OPWORD(%a6),%d0
19450 mov.l %d0,%d1
19451
19452 andi.w &0x38,%d0
19453 andi.l &0x7,%d1
19454
19455 cmpi.b %d0,&0x18
19456 beq.b ceaf_pi
19457
19458 cmpi.b %d0,&0x20
19459 beq.w ceaf_pd
19460
19461 mov.l EXC_EA(%a6),%a0
19462 rts
19463
19464
19465
19466
19467ceaf_pi:
19468 mov.w (tbl_ceaf_pi.b,%pc,%d1.w*2),%d1
19469 mov.l EXC_EA(%a6),%a0
19470 jmp (tbl_ceaf_pi.b,%pc,%d1.w*1)
19471
19472 swbeg &0x8
19473tbl_ceaf_pi:
19474 short ceaf_pi0 - tbl_ceaf_pi
19475 short ceaf_pi1 - tbl_ceaf_pi
19476 short ceaf_pi2 - tbl_ceaf_pi
19477 short ceaf_pi3 - tbl_ceaf_pi
19478 short ceaf_pi4 - tbl_ceaf_pi
19479 short ceaf_pi5 - tbl_ceaf_pi
19480 short ceaf_pi6 - tbl_ceaf_pi
19481 short ceaf_pi7 - tbl_ceaf_pi
19482
19483ceaf_pi0:
19484 addi.l &0xc,EXC_DREGS+0x8(%a6)
19485 rts
19486ceaf_pi1:
19487 addi.l &0xc,EXC_DREGS+0xc(%a6)
19488 rts
19489ceaf_pi2:
19490 add.l &0xc,%a2
19491 rts
19492ceaf_pi3:
19493 add.l &0xc,%a3
19494 rts
19495ceaf_pi4:
19496 add.l &0xc,%a4
19497 rts
19498ceaf_pi5:
19499 add.l &0xc,%a5
19500 rts
19501ceaf_pi6:
19502 addi.l &0xc,EXC_A6(%a6)
19503 rts
19504ceaf_pi7:
19505 mov.b &mia7_flg,SPCOND_FLG(%a6)
19506 addi.l &0xc,EXC_A7(%a6)
19507 rts
19508
19509
19510
19511
19512ceaf_pd:
19513 mov.w (tbl_ceaf_pd.b,%pc,%d1.w*2),%d1
19514 mov.l EXC_EA(%a6),%a0
19515 sub.l &0x8,%a0
19516 sub.l &0x8,EXC_EA(%a6)
19517 jmp (tbl_ceaf_pd.b,%pc,%d1.w*1)
19518
19519 swbeg &0x8
19520tbl_ceaf_pd:
19521 short ceaf_pd0 - tbl_ceaf_pd
19522 short ceaf_pd1 - tbl_ceaf_pd
19523 short ceaf_pd2 - tbl_ceaf_pd
19524 short ceaf_pd3 - tbl_ceaf_pd
19525 short ceaf_pd4 - tbl_ceaf_pd
19526 short ceaf_pd5 - tbl_ceaf_pd
19527 short ceaf_pd6 - tbl_ceaf_pd
19528 short ceaf_pd7 - tbl_ceaf_pd
19529
19530ceaf_pd0:
19531 mov.l %a0,EXC_DREGS+0x8(%a6)
19532 rts
19533ceaf_pd1:
19534 mov.l %a0,EXC_DREGS+0xc(%a6)
19535 rts
19536ceaf_pd2:
19537 mov.l %a0,%a2
19538 rts
19539ceaf_pd3:
19540 mov.l %a0,%a3
19541 rts
19542ceaf_pd4:
19543 mov.l %a0,%a4
19544 rts
19545ceaf_pd5:
19546 mov.l %a0,%a5
19547 rts
19548ceaf_pd6:
19549 mov.l %a0,EXC_A6(%a6)
19550 rts
19551ceaf_pd7:
19552 mov.l %a0,EXC_A7(%a6)
19553 mov.b &mda7_flg,SPCOND_FLG(%a6)
19554 rts
19555
19556
19557
19558
19559
19560
19561
19562
19563
19564
19565
19566
19567
19568
19569
19570
19571
19572
19573
19574
19575
19576
19577
19578
19579
19580
19581
19582
19583
19584
19585
19586
19587
19588
19589
19590
19591
19592
19593
19594
19595
19596
19597
19598
19599
19600
19601
19602
19603
19604
19605
19606 global _load_fop
19607_load_fop:
19608
19609
19610
19611
19612
19613
19614
19615
19616
19617
19618
19619
19620
19621
19622 btst &0x6,EXC_CMDREG(%a6)
19623 bne.b op010
19624
19625
19626
19627
19628op000:
19629 mov.b 1+EXC_CMDREG(%a6),%d0
19630 btst &0x5,%d0
19631 beq.b op000_src
19632 btst &0x4,%d0
19633 beq.b op000_dst
19634 and.w &0x007f,%d0
19635 cmpi.w %d0,&0x0038
19636 bne.b op000_src
19637
19638op000_dst:
19639 bfextu EXC_CMDREG(%a6){&6:&3}, %d0
19640 bsr.l load_fpn2
19641
19642 bsr.l set_tag_x
19643
19644 cmpi.b %d0, &UNNORM
19645 beq.b op000_dst_unnorm
19646op000_dst_cont:
19647 mov.b %d0, DTAG(%a6)
19648
19649op000_src:
19650 bfextu EXC_CMDREG(%a6){&3:&3}, %d0
19651 bsr.l load_fpn1
19652
19653 bsr.l set_tag_x
19654
19655 cmpi.b %d0, &UNNORM
19656 beq.b op000_src_unnorm
19657op000_src_cont:
19658 mov.b %d0, STAG(%a6)
19659 rts
19660
19661op000_dst_unnorm:
19662 bsr.l unnorm_fix
19663 bra.b op000_dst_cont
19664op000_src_unnorm:
19665 bsr.l unnorm_fix
19666 bra.b op000_src_cont
19667
19668
19669
19670
19671op010:
19672 mov.w EXC_CMDREG(%a6),%d0
19673 btst &0x5,%d0
19674 beq.b op010_src
19675 btst &0x4,%d0
19676 beq.b op010_dst
19677 and.w &0x007f,%d0
19678 cmpi.w %d0,&0x0038
19679 bne.b op010_src
19680
19681op010_dst:
19682 bfextu EXC_CMDREG(%a6){&6:&3}, %d0
19683 bsr.l load_fpn2
19684
19685 bsr.l set_tag_x
19686
19687 cmpi.b %d0, &UNNORM
19688 beq.b op010_dst_unnorm
19689op010_dst_cont:
19690 mov.b %d0, DTAG(%a6)
19691
19692op010_src:
19693 bfextu EXC_CMDREG(%a6){&3:&3}, %d0
19694
19695 bfextu EXC_OPWORD(%a6){&10:&3}, %d1
19696 bne.w fetch_from_mem
19697
19698op010_dreg:
19699 clr.b STAG(%a6)
19700 bfextu EXC_OPWORD(%a6){&13:&3}, %d1
19701
19702 mov.w (tbl_op010_dreg.b,%pc,%d0.w*2), %d0
19703 jmp (tbl_op010_dreg.b,%pc,%d0.w*1)
19704
19705op010_dst_unnorm:
19706 bsr.l unnorm_fix
19707 bra.b op010_dst_cont
19708
19709 swbeg &0x8
19710tbl_op010_dreg:
19711 short opd_long - tbl_op010_dreg
19712 short opd_sgl - tbl_op010_dreg
19713 short tbl_op010_dreg - tbl_op010_dreg
19714 short tbl_op010_dreg - tbl_op010_dreg
19715 short opd_word - tbl_op010_dreg
19716 short tbl_op010_dreg - tbl_op010_dreg
19717 short opd_byte - tbl_op010_dreg
19718 short tbl_op010_dreg - tbl_op010_dreg
19719
19720
19721
19722
19723opd_long:
19724 bsr.l fetch_dreg
19725 fmov.l %d0, %fp0
19726 fmovm.x &0x80, FP_SRC(%a6)
19727 fbeq.w opd_long_zero
19728 rts
19729opd_long_zero:
19730 mov.b &ZERO, STAG(%a6)
19731 rts
19732
19733
19734
19735
19736opd_word:
19737 bsr.l fetch_dreg
19738 fmov.w %d0, %fp0
19739 fmovm.x &0x80, FP_SRC(%a6)
19740 fbeq.w opd_word_zero
19741 rts
19742opd_word_zero:
19743 mov.b &ZERO, STAG(%a6)
19744 rts
19745
19746
19747
19748
19749opd_byte:
19750 bsr.l fetch_dreg
19751 fmov.b %d0, %fp0
19752 fmovm.x &0x80, FP_SRC(%a6)
19753 fbeq.w opd_byte_zero
19754 rts
19755opd_byte_zero:
19756 mov.b &ZERO, STAG(%a6)
19757 rts
19758
19759
19760
19761
19762
19763
19764
19765opd_sgl:
19766 bsr.l fetch_dreg
19767 mov.l %d0,L_SCR1(%a6)
19768
19769 lea L_SCR1(%a6), %a0
19770 bsr.l set_tag_s
19771 mov.b %d0, STAG(%a6)
19772
19773 cmpi.b %d0, &SNAN
19774 beq.w get_sgl_snan
19775
19776 cmpi.b %d0, &DENORM
19777 beq.w get_sgl_denorm
19778
19779 fmov.s (%a0), %fp0
19780 fmovm.x &0x80, FP_SRC(%a6)
19781 rts
19782
19783
19784
19785
19786
19787
19788
19789
19790
19791
19792
19793
19794
19795
19796
19797fetch_from_mem:
19798 clr.b STAG(%a6)
19799
19800 mov.w (tbl_fp_type.b,%pc,%d0.w*2), %d0
19801 jmp (tbl_fp_type.b,%pc,%d0.w*1)
19802
19803 swbeg &0x8
19804tbl_fp_type:
19805 short load_long - tbl_fp_type
19806 short load_sgl - tbl_fp_type
19807 short load_ext - tbl_fp_type
19808 short load_packed - tbl_fp_type
19809 short load_word - tbl_fp_type
19810 short load_dbl - tbl_fp_type
19811 short load_byte - tbl_fp_type
19812 short tbl_fp_type - tbl_fp_type
19813
19814
19815
19816
19817
19818
19819
19820
19821load_long:
19822 movq.l &0x4, %d0
19823 bsr.l _dcalc_ea
19824
19825 cmpi.b SPCOND_FLG(%a6),&immed_flg
19826 beq.b load_long_immed
19827
19828 bsr.l _dmem_read_long
19829
19830 tst.l %d1
19831 bne.l facc_in_l
19832
19833load_long_cont:
19834 fmov.l %d0, %fp0
19835 fmovm.x &0x80, FP_SRC(%a6)
19836
19837 fbeq.w load_long_zero
19838 rts
19839load_long_zero:
19840 mov.b &ZERO, STAG(%a6)
19841 rts
19842
19843load_long_immed:
19844 bsr.l _imem_read_long
19845
19846 tst.l %d1
19847 bne.l funimp_iacc
19848 bra.b load_long_cont
19849
19850
19851
19852
19853
19854
19855
19856
19857load_word:
19858 movq.l &0x2, %d0
19859 bsr.l _dcalc_ea
19860
19861 cmpi.b SPCOND_FLG(%a6),&immed_flg
19862 beq.b load_word_immed
19863
19864 bsr.l _dmem_read_word
19865
19866 tst.l %d1
19867 bne.l facc_in_w
19868
19869load_word_cont:
19870 fmov.w %d0, %fp0
19871 fmovm.x &0x80, FP_SRC(%a6)
19872
19873 fbeq.w load_word_zero
19874 rts
19875load_word_zero:
19876 mov.b &ZERO, STAG(%a6)
19877 rts
19878
19879load_word_immed:
19880 bsr.l _imem_read_word
19881
19882 tst.l %d1
19883 bne.l funimp_iacc
19884 bra.b load_word_cont
19885
19886
19887
19888
19889
19890
19891
19892
19893load_byte:
19894 movq.l &0x1, %d0
19895 bsr.l _dcalc_ea
19896
19897 cmpi.b SPCOND_FLG(%a6),&immed_flg
19898 beq.b load_byte_immed
19899
19900 bsr.l _dmem_read_byte
19901
19902 tst.l %d1
19903 bne.l facc_in_b
19904
19905load_byte_cont:
19906 fmov.b %d0, %fp0
19907 fmovm.x &0x80, FP_SRC(%a6)
19908
19909 fbeq.w load_byte_zero
19910 rts
19911load_byte_zero:
19912 mov.b &ZERO, STAG(%a6)
19913 rts
19914
19915load_byte_immed:
19916 bsr.l _imem_read_word
19917
19918 tst.l %d1
19919 bne.l funimp_iacc
19920 bra.b load_byte_cont
19921
19922
19923
19924
19925
19926
19927
19928
19929load_sgl:
19930 movq.l &0x4, %d0
19931 bsr.l _dcalc_ea
19932
19933 cmpi.b SPCOND_FLG(%a6),&immed_flg
19934 beq.b load_sgl_immed
19935
19936 bsr.l _dmem_read_long
19937 mov.l %d0, L_SCR1(%a6)
19938
19939 tst.l %d1
19940 bne.l facc_in_l
19941
19942load_sgl_cont:
19943 lea L_SCR1(%a6), %a0
19944 bsr.l set_tag_s
19945 mov.b %d0, STAG(%a6)
19946
19947 cmpi.b %d0, &DENORM
19948 beq.w get_sgl_denorm
19949
19950 cmpi.b %d0, &SNAN
19951 beq.w get_sgl_snan
19952
19953 fmov.s L_SCR1(%a6), %fp0
19954 fmovm.x &0x80, FP_SRC(%a6)
19955 rts
19956
19957load_sgl_immed:
19958 bsr.l _imem_read_long
19959
19960 tst.l %d1
19961 bne.l funimp_iacc
19962 bra.b load_sgl_cont
19963
19964
19965
19966
19967get_sgl_denorm:
19968 clr.w FP_SRC_EX(%a6)
19969 bfextu (%a0){&9:&23}, %d0
19970 lsl.l &0x8, %d0
19971 mov.l %d0, FP_SRC_HI(%a6)
19972 clr.l FP_SRC_LO(%a6)
19973
19974 clr.w FP_SRC_EX(%a6)
19975 btst &0x7, (%a0)
19976 beq.b sgl_dnrm_norm
19977 bset &0x7, FP_SRC_EX(%a6)
19978
19979sgl_dnrm_norm:
19980 lea FP_SRC(%a6), %a0
19981 bsr.l norm
19982 mov.w &0x3f81, %d1
19983 sub.w %d0, %d1
19984 or.w %d1, FP_SRC_EX(%a6)
19985
19986 mov.b &NORM, STAG(%a6)
19987 rts
19988
19989
19990
19991get_sgl_snan:
19992 mov.w &0x7fff, FP_SRC_EX(%a6)
19993 bfextu (%a0){&9:&23}, %d0
19994 lsl.l &0x8, %d0
19995 mov.l %d0, FP_SRC_HI(%a6)
19996 clr.l FP_SRC_LO(%a6)
19997
19998 btst &0x7, (%a0)
19999 beq.b no_sgl_snan_sgn
20000 bset &0x7, FP_SRC_EX(%a6)
20001no_sgl_snan_sgn:
20002 rts
20003
20004
20005
20006
20007
20008
20009
20010
20011load_dbl:
20012 movq.l &0x8, %d0
20013 bsr.l _dcalc_ea
20014
20015 cmpi.b SPCOND_FLG(%a6),&immed_flg
20016 beq.b load_dbl_immed
20017
20018 lea L_SCR1(%a6), %a1
20019 movq.l &0x8, %d0
20020 bsr.l _dmem_read
20021
20022 tst.l %d1
20023 bne.l facc_in_d
20024
20025load_dbl_cont:
20026 lea L_SCR1(%a6), %a0
20027 bsr.l set_tag_d
20028 mov.b %d0, STAG(%a6)
20029
20030 cmpi.b %d0, &DENORM
20031 beq.w get_dbl_denorm
20032
20033 cmpi.b %d0, &SNAN
20034 beq.w get_dbl_snan
20035
20036 fmov.d L_SCR1(%a6), %fp0
20037 fmovm.x &0x80, FP_SRC(%a6)
20038 rts
20039
20040load_dbl_immed:
20041 lea L_SCR1(%a6), %a1
20042 movq.l &0x8, %d0
20043 bsr.l _imem_read
20044
20045 tst.l %d1
20046 bne.l funimp_iacc
20047 bra.b load_dbl_cont
20048
20049
20050
20051
20052get_dbl_denorm:
20053 clr.w FP_SRC_EX(%a6)
20054 bfextu (%a0){&12:&31}, %d0
20055 mov.l %d0, FP_SRC_HI(%a6)
20056 bfextu 4(%a0){&11:&21}, %d0
20057 mov.l &0xb, %d1
20058 lsl.l %d1, %d0
20059 mov.l %d0, FP_SRC_LO(%a6)
20060
20061 btst &0x7, (%a0)
20062 beq.b dbl_dnrm_norm
20063 bset &0x7, FP_SRC_EX(%a6)
20064
20065dbl_dnrm_norm:
20066 lea FP_SRC(%a6), %a0
20067 bsr.l norm
20068 mov.w &0x3c01, %d1
20069 sub.w %d0, %d1
20070 or.w %d1, FP_SRC_EX(%a6)
20071
20072 mov.b &NORM, STAG(%a6)
20073 rts
20074
20075
20076
20077get_dbl_snan:
20078 mov.w &0x7fff, FP_SRC_EX(%a6)
20079
20080 bfextu (%a0){&12:&31}, %d0
20081 mov.l %d0, FP_SRC_HI(%a6)
20082 bfextu 4(%a0){&11:&21}, %d0
20083 mov.l &0xb, %d1
20084 lsl.l %d1, %d0
20085 mov.l %d0, FP_SRC_LO(%a6)
20086
20087 btst &0x7, (%a0)
20088 beq.b no_dbl_snan_sgn
20089 bset &0x7, FP_SRC_EX(%a6)
20090no_dbl_snan_sgn:
20091 rts
20092
20093
20094
20095
20096
20097
20098
20099
20100load_ext:
20101 mov.l &0xc, %d0
20102 bsr.l _dcalc_ea
20103
20104 lea FP_SRC(%a6), %a1
20105 mov.l &0xc, %d0
20106 bsr.l _dmem_read
20107
20108 tst.l %d1
20109 bne.l facc_in_x
20110
20111 lea FP_SRC(%a6), %a0
20112 bsr.l set_tag_x
20113
20114 cmpi.b %d0, &UNNORM
20115 beq.b load_ext_unnorm
20116
20117 mov.b %d0, STAG(%a6)
20118 rts
20119
20120load_ext_unnorm:
20121 bsr.l unnorm_fix
20122 mov.b %d0, STAG(%a6)
20123 rts
20124
20125
20126
20127
20128
20129
20130
20131
20132load_packed:
20133 bsr.l get_packed
20134
20135 lea FP_SRC(%a6),%a0
20136 bsr.l set_tag_x
20137 cmpi.b %d0,&UNNORM
20138 beq.b load_packed_unnorm
20139
20140 mov.b %d0,STAG(%a6)
20141 rts
20142
20143load_packed_unnorm:
20144 bsr.l unnorm_fix
20145 mov.b %d0,STAG(%a6)
20146 rts
20147
20148
20149
20150
20151
20152
20153
20154
20155
20156
20157
20158
20159
20160
20161
20162
20163
20164
20165
20166
20167
20168
20169
20170
20171
20172
20173
20174
20175
20176
20177
20178
20179
20180
20181
20182
20183
20184
20185
20186
20187
20188
20189
20190
20191
20192
20193
20194
20195
20196
20197
20198
20199 global fout
20200fout:
20201 bfextu EXC_CMDREG(%a6){&3:&3},%d1
20202 mov.w (tbl_fout.b,%pc,%d1.w*2),%a1
20203 jmp (tbl_fout.b,%pc,%a1)
20204
20205 swbeg &0x8
20206tbl_fout:
20207 short fout_long - tbl_fout
20208 short fout_sgl - tbl_fout
20209 short fout_ext - tbl_fout
20210 short fout_pack - tbl_fout
20211 short fout_word - tbl_fout
20212 short fout_dbl - tbl_fout
20213 short fout_byte - tbl_fout
20214 short fout_pack - tbl_fout
20215
20216
20217
20218
20219
20220
20221
20222fout_byte:
20223 tst.b STAG(%a6)
20224 bne.b fout_byte_denorm
20225
20226 fmovm.x SRC(%a0),&0x80
20227
20228fout_byte_norm:
20229 fmov.l %d0,%fpcr
20230
20231 fmov.b %fp0,%d0
20232
20233 fmov.l &0x0,%fpcr
20234 fmov.l %fpsr,%d1
20235 or.w %d1,2+USER_FPSR(%a6)
20236
20237 mov.b 1+EXC_OPWORD(%a6),%d1
20238 andi.b &0x38,%d1
20239 beq.b fout_byte_dn
20240
20241 mov.l EXC_EA(%a6),%a0
20242 bsr.l _dmem_write_byte
20243
20244 tst.l %d1
20245 bne.l facc_out_b
20246
20247 rts
20248
20249fout_byte_dn:
20250 mov.b 1+EXC_OPWORD(%a6),%d1
20251 andi.w &0x7,%d1
20252 bsr.l store_dreg_b
20253 rts
20254
20255fout_byte_denorm:
20256 mov.l SRC_EX(%a0),%d1
20257 andi.l &0x80000000,%d1
20258 ori.l &0x00800000,%d1
20259 fmov.s %d1,%fp0
20260 bra.b fout_byte_norm
20261
20262
20263
20264
20265
20266
20267
20268fout_word:
20269 tst.b STAG(%a6)
20270 bne.b fout_word_denorm
20271
20272 fmovm.x SRC(%a0),&0x80
20273
20274fout_word_norm:
20275 fmov.l %d0,%fpcr
20276
20277 fmov.w %fp0,%d0
20278
20279 fmov.l &0x0,%fpcr
20280 fmov.l %fpsr,%d1
20281 or.w %d1,2+USER_FPSR(%a6)
20282
20283 mov.b 1+EXC_OPWORD(%a6),%d1
20284 andi.b &0x38,%d1
20285 beq.b fout_word_dn
20286
20287 mov.l EXC_EA(%a6),%a0
20288 bsr.l _dmem_write_word
20289
20290 tst.l %d1
20291 bne.l facc_out_w
20292
20293 rts
20294
20295fout_word_dn:
20296 mov.b 1+EXC_OPWORD(%a6),%d1
20297 andi.w &0x7,%d1
20298 bsr.l store_dreg_w
20299 rts
20300
20301fout_word_denorm:
20302 mov.l SRC_EX(%a0),%d1
20303 andi.l &0x80000000,%d1
20304 ori.l &0x00800000,%d1
20305 fmov.s %d1,%fp0
20306 bra.b fout_word_norm
20307
20308
20309
20310
20311
20312
20313
20314fout_long:
20315 tst.b STAG(%a6)
20316 bne.b fout_long_denorm
20317
20318 fmovm.x SRC(%a0),&0x80
20319
20320fout_long_norm:
20321 fmov.l %d0,%fpcr
20322
20323 fmov.l %fp0,%d0
20324
20325 fmov.l &0x0,%fpcr
20326 fmov.l %fpsr,%d1
20327 or.w %d1,2+USER_FPSR(%a6)
20328
20329fout_long_write:
20330 mov.b 1+EXC_OPWORD(%a6),%d1
20331 andi.b &0x38,%d1
20332 beq.b fout_long_dn
20333
20334 mov.l EXC_EA(%a6),%a0
20335 bsr.l _dmem_write_long
20336
20337 tst.l %d1
20338 bne.l facc_out_l
20339
20340 rts
20341
20342fout_long_dn:
20343 mov.b 1+EXC_OPWORD(%a6),%d1
20344 andi.w &0x7,%d1
20345 bsr.l store_dreg_l
20346 rts
20347
20348fout_long_denorm:
20349 mov.l SRC_EX(%a0),%d1
20350 andi.l &0x80000000,%d1
20351 ori.l &0x00800000,%d1
20352 fmov.s %d1,%fp0
20353 bra.b fout_long_norm
20354
20355
20356
20357
20358
20359
20360
20361
20362fout_ext:
20363
20364
20365
20366
20367 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
20368 clr.w 2+FP_SCR0_EX(%a6)
20369 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
20370 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
20371
20372 fmovm.x SRC(%a0),&0x80
20373
20374 bsr.l _calc_ea_fout
20375
20376 mov.l %a0,%a1
20377 lea FP_SCR0(%a6),%a0
20378 mov.l &0xc,%d0
20379
20380
20381
20382
20383 cmpi.b SPCOND_FLG(%a6),&mda7_flg
20384 beq.b fout_ext_a7
20385
20386 bsr.l _dmem_write
20387
20388 tst.l %d1
20389 bne.w fout_ext_err
20390
20391 tst.b STAG(%a6)
20392 bne.b fout_ext_denorm
20393 rts
20394
20395
20396fout_ext_denorm:
20397 bset &unfl_bit,FPSR_EXCEPT(%a6)
20398
20399 mov.b FPCR_ENABLE(%a6),%d0
20400 andi.b &0x0a,%d0
20401 bne.b fout_ext_exc
20402 rts
20403
20404
20405
20406fout_ext_a7:
20407 bsr.l _mem_write2
20408
20409 tst.l %d1
20410 bne.w fout_ext_err
20411
20412 tst.b STAG(%a6)
20413 bne.b fout_ext_denorm
20414 rts
20415
20416fout_ext_exc:
20417 lea FP_SCR0(%a6),%a0
20418 bsr.l norm
20419 neg.w %d0
20420 andi.w &0x7fff,%d0
20421 andi.w &0x8000,FP_SCR0_EX(%a6)
20422 or.w %d0,FP_SCR0_EX(%a6)
20423 fmovm.x FP_SCR0(%a6),&0x40
20424 rts
20425
20426fout_ext_err:
20427 mov.l EXC_A6(%a6),(%a6)
20428 bra.l facc_out_x
20429
20430
20431
20432
20433fout_sgl:
20434 andi.b &0x30,%d0
20435 ori.b &s_mode*0x10,%d0
20436 mov.l %d0,L_SCR3(%a6)
20437
20438
20439
20440
20441
20442
20443
20444 mov.w SRC_EX(%a0),%d0
20445 andi.w &0x7fff,%d0
20446
20447 cmpi.w %d0,&SGL_HI
20448 bgt.w fout_sgl_ovfl
20449 beq.w fout_sgl_may_ovfl
20450 cmpi.w %d0,&SGL_LO
20451 blt.w fout_sgl_unfl
20452
20453
20454
20455
20456
20457fout_sgl_exg:
20458 fmovm.x SRC(%a0),&0x80
20459
20460 fmov.l L_SCR3(%a6),%fpcr
20461 fmov.l &0x0,%fpsr
20462
20463 fmov.s %fp0,%d0
20464
20465 fmov.l &0x0,%fpcr
20466 fmov.l %fpsr,%d1
20467
20468 or.w %d1,2+USER_FPSR(%a6)
20469
20470fout_sgl_exg_write:
20471 mov.b 1+EXC_OPWORD(%a6),%d1
20472 andi.b &0x38,%d1
20473 beq.b fout_sgl_exg_write_dn
20474
20475 mov.l EXC_EA(%a6),%a0
20476 bsr.l _dmem_write_long
20477
20478 tst.l %d1
20479 bne.l facc_out_l
20480
20481 rts
20482
20483fout_sgl_exg_write_dn:
20484 mov.b 1+EXC_OPWORD(%a6),%d1
20485 andi.w &0x7,%d1
20486 bsr.l store_dreg_l
20487 rts
20488
20489
20490
20491
20492
20493
20494fout_sgl_unfl:
20495 bset &unfl_bit,FPSR_EXCEPT(%a6)
20496
20497 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
20498 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
20499 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
20500 mov.l %a0,-(%sp)
20501
20502 clr.l %d0
20503
20504 cmpi.b STAG(%a6),&DENORM
20505 bne.b fout_sgl_unfl_cont
20506
20507 lea FP_SCR0(%a6),%a0
20508 bsr.l norm
20509
20510fout_sgl_unfl_cont:
20511 lea FP_SCR0(%a6),%a0
20512 mov.l L_SCR3(%a6),%d1
20513 bsr.l unf_res
20514
20515 lea FP_SCR0(%a6),%a0
20516 bsr.l dst_sgl
20517
20518 mov.b 1+EXC_OPWORD(%a6),%d1
20519 andi.b &0x38,%d1
20520 beq.b fout_sgl_unfl_dn
20521
20522 mov.l EXC_EA(%a6),%a0
20523 bsr.l _dmem_write_long
20524
20525 tst.l %d1
20526 bne.l facc_out_l
20527
20528 bra.b fout_sgl_unfl_chkexc
20529
20530fout_sgl_unfl_dn:
20531 mov.b 1+EXC_OPWORD(%a6),%d1
20532 andi.w &0x7,%d1
20533 bsr.l store_dreg_l
20534
20535fout_sgl_unfl_chkexc:
20536 mov.b FPCR_ENABLE(%a6),%d1
20537 andi.b &0x0a,%d1
20538 bne.w fout_sd_exc_unfl
20539 addq.l &0x4,%sp
20540 rts
20541
20542
20543
20544
20545fout_sgl_ovfl:
20546 tst.b 3+SRC_HI(%a0)
20547 bne.b fout_sgl_ovfl_inex2
20548 tst.l SRC_LO(%a0)
20549 bne.b fout_sgl_ovfl_inex2
20550 ori.w &ovfl_inx_mask,2+USER_FPSR(%a6)
20551 bra.b fout_sgl_ovfl_cont
20552fout_sgl_ovfl_inex2:
20553 ori.w &ovfinx_mask,2+USER_FPSR(%a6)
20554
20555fout_sgl_ovfl_cont:
20556 mov.l %a0,-(%sp)
20557
20558
20559
20560
20561 tst.b SRC_EX(%a0)
20562 smi %d1
20563 mov.l L_SCR3(%a6),%d0
20564 bsr.l ovf_res
20565 fmovm.x (%a0),&0x80
20566 fmov.s %fp0,%d0
20567
20568 mov.b 1+EXC_OPWORD(%a6),%d1
20569 andi.b &0x38,%d1
20570 beq.b fout_sgl_ovfl_dn
20571
20572 mov.l EXC_EA(%a6),%a0
20573 bsr.l _dmem_write_long
20574
20575 tst.l %d1
20576 bne.l facc_out_l
20577
20578 bra.b fout_sgl_ovfl_chkexc
20579
20580fout_sgl_ovfl_dn:
20581 mov.b 1+EXC_OPWORD(%a6),%d1
20582 andi.w &0x7,%d1
20583 bsr.l store_dreg_l
20584
20585fout_sgl_ovfl_chkexc:
20586 mov.b FPCR_ENABLE(%a6),%d1
20587 andi.b &0x0a,%d1
20588 bne.w fout_sd_exc_ovfl
20589 addq.l &0x4,%sp
20590 rts
20591
20592
20593
20594
20595
20596
20597
20598
20599
20600fout_sgl_may_ovfl:
20601 mov.w SRC_EX(%a0),%d1
20602 andi.w &0x8000,%d1
20603 ori.w &0x3fff,%d1
20604 mov.w %d1,FP_SCR0_EX(%a6)
20605 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
20606 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
20607
20608 fmov.l L_SCR3(%a6),%fpcr
20609
20610 fmov.x FP_SCR0(%a6),%fp0
20611 fmov.l &0x0,%fpcr
20612
20613 fabs.x %fp0
20614 fcmp.b %fp0,&0x2
20615 fblt.w fout_sgl_exg
20616 bra.w fout_sgl_ovfl
20617
20618
20619
20620fout_sd_exc_unfl:
20621 mov.l (%sp)+,%a0
20622
20623 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
20624 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
20625 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
20626
20627 cmpi.b STAG(%a6),&DENORM
20628 bne.b fout_sd_exc_cont
20629
20630 lea FP_SCR0(%a6),%a0
20631 bsr.l norm
20632 neg.l %d0
20633 andi.w &0x7fff,%d0
20634 bfins %d0,FP_SCR0_EX(%a6){&1:&15}
20635 bra.b fout_sd_exc_cont
20636
20637fout_sd_exc:
20638fout_sd_exc_ovfl:
20639 mov.l (%sp)+,%a0
20640
20641 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
20642 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
20643 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
20644
20645fout_sd_exc_cont:
20646 bclr &0x7,FP_SCR0_EX(%a6)
20647 sne.b 2+FP_SCR0_EX(%a6)
20648 lea FP_SCR0(%a6),%a0
20649
20650 mov.b 3+L_SCR3(%a6),%d1
20651 lsr.b &0x4,%d1
20652 andi.w &0x0c,%d1
20653 swap %d1
20654 mov.b 3+L_SCR3(%a6),%d1
20655 lsr.b &0x4,%d1
20656 andi.w &0x03,%d1
20657 clr.l %d0
20658 bsr.l _round
20659
20660 tst.b 2+FP_SCR0_EX(%a6)
20661 beq.b fout_sd_exc_done
20662 bset &0x7,FP_SCR0_EX(%a6)
20663
20664fout_sd_exc_done:
20665 fmovm.x FP_SCR0(%a6),&0x40
20666 rts
20667
20668
20669
20670
20671fout_dbl:
20672 andi.b &0x30,%d0
20673 ori.b &d_mode*0x10,%d0
20674 mov.l %d0,L_SCR3(%a6)
20675
20676
20677
20678
20679
20680
20681
20682 mov.w SRC_EX(%a0),%d0
20683 andi.w &0x7fff,%d0
20684
20685 cmpi.w %d0,&DBL_HI
20686 bgt.w fout_dbl_ovfl
20687 beq.w fout_dbl_may_ovfl
20688 cmpi.w %d0,&DBL_LO
20689 blt.w fout_dbl_unfl
20690
20691
20692
20693
20694
20695fout_dbl_exg:
20696 fmovm.x SRC(%a0),&0x80
20697
20698 fmov.l L_SCR3(%a6),%fpcr
20699 fmov.l &0x0,%fpsr
20700
20701 fmov.d %fp0,L_SCR1(%a6)
20702
20703 fmov.l &0x0,%fpcr
20704 fmov.l %fpsr,%d0
20705
20706 or.w %d0,2+USER_FPSR(%a6)
20707
20708 mov.l EXC_EA(%a6),%a1
20709 lea L_SCR1(%a6),%a0
20710 movq.l &0x8,%d0
20711 bsr.l _dmem_write
20712
20713 tst.l %d1
20714 bne.l facc_out_d
20715
20716 rts
20717
20718
20719
20720
20721
20722
20723fout_dbl_unfl:
20724 bset &unfl_bit,FPSR_EXCEPT(%a6)
20725
20726 mov.w SRC_EX(%a0),FP_SCR0_EX(%a6)
20727 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
20728 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
20729 mov.l %a0,-(%sp)
20730
20731 clr.l %d0
20732
20733 cmpi.b STAG(%a6),&DENORM
20734 bne.b fout_dbl_unfl_cont
20735
20736 lea FP_SCR0(%a6),%a0
20737 bsr.l norm
20738
20739fout_dbl_unfl_cont:
20740 lea FP_SCR0(%a6),%a0
20741 mov.l L_SCR3(%a6),%d1
20742 bsr.l unf_res
20743
20744 lea FP_SCR0(%a6),%a0
20745 bsr.l dst_dbl
20746 mov.l %d0,L_SCR1(%a6)
20747 mov.l %d1,L_SCR2(%a6)
20748
20749 mov.l EXC_EA(%a6),%a1
20750 lea L_SCR1(%a6),%a0
20751 movq.l &0x8,%d0
20752 bsr.l _dmem_write
20753
20754 tst.l %d1
20755 bne.l facc_out_d
20756
20757 mov.b FPCR_ENABLE(%a6),%d1
20758 andi.b &0x0a,%d1
20759 bne.w fout_sd_exc_unfl
20760 addq.l &0x4,%sp
20761 rts
20762
20763
20764
20765
20766fout_dbl_ovfl:
20767 mov.w 2+SRC_LO(%a0),%d0
20768 andi.w &0x7ff,%d0
20769 bne.b fout_dbl_ovfl_inex2
20770
20771 ori.w &ovfl_inx_mask,2+USER_FPSR(%a6)
20772 bra.b fout_dbl_ovfl_cont
20773fout_dbl_ovfl_inex2:
20774 ori.w &ovfinx_mask,2+USER_FPSR(%a6)
20775
20776fout_dbl_ovfl_cont:
20777 mov.l %a0,-(%sp)
20778
20779
20780
20781
20782 tst.b SRC_EX(%a0)
20783 smi %d1
20784 mov.l L_SCR3(%a6),%d0
20785 bsr.l ovf_res
20786 fmovm.x (%a0),&0x80
20787 fmov.d %fp0,L_SCR1(%a6)
20788
20789 mov.l EXC_EA(%a6),%a1
20790 lea L_SCR1(%a6),%a0
20791 movq.l &0x8,%d0
20792 bsr.l _dmem_write
20793
20794 tst.l %d1
20795 bne.l facc_out_d
20796
20797 mov.b FPCR_ENABLE(%a6),%d1
20798 andi.b &0x0a,%d1
20799 bne.w fout_sd_exc_ovfl
20800 addq.l &0x4,%sp
20801 rts
20802
20803
20804
20805
20806
20807
20808
20809
20810
20811fout_dbl_may_ovfl:
20812 mov.w SRC_EX(%a0),%d1
20813 andi.w &0x8000,%d1
20814 ori.w &0x3fff,%d1
20815 mov.w %d1,FP_SCR0_EX(%a6)
20816 mov.l SRC_HI(%a0),FP_SCR0_HI(%a6)
20817 mov.l SRC_LO(%a0),FP_SCR0_LO(%a6)
20818
20819 fmov.l L_SCR3(%a6),%fpcr
20820
20821 fmov.x FP_SCR0(%a6),%fp0
20822 fmov.l &0x0,%fpcr
20823
20824 fabs.x %fp0
20825 fcmp.b %fp0,&0x2
20826 fblt.w fout_dbl_exg
20827 bra.w fout_dbl_ovfl
20828
20829
20830
20831
20832
20833
20834
20835
20836
20837
20838
20839
20840
20841
20842
20843
20844
20845
20846
20847
20848
20849
20850
20851
20852
20853
20854
20855
20856
20857
20858
20859
20860
20861
20862
20863
20864
20865
20866
20867dst_dbl:
20868 clr.l %d0
20869 mov.w FTEMP_EX(%a0),%d0
20870 subi.w &EXT_BIAS,%d0
20871 addi.w &DBL_BIAS,%d0
20872 tst.b FTEMP_HI(%a0)
20873 bmi.b dst_get_dupper
20874 subq.w &0x1,%d0
20875dst_get_dupper:
20876 swap %d0
20877 lsl.l &0x4,%d0
20878 tst.b FTEMP_EX(%a0)
20879 bpl.b dst_get_dman
20880 bset &0x1f,%d0
20881dst_get_dman:
20882 mov.l FTEMP_HI(%a0),%d1
20883 bfextu %d1{&1:&20},%d1
20884 or.l %d1,%d0
20885 mov.l %d0,L_SCR1(%a6)
20886 mov.l FTEMP_HI(%a0),%d1
20887 mov.l &21,%d0
20888 lsl.l %d0,%d1
20889 mov.l %d1,L_SCR2(%a6)
20890 mov.l FTEMP_LO(%a0),%d1
20891 bfextu %d1{&0:&21},%d0
20892 mov.l L_SCR2(%a6),%d1
20893 or.l %d0,%d1
20894 mov.l L_SCR1(%a6),%d0
20895 rts
20896
20897
20898
20899
20900
20901
20902
20903
20904
20905
20906
20907
20908
20909
20910
20911
20912
20913
20914
20915
20916
20917
20918
20919
20920
20921
20922
20923
20924
20925
20926
20927
20928
20929
20930
20931
20932dst_sgl:
20933 clr.l %d0
20934 mov.w FTEMP_EX(%a0),%d0
20935 subi.w &EXT_BIAS,%d0
20936 addi.w &SGL_BIAS,%d0
20937 tst.b FTEMP_HI(%a0)
20938 bmi.b dst_get_supper
20939 subq.w &0x1,%d0
20940dst_get_supper:
20941 swap %d0
20942 lsl.l &0x7,%d0
20943 tst.b FTEMP_EX(%a0)
20944 bpl.b dst_get_sman
20945 bset &0x1f,%d0
20946dst_get_sman:
20947 mov.l FTEMP_HI(%a0),%d1
20948 andi.l &0x7fffff00,%d1
20949 lsr.l &0x8,%d1
20950 or.l %d1,%d0
20951 rts
20952
20953
20954fout_pack:
20955 bsr.l _calc_ea_fout
20956 mov.l %a0,-(%sp)
20957
20958 mov.b STAG(%a6),%d0
20959 bne.w fout_pack_not_norm
20960
20961fout_pack_norm:
20962 btst &0x4,EXC_CMDREG(%a6)
20963 beq.b fout_pack_s
20964
20965fout_pack_d:
20966 mov.b 1+EXC_CMDREG(%a6),%d1
20967 lsr.b &0x4,%d1
20968 andi.w &0x7,%d1
20969
20970 bsr.l fetch_dreg
20971
20972 bra.b fout_pack_type
20973fout_pack_s:
20974 mov.b 1+EXC_CMDREG(%a6),%d0
20975
20976fout_pack_type:
20977 bfexts %d0{&25:&7},%d0
20978 mov.l %d0,-(%sp)
20979
20980 lea FP_SRC(%a6),%a0
20981
20982
20983
20984 bsr.l bindec
20985
20986
20987 andi.l &0xcffff00f,FP_SCR0(%a6)
20988
20989 mov.l (%sp)+,%d0
20990
20991 tst.b 3+FP_SCR0_EX(%a6)
20992 bne.b fout_pack_set
20993 tst.l FP_SCR0_HI(%a6)
20994 bne.b fout_pack_set
20995 tst.l FP_SCR0_LO(%a6)
20996 bne.b fout_pack_set
20997
20998
20999
21000 tst.l %d0
21001 bne.b fout_pack_set
21002
21003
21004
21005
21006
21007 andi.w &0xf000,FP_SCR0(%a6)
21008
21009fout_pack_set:
21010
21011 lea FP_SCR0(%a6),%a0
21012
21013fout_pack_write:
21014 mov.l (%sp)+,%a1
21015 mov.l &0xc,%d0
21016
21017 cmpi.b SPCOND_FLG(%a6),&mda7_flg
21018 beq.b fout_pack_a7
21019
21020 bsr.l _dmem_write
21021
21022 tst.l %d1
21023 bne.w fout_ext_err
21024
21025 rts
21026
21027
21028
21029fout_pack_a7:
21030 bsr.l _mem_write2
21031
21032 tst.l %d1
21033 bne.w fout_ext_err
21034
21035 rts
21036
21037fout_pack_not_norm:
21038 cmpi.b %d0,&DENORM
21039 beq.w fout_pack_norm
21040 lea FP_SRC(%a6),%a0
21041 clr.w 2+FP_SRC_EX(%a6)
21042 cmpi.b %d0,&SNAN
21043 beq.b fout_pack_snan
21044 bra.b fout_pack_write
21045
21046fout_pack_snan:
21047 ori.w &snaniop2_mask,FPSR_EXCEPT(%a6)
21048 bset &0x6,FP_SRC_HI(%a6)
21049 bra.b fout_pack_write
21050
21051
21052
21053
21054
21055
21056
21057
21058
21059
21060
21061
21062
21063
21064
21065
21066
21067
21068
21069
21070
21071
21072
21073 global fetch_dreg
21074fetch_dreg:
21075 mov.w (tbl_fdreg.b,%pc,%d1.w*2),%d0
21076 jmp (tbl_fdreg.b,%pc,%d0.w*1)
21077
21078tbl_fdreg:
21079 short fdreg0 - tbl_fdreg
21080 short fdreg1 - tbl_fdreg
21081 short fdreg2 - tbl_fdreg
21082 short fdreg3 - tbl_fdreg
21083 short fdreg4 - tbl_fdreg
21084 short fdreg5 - tbl_fdreg
21085 short fdreg6 - tbl_fdreg
21086 short fdreg7 - tbl_fdreg
21087 short fdreg8 - tbl_fdreg
21088 short fdreg9 - tbl_fdreg
21089 short fdrega - tbl_fdreg
21090 short fdregb - tbl_fdreg
21091 short fdregc - tbl_fdreg
21092 short fdregd - tbl_fdreg
21093 short fdrege - tbl_fdreg
21094 short fdregf - tbl_fdreg
21095
21096fdreg0:
21097 mov.l EXC_DREGS+0x0(%a6),%d0
21098 rts
21099fdreg1:
21100 mov.l EXC_DREGS+0x4(%a6),%d0
21101 rts
21102fdreg2:
21103 mov.l %d2,%d0
21104 rts
21105fdreg3:
21106 mov.l %d3,%d0
21107 rts
21108fdreg4:
21109 mov.l %d4,%d0
21110 rts
21111fdreg5:
21112 mov.l %d5,%d0
21113 rts
21114fdreg6:
21115 mov.l %d6,%d0
21116 rts
21117fdreg7:
21118 mov.l %d7,%d0
21119 rts
21120fdreg8:
21121 mov.l EXC_DREGS+0x8(%a6),%d0
21122 rts
21123fdreg9:
21124 mov.l EXC_DREGS+0xc(%a6),%d0
21125 rts
21126fdrega:
21127 mov.l %a2,%d0
21128 rts
21129fdregb:
21130 mov.l %a3,%d0
21131 rts
21132fdregc:
21133 mov.l %a4,%d0
21134 rts
21135fdregd:
21136 mov.l %a5,%d0
21137 rts
21138fdrege:
21139 mov.l (%a6),%d0
21140 rts
21141fdregf:
21142 mov.l EXC_A7(%a6),%d0
21143 rts
21144
21145
21146
21147
21148
21149
21150
21151
21152
21153
21154
21155
21156
21157
21158
21159
21160
21161
21162
21163
21164
21165
21166 global store_dreg_l
21167store_dreg_l:
21168 mov.w (tbl_sdregl.b,%pc,%d1.w*2),%d1
21169 jmp (tbl_sdregl.b,%pc,%d1.w*1)
21170
21171tbl_sdregl:
21172 short sdregl0 - tbl_sdregl
21173 short sdregl1 - tbl_sdregl
21174 short sdregl2 - tbl_sdregl
21175 short sdregl3 - tbl_sdregl
21176 short sdregl4 - tbl_sdregl
21177 short sdregl5 - tbl_sdregl
21178 short sdregl6 - tbl_sdregl
21179 short sdregl7 - tbl_sdregl
21180
21181sdregl0:
21182 mov.l %d0,EXC_DREGS+0x0(%a6)
21183 rts
21184sdregl1:
21185 mov.l %d0,EXC_DREGS+0x4(%a6)
21186 rts
21187sdregl2:
21188 mov.l %d0,%d2
21189 rts
21190sdregl3:
21191 mov.l %d0,%d3
21192 rts
21193sdregl4:
21194 mov.l %d0,%d4
21195 rts
21196sdregl5:
21197 mov.l %d0,%d5
21198 rts
21199sdregl6:
21200 mov.l %d0,%d6
21201 rts
21202sdregl7:
21203 mov.l %d0,%d7
21204 rts
21205
21206
21207
21208
21209
21210
21211
21212
21213
21214
21215
21216
21217
21218
21219
21220
21221
21222
21223
21224
21225
21226
21227 global store_dreg_w
21228store_dreg_w:
21229 mov.w (tbl_sdregw.b,%pc,%d1.w*2),%d1
21230 jmp (tbl_sdregw.b,%pc,%d1.w*1)
21231
21232tbl_sdregw:
21233 short sdregw0 - tbl_sdregw
21234 short sdregw1 - tbl_sdregw
21235 short sdregw2 - tbl_sdregw
21236 short sdregw3 - tbl_sdregw
21237 short sdregw4 - tbl_sdregw
21238 short sdregw5 - tbl_sdregw
21239 short sdregw6 - tbl_sdregw
21240 short sdregw7 - tbl_sdregw
21241
21242sdregw0:
21243 mov.w %d0,2+EXC_DREGS+0x0(%a6)
21244 rts
21245sdregw1:
21246 mov.w %d0,2+EXC_DREGS+0x4(%a6)
21247 rts
21248sdregw2:
21249 mov.w %d0,%d2
21250 rts
21251sdregw3:
21252 mov.w %d0,%d3
21253 rts
21254sdregw4:
21255 mov.w %d0,%d4
21256 rts
21257sdregw5:
21258 mov.w %d0,%d5
21259 rts
21260sdregw6:
21261 mov.w %d0,%d6
21262 rts
21263sdregw7:
21264 mov.w %d0,%d7
21265 rts
21266
21267
21268
21269
21270
21271
21272
21273
21274
21275
21276
21277
21278
21279
21280
21281
21282
21283
21284
21285
21286
21287
21288 global store_dreg_b
21289store_dreg_b:
21290 mov.w (tbl_sdregb.b,%pc,%d1.w*2),%d1
21291 jmp (tbl_sdregb.b,%pc,%d1.w*1)
21292
21293tbl_sdregb:
21294 short sdregb0 - tbl_sdregb
21295 short sdregb1 - tbl_sdregb
21296 short sdregb2 - tbl_sdregb
21297 short sdregb3 - tbl_sdregb
21298 short sdregb4 - tbl_sdregb
21299 short sdregb5 - tbl_sdregb
21300 short sdregb6 - tbl_sdregb
21301 short sdregb7 - tbl_sdregb
21302
21303sdregb0:
21304 mov.b %d0,3+EXC_DREGS+0x0(%a6)
21305 rts
21306sdregb1:
21307 mov.b %d0,3+EXC_DREGS+0x4(%a6)
21308 rts
21309sdregb2:
21310 mov.b %d0,%d2
21311 rts
21312sdregb3:
21313 mov.b %d0,%d3
21314 rts
21315sdregb4:
21316 mov.b %d0,%d4
21317 rts
21318sdregb5:
21319 mov.b %d0,%d5
21320 rts
21321sdregb6:
21322 mov.b %d0,%d6
21323 rts
21324sdregb7:
21325 mov.b %d0,%d7
21326 rts
21327
21328
21329
21330
21331
21332
21333
21334
21335
21336
21337
21338
21339
21340
21341
21342
21343
21344
21345
21346
21347
21348
21349
21350
21351
21352
21353
21354 global inc_areg
21355inc_areg:
21356 mov.w (tbl_iareg.b,%pc,%d1.w*2),%d1
21357 jmp (tbl_iareg.b,%pc,%d1.w*1)
21358
21359tbl_iareg:
21360 short iareg0 - tbl_iareg
21361 short iareg1 - tbl_iareg
21362 short iareg2 - tbl_iareg
21363 short iareg3 - tbl_iareg
21364 short iareg4 - tbl_iareg
21365 short iareg5 - tbl_iareg
21366 short iareg6 - tbl_iareg
21367 short iareg7 - tbl_iareg
21368
21369iareg0: add.l %d0,EXC_DREGS+0x8(%a6)
21370 rts
21371iareg1: add.l %d0,EXC_DREGS+0xc(%a6)
21372 rts
21373iareg2: add.l %d0,%a2
21374 rts
21375iareg3: add.l %d0,%a3
21376 rts
21377iareg4: add.l %d0,%a4
21378 rts
21379iareg5: add.l %d0,%a5
21380 rts
21381iareg6: add.l %d0,(%a6)
21382 rts
21383iareg7: mov.b &mia7_flg,SPCOND_FLG(%a6)
21384 cmpi.b %d0,&0x1
21385 beq.b iareg7b
21386 add.l %d0,EXC_A7(%a6)
21387 rts
21388iareg7b:
21389 addq.l &0x2,EXC_A7(%a6)
21390 rts
21391
21392
21393
21394
21395
21396
21397
21398
21399
21400
21401
21402
21403
21404
21405
21406
21407
21408
21409
21410
21411
21412
21413
21414
21415
21416
21417
21418 global dec_areg
21419dec_areg:
21420 mov.w (tbl_dareg.b,%pc,%d1.w*2),%d1
21421 jmp (tbl_dareg.b,%pc,%d1.w*1)
21422
21423tbl_dareg:
21424 short dareg0 - tbl_dareg
21425 short dareg1 - tbl_dareg
21426 short dareg2 - tbl_dareg
21427 short dareg3 - tbl_dareg
21428 short dareg4 - tbl_dareg
21429 short dareg5 - tbl_dareg
21430 short dareg6 - tbl_dareg
21431 short dareg7 - tbl_dareg
21432
21433dareg0: sub.l %d0,EXC_DREGS+0x8(%a6)
21434 rts
21435dareg1: sub.l %d0,EXC_DREGS+0xc(%a6)
21436 rts
21437dareg2: sub.l %d0,%a2
21438 rts
21439dareg3: sub.l %d0,%a3
21440 rts
21441dareg4: sub.l %d0,%a4
21442 rts
21443dareg5: sub.l %d0,%a5
21444 rts
21445dareg6: sub.l %d0,(%a6)
21446 rts
21447dareg7: mov.b &mda7_flg,SPCOND_FLG(%a6)
21448 cmpi.b %d0,&0x1
21449 beq.b dareg7b
21450 sub.l %d0,EXC_A7(%a6)
21451 rts
21452dareg7b:
21453 subq.l &0x2,EXC_A7(%a6)
21454 rts
21455
21456
21457
21458
21459
21460
21461
21462
21463
21464
21465
21466
21467
21468
21469
21470
21471
21472
21473
21474
21475
21476
21477 global load_fpn1
21478load_fpn1:
21479 mov.w (tbl_load_fpn1.b,%pc,%d0.w*2), %d0
21480 jmp (tbl_load_fpn1.b,%pc,%d0.w*1)
21481
21482tbl_load_fpn1:
21483 short load_fpn1_0 - tbl_load_fpn1
21484 short load_fpn1_1 - tbl_load_fpn1
21485 short load_fpn1_2 - tbl_load_fpn1
21486 short load_fpn1_3 - tbl_load_fpn1
21487 short load_fpn1_4 - tbl_load_fpn1
21488 short load_fpn1_5 - tbl_load_fpn1
21489 short load_fpn1_6 - tbl_load_fpn1
21490 short load_fpn1_7 - tbl_load_fpn1
21491
21492load_fpn1_0:
21493 mov.l 0+EXC_FP0(%a6), 0+FP_SRC(%a6)
21494 mov.l 4+EXC_FP0(%a6), 4+FP_SRC(%a6)
21495 mov.l 8+EXC_FP0(%a6), 8+FP_SRC(%a6)
21496 lea FP_SRC(%a6), %a0
21497 rts
21498load_fpn1_1:
21499 mov.l 0+EXC_FP1(%a6), 0+FP_SRC(%a6)
21500 mov.l 4+EXC_FP1(%a6), 4+FP_SRC(%a6)
21501 mov.l 8+EXC_FP1(%a6), 8+FP_SRC(%a6)
21502 lea FP_SRC(%a6), %a0
21503 rts
21504load_fpn1_2:
21505 fmovm.x &0x20, FP_SRC(%a6)
21506 lea FP_SRC(%a6), %a0
21507 rts
21508load_fpn1_3:
21509 fmovm.x &0x10, FP_SRC(%a6)
21510 lea FP_SRC(%a6), %a0
21511 rts
21512load_fpn1_4:
21513 fmovm.x &0x08, FP_SRC(%a6)
21514 lea FP_SRC(%a6), %a0
21515 rts
21516load_fpn1_5:
21517 fmovm.x &0x04, FP_SRC(%a6)
21518 lea FP_SRC(%a6), %a0
21519 rts
21520load_fpn1_6:
21521 fmovm.x &0x02, FP_SRC(%a6)
21522 lea FP_SRC(%a6), %a0
21523 rts
21524load_fpn1_7:
21525 fmovm.x &0x01, FP_SRC(%a6)
21526 lea FP_SRC(%a6), %a0
21527 rts
21528
21529
21530
21531
21532
21533
21534
21535
21536
21537
21538
21539
21540
21541
21542
21543
21544
21545
21546
21547
21548
21549
21550 global load_fpn2
21551load_fpn2:
21552 mov.w (tbl_load_fpn2.b,%pc,%d0.w*2), %d0
21553 jmp (tbl_load_fpn2.b,%pc,%d0.w*1)
21554
21555tbl_load_fpn2:
21556 short load_fpn2_0 - tbl_load_fpn2
21557 short load_fpn2_1 - tbl_load_fpn2
21558 short load_fpn2_2 - tbl_load_fpn2
21559 short load_fpn2_3 - tbl_load_fpn2
21560 short load_fpn2_4 - tbl_load_fpn2
21561 short load_fpn2_5 - tbl_load_fpn2
21562 short load_fpn2_6 - tbl_load_fpn2
21563 short load_fpn2_7 - tbl_load_fpn2
21564
21565load_fpn2_0:
21566 mov.l 0+EXC_FP0(%a6), 0+FP_DST(%a6)
21567 mov.l 4+EXC_FP0(%a6), 4+FP_DST(%a6)
21568 mov.l 8+EXC_FP0(%a6), 8+FP_DST(%a6)
21569 lea FP_DST(%a6), %a0
21570 rts
21571load_fpn2_1:
21572 mov.l 0+EXC_FP1(%a6), 0+FP_DST(%a6)
21573 mov.l 4+EXC_FP1(%a6), 4+FP_DST(%a6)
21574 mov.l 8+EXC_FP1(%a6), 8+FP_DST(%a6)
21575 lea FP_DST(%a6), %a0
21576 rts
21577load_fpn2_2:
21578 fmovm.x &0x20, FP_DST(%a6)
21579 lea FP_DST(%a6), %a0
21580 rts
21581load_fpn2_3:
21582 fmovm.x &0x10, FP_DST(%a6)
21583 lea FP_DST(%a6), %a0
21584 rts
21585load_fpn2_4:
21586 fmovm.x &0x08, FP_DST(%a6)
21587 lea FP_DST(%a6), %a0
21588 rts
21589load_fpn2_5:
21590 fmovm.x &0x04, FP_DST(%a6)
21591 lea FP_DST(%a6), %a0
21592 rts
21593load_fpn2_6:
21594 fmovm.x &0x02, FP_DST(%a6)
21595 lea FP_DST(%a6), %a0
21596 rts
21597load_fpn2_7:
21598 fmovm.x &0x01, FP_DST(%a6)
21599 lea FP_DST(%a6), %a0
21600 rts
21601
21602
21603
21604
21605
21606
21607
21608
21609
21610
21611
21612
21613
21614
21615
21616
21617
21618
21619
21620
21621
21622
21623
21624
21625 global store_fpreg
21626store_fpreg:
21627 mov.w (tbl_store_fpreg.b,%pc,%d0.w*2), %d0
21628 jmp (tbl_store_fpreg.b,%pc,%d0.w*1)
21629
21630tbl_store_fpreg:
21631 short store_fpreg_0 - tbl_store_fpreg
21632 short store_fpreg_1 - tbl_store_fpreg
21633 short store_fpreg_2 - tbl_store_fpreg
21634 short store_fpreg_3 - tbl_store_fpreg
21635 short store_fpreg_4 - tbl_store_fpreg
21636 short store_fpreg_5 - tbl_store_fpreg
21637 short store_fpreg_6 - tbl_store_fpreg
21638 short store_fpreg_7 - tbl_store_fpreg
21639
21640store_fpreg_0:
21641 fmovm.x &0x80, EXC_FP0(%a6)
21642 rts
21643store_fpreg_1:
21644 fmovm.x &0x80, EXC_FP1(%a6)
21645 rts
21646store_fpreg_2:
21647 fmovm.x &0x01, -(%sp)
21648 fmovm.x (%sp)+, &0x20
21649 rts
21650store_fpreg_3:
21651 fmovm.x &0x01, -(%sp)
21652 fmovm.x (%sp)+, &0x10
21653 rts
21654store_fpreg_4:
21655 fmovm.x &0x01, -(%sp)
21656 fmovm.x (%sp)+, &0x08
21657 rts
21658store_fpreg_5:
21659 fmovm.x &0x01, -(%sp)
21660 fmovm.x (%sp)+, &0x04
21661 rts
21662store_fpreg_6:
21663 fmovm.x &0x01, -(%sp)
21664 fmovm.x (%sp)+, &0x02
21665 rts
21666store_fpreg_7:
21667 fmovm.x &0x01, -(%sp)
21668 fmovm.x (%sp)+, &0x01
21669 rts
21670
21671
21672
21673
21674
21675
21676
21677
21678
21679
21680
21681
21682
21683
21684
21685
21686
21687
21688
21689
21690
21691
21692
21693
21694
21695
21696
21697
21698
21699
21700
21701
21702
21703
21704
21705tbl_thresh:
21706 short 0x0
21707 short sgl_thresh
21708 short dbl_thresh
21709
21710 global _denorm
21711_denorm:
21712
21713
21714
21715
21716
21717
21718 lsr.b &0x2, %d0
21719 mov.w (tbl_thresh.b,%pc,%d0.w*2), %d1
21720 mov.w %d1, %d0
21721 sub.w FTEMP_EX(%a0), %d0
21722 cmpi.w %d0, &66
21723 bpl.b denorm_set_stky
21724
21725 clr.l %d0
21726 btst &inex2_bit, FPSR_EXCEPT(%a6)
21727 beq.b denorm_call
21728 bset &29, %d0
21729
21730denorm_call:
21731 bsr.l dnrm_lp
21732 rts
21733
21734
21735
21736
21737
21738denorm_set_stky:
21739 mov.l &0x20000000, %d0
21740 mov.w %d1, FTEMP_EX(%a0)
21741 clr.l FTEMP_HI(%a0)
21742 clr.l FTEMP_LO(%a0)
21743 rts
21744
21745
21746
21747
21748
21749
21750
21751
21752
21753
21754
21755
21756
21757
21758set GRS, L_SCR2
21759set FTEMP_LO2, L_SCR1
21760
21761 global dnrm_lp
21762dnrm_lp:
21763
21764
21765
21766
21767
21768 mov.l FTEMP_LO(%a0), FTEMP_LO2(%a6)
21769 mov.l %d0, GRS(%a6)
21770
21771
21772
21773
21774
21775 mov.l %d1, %d0
21776 sub.w FTEMP_EX(%a0), %d1
21777 ble.b dnrm_no_lp
21778 cmpi.w %d1, &0x20
21779 blt.b case_1
21780 cmpi.w %d1, &0x40
21781 blt.b case_2
21782 bra.w case_3
21783
21784
21785
21786
21787dnrm_no_lp:
21788 mov.l GRS(%a6), %d0
21789 rts
21790
21791
21792
21793
21794
21795
21796
21797
21798
21799
21800
21801
21802
21803
21804
21805
21806
21807
21808
21809
21810
21811
21812
21813
21814case_1:
21815 mov.l %d2, -(%sp)
21816
21817 mov.w %d0, FTEMP_EX(%a0)
21818 mov.l &32, %d0
21819 sub.w %d1, %d0
21820
21821 cmpi.w %d1, &29
21822 blt.b case1_extract
21823 mov.b GRS(%a6), %d2
21824 or.b %d2, 3+FTEMP_LO2(%a6)
21825
21826case1_extract:
21827 bfextu FTEMP_HI(%a0){&0:%d0}, %d2
21828 bfextu FTEMP_HI(%a0){%d0:&32}, %d1
21829 bfextu FTEMP_LO2(%a6){%d0:&32}, %d0
21830
21831 mov.l %d2, FTEMP_HI(%a0)
21832 mov.l %d1, FTEMP_LO(%a0)
21833
21834 bftst %d0{&2:&30}
21835 beq.b case1_sticky_clear
21836 bset &rnd_stky_bit, %d0
21837
21838case1_sticky_clear:
21839 and.l &0xe0000000, %d0
21840 mov.l (%sp)+, %d2
21841 rts
21842
21843
21844
21845
21846
21847
21848
21849
21850
21851
21852
21853
21854
21855
21856
21857
21858
21859
21860
21861
21862
21863
21864
21865
21866case_2:
21867 mov.l %d2, -(%sp)
21868
21869 mov.w %d0, FTEMP_EX(%a0)
21870 subi.w &0x20, %d1
21871 mov.l &0x20, %d0
21872 sub.w %d1, %d0
21873
21874
21875
21876
21877 mov.b GRS(%a6), %d2
21878 or.b %d2, 3+FTEMP_LO2(%a6)
21879
21880 bfextu FTEMP_HI(%a0){&0:%d0}, %d2
21881 bfextu FTEMP_HI(%a0){%d0:&32}, %d1
21882
21883 bftst %d1{&2:&30}
21884 bne.b case2_set_sticky
21885 bftst FTEMP_LO2(%a6){%d0:&31}
21886 bne.b case2_set_sticky
21887
21888 mov.l %d1, %d0
21889 bra.b case2_end
21890
21891case2_set_sticky:
21892 mov.l %d1, %d0
21893 bset &rnd_stky_bit, %d0
21894
21895case2_end:
21896 clr.l FTEMP_HI(%a0)
21897 mov.l %d2, FTEMP_LO(%a0)
21898 and.l &0xe0000000, %d0
21899
21900 mov.l (%sp)+,%d2
21901 rts
21902
21903
21904
21905
21906
21907
21908
21909case_3:
21910 mov.w %d0, FTEMP_EX(%a0)
21911
21912 cmpi.w %d1, &65
21913 blt.b case3_64
21914 beq.b case3_65
21915
21916
21917
21918
21919
21920
21921
21922 clr.l FTEMP_HI(%a0)
21923 clr.l FTEMP_LO(%a0)
21924 mov.l &0x20000000, %d0
21925 rts
21926
21927
21928
21929
21930
21931
21932
21933
21934
21935
21936
21937
21938
21939
21940
21941
21942
21943
21944
21945
21946
21947case3_64:
21948 mov.l FTEMP_HI(%a0), %d0
21949 mov.l %d0, %d1
21950 and.l &0xc0000000, %d0
21951 and.l &0x3fffffff, %d1
21952
21953 bra.b case3_complete
21954
21955
21956
21957
21958
21959
21960
21961
21962
21963
21964
21965
21966
21967
21968
21969
21970
21971
21972
21973
21974
21975case3_65:
21976 mov.l FTEMP_HI(%a0), %d0
21977 and.l &0x80000000, %d0
21978 lsr.l &0x1, %d0
21979 and.l &0x7fffffff, %d1
21980
21981case3_complete:
21982
21983
21984 bne.b case3_set_sticky
21985 tst.l FTEMP_LO(%a0)
21986 bne.b case3_set_sticky
21987 tst.b GRS(%a6)
21988 bne.b case3_set_sticky
21989
21990
21991
21992
21993
21994
21995 clr.l FTEMP_HI(%a0)
21996 clr.l FTEMP_LO(%a0)
21997 rts
21998
21999
22000
22001
22002
22003case3_set_sticky:
22004 bset &rnd_stky_bit,%d0
22005 clr.l FTEMP_HI(%a0)
22006 clr.l FTEMP_LO(%a0)
22007 rts
22008
22009
22010
22011
22012
22013
22014
22015
22016
22017
22018
22019
22020
22021
22022
22023
22024
22025
22026
22027
22028
22029
22030
22031
22032
22033
22034
22035
22036
22037
22038
22039
22040
22041
22042
22043 global _round
22044_round:
22045
22046
22047
22048
22049
22050
22051 bsr.l ext_grs
22052
22053 tst.l %d0
22054 beq.w truncate
22055
22056 or.w &inx2a_mask, 2+USER_FPSR(%a6)
22057
22058
22059
22060
22061
22062 mov.w (tbl_mode.b,%pc,%d1.w*2), %a1
22063 jmp (tbl_mode.b,%pc,%a1)
22064
22065tbl_mode:
22066 short rnd_near - tbl_mode
22067 short truncate - tbl_mode
22068 short rnd_mnus - tbl_mode
22069 short rnd_plus - tbl_mode
22070
22071
22072
22073
22074
22075
22076rnd_plus:
22077 tst.b FTEMP_SGN(%a0)
22078 bmi.w truncate
22079
22080 mov.l &0xffffffff, %d0
22081 swap %d1
22082
22083 cmpi.b %d1, &s_mode
22084 beq.w add_sgl
22085 bgt.w add_dbl
22086 bra.w add_ext
22087
22088
22089
22090
22091
22092
22093rnd_mnus:
22094 tst.b FTEMP_SGN(%a0)
22095 bpl.w truncate
22096
22097 mov.l &0xffffffff, %d0
22098 swap %d1
22099
22100 cmpi.b %d1, &s_mode
22101 beq.w add_sgl
22102 bgt.w add_dbl
22103 bra.w add_ext
22104
22105
22106
22107
22108
22109
22110
22111rnd_near:
22112 asl.l &0x1, %d0
22113 bcc.w truncate
22114
22115 swap %d1
22116
22117 cmpi.b %d1, &s_mode
22118 beq.w add_sgl
22119 bgt.w add_dbl
22120 bra.w add_ext
22121
22122
22123set ad_1_sgl, 0x00000100
22124set ad_1_dbl, 0x00000800
22125
22126
22127
22128
22129add_sgl:
22130 add.l &ad_1_sgl, FTEMP_HI(%a0)
22131 bcc.b scc_clr
22132 roxr.w FTEMP_HI(%a0)
22133 roxr.w FTEMP_HI+2(%a0)
22134 add.w &0x1, FTEMP_EX(%a0)
22135scc_clr:
22136 tst.l %d0
22137 bne.b sgl_done
22138 and.w &0xfe00, FTEMP_HI+2(%a0)
22139sgl_done:
22140 and.l &0xffffff00, FTEMP_HI(%a0)
22141 clr.l FTEMP_LO(%a0)
22142 rts
22143
22144
22145
22146
22147add_ext:
22148 addq.l &1,FTEMP_LO(%a0)
22149 bcc.b xcc_clr
22150 addq.l &1,FTEMP_HI(%a0)
22151 bcc.b xcc_clr
22152 roxr.w FTEMP_HI(%a0)
22153 roxr.w FTEMP_HI+2(%a0)
22154 roxr.w FTEMP_LO(%a0)
22155 roxr.w FTEMP_LO+2(%a0)
22156 add.w &0x1,FTEMP_EX(%a0)
22157xcc_clr:
22158 tst.l %d0
22159 bne.b add_ext_done
22160 and.b &0xfe,FTEMP_LO+3(%a0)
22161add_ext_done:
22162 rts
22163
22164
22165
22166
22167add_dbl:
22168 add.l &ad_1_dbl, FTEMP_LO(%a0)
22169 bcc.b dcc_clr
22170 addq.l &0x1, FTEMP_HI(%a0)
22171 bcc.b dcc_clr
22172
22173 roxr.w FTEMP_HI(%a0)
22174 roxr.w FTEMP_HI+2(%a0)
22175 roxr.w FTEMP_LO(%a0)
22176 roxr.w FTEMP_LO+2(%a0)
22177 addq.w &0x1, FTEMP_EX(%a0)
22178dcc_clr:
22179 tst.l %d0
22180 bne.b dbl_done
22181 and.w &0xf000, FTEMP_LO+2(%a0)
22182
22183dbl_done:
22184 and.l &0xfffff800,FTEMP_LO(%a0)
22185 rts
22186
22187
22188
22189
22190truncate:
22191 swap %d1
22192
22193 cmpi.b %d1, &s_mode
22194 beq.w sgl_done
22195 bgt.b dbl_done
22196 rts
22197
22198
22199
22200
22201
22202
22203
22204
22205
22206
22207
22208
22209
22210
22211
22212
22213
22214
22215
22216
22217
22218
22219
22220ext_grs:
22221 swap %d1
22222 tst.b %d1
22223 bne.b ext_grs_not_ext
22224
22225
22226
22227
22228
22229ext_grs_ext:
22230 swap %d1
22231 rts
22232
22233ext_grs_not_ext:
22234 movm.l &0x3000, -(%sp)
22235
22236 cmpi.b %d1, &s_mode
22237 bne.b ext_grs_dbl
22238
22239
22240
22241
22242
22243
22244
22245
22246
22247
22248
22249
22250
22251ext_grs_sgl:
22252 bfextu FTEMP_HI(%a0){&24:&2}, %d3
22253 mov.l &30, %d2
22254 lsl.l %d2, %d3
22255 mov.l FTEMP_HI(%a0), %d2
22256 and.l &0x0000003f, %d2
22257 bne.b ext_grs_st_stky
22258 tst.l FTEMP_LO(%a0)
22259 bne.b ext_grs_st_stky
22260 tst.l %d0
22261 bne.b ext_grs_st_stky
22262 bra.b ext_grs_end_sd
22263
22264
22265
22266
22267
22268
22269
22270
22271
22272
22273
22274
22275
22276ext_grs_dbl:
22277 bfextu FTEMP_LO(%a0){&21:&2}, %d3
22278 mov.l &30, %d2
22279 lsl.l %d2, %d3
22280 mov.l FTEMP_LO(%a0), %d2
22281 and.l &0x000001ff, %d2
22282 bne.b ext_grs_st_stky
22283 tst.l %d0
22284 bne.b ext_grs_st_stky
22285 bra.b ext_grs_end_sd
22286
22287ext_grs_st_stky:
22288 bset &rnd_stky_bit, %d3
22289ext_grs_end_sd:
22290 mov.l %d3, %d0
22291
22292 movm.l (%sp)+, &0xc
22293
22294 swap %d1
22295 rts
22296
22297
22298
22299
22300
22301
22302
22303
22304
22305
22306
22307
22308
22309
22310
22311
22312
22313
22314
22315
22316 global norm
22317norm:
22318 mov.l %d2, -(%sp)
22319 mov.l %d3, -(%sp)
22320
22321 mov.l FTEMP_HI(%a0), %d0
22322 mov.l FTEMP_LO(%a0), %d1
22323
22324 bfffo %d0{&0:&32}, %d2
22325 beq.b norm_lo
22326
22327norm_hi:
22328 lsl.l %d2, %d0
22329 bfextu %d1{&0:%d2}, %d3
22330
22331 or.l %d3, %d0
22332 lsl.l %d2, %d1
22333
22334 mov.l %d0, FTEMP_HI(%a0)
22335 mov.l %d1, FTEMP_LO(%a0)
22336
22337 mov.l %d2, %d0
22338
22339 mov.l (%sp)+, %d3
22340 mov.l (%sp)+, %d2
22341
22342 rts
22343
22344norm_lo:
22345 bfffo %d1{&0:&32}, %d2
22346 lsl.l %d2, %d1
22347 add.l &32, %d2
22348
22349 mov.l %d1, FTEMP_HI(%a0)
22350 clr.l FTEMP_LO(%a0)
22351
22352 mov.l %d2, %d0
22353
22354 mov.l (%sp)+, %d3
22355 mov.l (%sp)+, %d2
22356
22357 rts
22358
22359
22360
22361
22362
22363
22364
22365
22366
22367
22368
22369
22370
22371
22372
22373
22374
22375
22376
22377
22378
22379 global unnorm_fix
22380unnorm_fix:
22381 bfffo FTEMP_HI(%a0){&0:&32}, %d0
22382 bne.b unnorm_shift
22383
22384
22385
22386
22387unnorm_chk_lo:
22388 bfffo FTEMP_LO(%a0){&0:&32}, %d0
22389 beq.w unnorm_zero
22390
22391 add.w &32, %d0
22392
22393
22394
22395
22396unnorm_shift:
22397 clr.l %d1
22398 mov.w FTEMP_EX(%a0), %d1
22399 and.w &0x7fff, %d1
22400
22401 cmp.w %d0, %d1
22402 bgt.b unnorm_nrm_zero
22403
22404
22405
22406
22407 sub.w %d0, %d1
22408 mov.w FTEMP_EX(%a0), %d0
22409 and.w &0x8000, %d0
22410 or.w %d0, %d1
22411 mov.w %d1, FTEMP_EX(%a0)
22412
22413 bsr.l norm
22414
22415 mov.b &NORM, %d0
22416 rts
22417
22418
22419
22420
22421unnorm_nrm_zero:
22422 cmp.b %d1, &32
22423 bgt.b unnorm_nrm_zero_lrg
22424
22425 bfextu FTEMP_HI(%a0){%d1:&32}, %d0
22426 mov.l %d0, FTEMP_HI(%a0)
22427
22428 mov.l FTEMP_LO(%a0), %d0
22429 lsl.l %d1, %d0
22430 mov.l %d0, FTEMP_LO(%a0)
22431
22432 and.w &0x8000, FTEMP_EX(%a0)
22433
22434 mov.b &DENORM, %d0
22435 rts
22436
22437
22438
22439
22440unnorm_nrm_zero_lrg:
22441 sub.w &32, %d1
22442
22443 mov.l FTEMP_LO(%a0), %d0
22444 lsl.l %d1, %d0
22445
22446 mov.l %d0, FTEMP_HI(%a0)
22447 clr.l FTEMP_LO(%a0)
22448
22449 and.w &0x8000, FTEMP_EX(%a0)
22450
22451 mov.b &DENORM, %d0
22452 rts
22453
22454
22455
22456
22457unnorm_zero:
22458 and.w &0x8000, FTEMP_EX(%a0)
22459
22460 mov.b &ZERO, %d0
22461 rts
22462
22463
22464
22465
22466
22467
22468
22469
22470
22471
22472
22473
22474
22475
22476
22477
22478
22479
22480
22481
22482
22483
22484
22485 global set_tag_x
22486set_tag_x:
22487 mov.w FTEMP_EX(%a0), %d0
22488 andi.w &0x7fff, %d0
22489 cmpi.w %d0, &0x7fff
22490 beq.b inf_or_nan_x
22491not_inf_or_nan_x:
22492 btst &0x7,FTEMP_HI(%a0)
22493 beq.b not_norm_x
22494is_norm_x:
22495 mov.b &NORM, %d0
22496 rts
22497not_norm_x:
22498 tst.w %d0
22499 bne.b is_unnorm_x
22500not_unnorm_x:
22501 tst.l FTEMP_HI(%a0)
22502 bne.b is_denorm_x
22503 tst.l FTEMP_LO(%a0)
22504 bne.b is_denorm_x
22505is_zero_x:
22506 mov.b &ZERO, %d0
22507 rts
22508is_denorm_x:
22509 mov.b &DENORM, %d0
22510 rts
22511
22512
22513is_unnorm_x:
22514 tst.l FTEMP_HI(%a0)
22515 bne.b is_unnorm_reg_x
22516 tst.l FTEMP_LO(%a0)
22517 bne.b is_unnorm_reg_x
22518
22519 andi.w &0x8000,FTEMP_EX(%a0)
22520 mov.b &ZERO, %d0
22521 rts
22522is_unnorm_reg_x:
22523 mov.b &UNNORM, %d0
22524 rts
22525inf_or_nan_x:
22526 tst.l FTEMP_LO(%a0)
22527 bne.b is_nan_x
22528 mov.l FTEMP_HI(%a0), %d0
22529 and.l &0x7fffffff, %d0
22530 bne.b is_nan_x
22531is_inf_x:
22532 mov.b &INF, %d0
22533 rts
22534is_nan_x:
22535 btst &0x6, FTEMP_HI(%a0)
22536 beq.b is_snan_x
22537 mov.b &QNAN, %d0
22538 rts
22539is_snan_x:
22540 mov.b &SNAN, %d0
22541 rts
22542
22543
22544
22545
22546
22547
22548
22549
22550
22551
22552
22553
22554
22555
22556
22557
22558
22559
22560
22561
22562
22563 global set_tag_d
22564set_tag_d:
22565 mov.l FTEMP(%a0), %d0
22566 mov.l %d0, %d1
22567
22568 andi.l &0x7ff00000, %d0
22569 beq.b zero_or_denorm_d
22570
22571 cmpi.l %d0, &0x7ff00000
22572 beq.b inf_or_nan_d
22573
22574is_norm_d:
22575 mov.b &NORM, %d0
22576 rts
22577zero_or_denorm_d:
22578 and.l &0x000fffff, %d1
22579 bne is_denorm_d
22580 tst.l 4+FTEMP(%a0)
22581 bne is_denorm_d
22582is_zero_d:
22583 mov.b &ZERO, %d0
22584 rts
22585is_denorm_d:
22586 mov.b &DENORM, %d0
22587 rts
22588inf_or_nan_d:
22589 and.l &0x000fffff, %d1
22590 bne is_nan_d
22591 tst.l 4+FTEMP(%a0)
22592 bne is_nan_d
22593is_inf_d:
22594 mov.b &INF, %d0
22595 rts
22596is_nan_d:
22597 btst &19, %d1
22598 bne is_qnan_d
22599is_snan_d:
22600 mov.b &SNAN, %d0
22601 rts
22602is_qnan_d:
22603 mov.b &QNAN, %d0
22604 rts
22605
22606
22607
22608
22609
22610
22611
22612
22613
22614
22615
22616
22617
22618
22619
22620
22621
22622
22623
22624
22625
22626 global set_tag_s
22627set_tag_s:
22628 mov.l FTEMP(%a0), %d0
22629 mov.l %d0, %d1
22630
22631 andi.l &0x7f800000, %d0
22632 beq.b zero_or_denorm_s
22633
22634 cmpi.l %d0, &0x7f800000
22635 beq.b inf_or_nan_s
22636
22637is_norm_s:
22638 mov.b &NORM, %d0
22639 rts
22640zero_or_denorm_s:
22641 and.l &0x007fffff, %d1
22642 bne is_denorm_s
22643is_zero_s:
22644 mov.b &ZERO, %d0
22645 rts
22646is_denorm_s:
22647 mov.b &DENORM, %d0
22648 rts
22649inf_or_nan_s:
22650 and.l &0x007fffff, %d1
22651 bne is_nan_s
22652is_inf_s:
22653 mov.b &INF, %d0
22654 rts
22655is_nan_s:
22656 btst &22, %d1
22657 bne is_qnan_s
22658is_snan_s:
22659 mov.b &SNAN, %d0
22660 rts
22661is_qnan_s:
22662 mov.b &QNAN, %d0
22663 rts
22664
22665
22666
22667
22668
22669
22670
22671
22672
22673
22674
22675
22676
22677
22678
22679
22680
22681
22682
22683
22684
22685
22686
22687
22688
22689
22690
22691
22692
22693
22694
22695
22696
22697
22698
22699 global unf_res
22700unf_res:
22701 mov.l %d1, -(%sp)
22702
22703 btst &0x7, FTEMP_EX(%a0)
22704 sne FTEMP_SGN(%a0)
22705
22706 mov.w FTEMP_EX(%a0), %d1
22707 and.w &0x7fff, %d1
22708 sub.w %d0, %d1
22709 mov.w %d1, FTEMP_EX(%a0)
22710
22711 mov.l %a0, -(%sp)
22712
22713 mov.l 0x4(%sp),%d0
22714 andi.w &0x00c0,%d0
22715 lsr.w &0x4,%d0
22716 bsr.l _denorm
22717
22718 mov.l (%sp),%a0
22719 mov.w 0x6(%sp),%d1
22720 andi.w &0xc0,%d1
22721 lsr.w &0x4,%d1
22722 swap %d1
22723 mov.w 0x6(%sp),%d1
22724 andi.w &0x30,%d1
22725 lsr.w &0x4,%d1
22726 bsr.l _round
22727
22728 mov.l (%sp)+, %a0
22729
22730
22731 bclr &0x7, FTEMP_EX(%a0)
22732 tst.b FTEMP_SGN(%a0)
22733 beq.b unf_res_chkifzero
22734 bset &0x7, FTEMP_EX(%a0)
22735 clr.b FTEMP_SGN(%a0)
22736
22737
22738unf_res_chkifzero:
22739 clr.l %d0
22740 tst.l FTEMP_HI(%a0)
22741 bne.b unf_res_cont
22742 tst.l FTEMP_LO(%a0)
22743 bne.b unf_res_cont
22744
22745 bset &z_bit, %d0
22746
22747unf_res_cont:
22748
22749
22750
22751
22752
22753
22754 btst &inex2_bit, FPSR_EXCEPT(%a6)
22755 beq.b unf_res_end
22756 bset &aunfl_bit, FPSR_AEXCEPT(%a6)
22757
22758unf_res_end:
22759 add.l &0x4, %sp
22760 rts
22761
22762
22763 global unf_res4
22764unf_res4:
22765 mov.l %d1,-(%sp)
22766
22767 btst &0x7,FTEMP_EX(%a0)
22768 sne FTEMP_SGN(%a0)
22769
22770 mov.w FTEMP_EX(%a0),%d1
22771 and.w &0x7fff,%d1
22772 sub.w %d0,%d1
22773 mov.w %d1,FTEMP_EX(%a0)
22774
22775 mov.l %a0,-(%sp)
22776
22777 clr.l %d0
22778 bsr.l _denorm
22779
22780 mov.l (%sp),%a0
22781 mov.w &s_mode,%d1
22782 swap %d1
22783 mov.w 0x6(%sp),%d1
22784 andi.w &0x30,%d1
22785 lsr.w &0x4,%d1
22786 bsr.l _round
22787
22788 mov.l (%sp)+,%a0
22789
22790
22791 bclr &0x7,FTEMP_EX(%a0)
22792 tst.b FTEMP_SGN(%a0)
22793 beq.b unf_res4_chkifzero
22794 bset &0x7,FTEMP_EX(%a0)
22795 clr.b FTEMP_SGN(%a0)
22796
22797
22798unf_res4_chkifzero:
22799 clr.l %d0
22800 tst.l FTEMP_HI(%a0)
22801 bne.b unf_res4_cont
22802 tst.l FTEMP_LO(%a0)
22803 bne.b unf_res4_cont
22804
22805 bset &z_bit,%d0
22806
22807unf_res4_cont:
22808
22809
22810
22811
22812
22813
22814 btst &inex2_bit,FPSR_EXCEPT(%a6)
22815 beq.b unf_res4_end
22816 bset &aunfl_bit,FPSR_AEXCEPT(%a6)
22817
22818unf_res4_end:
22819 add.l &0x4,%sp
22820 rts
22821
22822
22823
22824
22825
22826
22827
22828
22829
22830
22831
22832
22833
22834
22835
22836
22837
22838
22839
22840
22841
22842
22843
22844
22845
22846
22847
22848
22849
22850
22851
22852
22853
22854 global ovf_res
22855ovf_res:
22856 andi.w &0x10,%d1
22857 lsr.b &0x4,%d0
22858 or.b %d0,%d1
22859 mov.w %d1,%d0
22860 lsl.b &0x1,%d1
22861 bra.b ovf_res_load
22862
22863 global ovf_res2
22864ovf_res2:
22865 and.w &0x10, %d1
22866 or.b %d0, %d1
22867 swap %d0
22868 or.b %d0, %d1
22869 mov.w %d1, %d0
22870 lsl.b &0x1, %d1
22871
22872
22873
22874
22875
22876ovf_res_load:
22877 mov.b (tbl_ovfl_cc.b,%pc,%d0.w*1), %d0
22878 lea (tbl_ovfl_result.b,%pc,%d1.w*8), %a0
22879
22880 rts
22881
22882tbl_ovfl_cc:
22883 byte 0x2, 0x0, 0x0, 0x2
22884 byte 0x2, 0x0, 0x0, 0x2
22885 byte 0x2, 0x0, 0x0, 0x2
22886 byte 0x0, 0x0, 0x0, 0x0
22887 byte 0x2+0x8, 0x8, 0x2+0x8, 0x8
22888 byte 0x2+0x8, 0x8, 0x2+0x8, 0x8
22889 byte 0x2+0x8, 0x8, 0x2+0x8, 0x8
22890
22891tbl_ovfl_result:
22892 long 0x7fff0000,0x00000000,0x00000000,0x00000000
22893 long 0x7ffe0000,0xffffffff,0xffffffff,0x00000000
22894 long 0x7ffe0000,0xffffffff,0xffffffff,0x00000000
22895 long 0x7fff0000,0x00000000,0x00000000,0x00000000
22896
22897 long 0x7fff0000,0x00000000,0x00000000,0x00000000
22898 long 0x407e0000,0xffffff00,0x00000000,0x00000000
22899 long 0x407e0000,0xffffff00,0x00000000,0x00000000
22900 long 0x7fff0000,0x00000000,0x00000000,0x00000000
22901
22902 long 0x7fff0000,0x00000000,0x00000000,0x00000000
22903 long 0x43fe0000,0xffffffff,0xfffff800,0x00000000
22904 long 0x43fe0000,0xffffffff,0xfffff800,0x00000000
22905 long 0x7fff0000,0x00000000,0x00000000,0x00000000
22906
22907 long 0x00000000,0x00000000,0x00000000,0x00000000
22908 long 0x00000000,0x00000000,0x00000000,0x00000000
22909 long 0x00000000,0x00000000,0x00000000,0x00000000
22910 long 0x00000000,0x00000000,0x00000000,0x00000000
22911
22912 long 0xffff0000,0x00000000,0x00000000,0x00000000
22913 long 0xfffe0000,0xffffffff,0xffffffff,0x00000000
22914 long 0xffff0000,0x00000000,0x00000000,0x00000000
22915 long 0xfffe0000,0xffffffff,0xffffffff,0x00000000
22916
22917 long 0xffff0000,0x00000000,0x00000000,0x00000000
22918 long 0xc07e0000,0xffffff00,0x00000000,0x00000000
22919 long 0xffff0000,0x00000000,0x00000000,0x00000000
22920 long 0xc07e0000,0xffffff00,0x00000000,0x00000000
22921
22922 long 0xffff0000,0x00000000,0x00000000,0x00000000
22923 long 0xc3fe0000,0xffffffff,0xfffff800,0x00000000
22924 long 0xffff0000,0x00000000,0x00000000,0x00000000
22925 long 0xc3fe0000,0xffffffff,0xfffff800,0x00000000
22926
22927
22928
22929
22930
22931
22932
22933
22934
22935
22936
22937
22938
22939
22940
22941
22942
22943
22944
22945
22946
22947
22948
22949
22950
22951
22952
22953
22954
22955
22956
22957
22958 global get_packed
22959get_packed:
22960 mov.l &0xc,%d0
22961 bsr.l _dcalc_ea
22962
22963 lea FP_SRC(%a6),%a1
22964 mov.l &0xc,%d0
22965 bsr.l _dmem_read
22966
22967 tst.l %d1
22968 bne.l facc_in_x
22969
22970
22971 bfextu FP_SRC(%a6){&1:&15},%d0
22972 cmpi.w %d0,&0x7fff
22973 bne.b gp_try_zero
22974 rts
22975
22976
22977
22978gp_try_zero:
22979 mov.b 3+FP_SRC(%a6),%d0
22980 andi.b &0x0f,%d0
22981 bne.b gp_not_spec
22982 tst.l FP_SRC_HI(%a6)
22983 bne.b gp_not_spec
22984 tst.l FP_SRC_LO(%a6)
22985 bne.b gp_not_spec
22986 rts
22987gp_not_spec:
22988 lea FP_SRC(%a6),%a0
22989 bsr.l decbin
22990 fmovm.x &0x80,FP_SRC(%a6)
22991 rts
22992
22993
22994
22995
22996
22997
22998
22999
23000
23001
23002
23003
23004
23005
23006
23007
23008
23009
23010
23011
23012
23013
23014
23015
23016
23017
23018
23019
23020
23021
23022
23023
23024
23025
23026
23027
23028
23029
23030
23031
23032
23033
23034
23035
23036
23037
23038
23039
23040
23041
23042
23043
23044
23045
23046
23047
23048
23049
23050
23051
23052
23053
23054
23055
23056
23057
23058RTABLE:
23059 byte 0,0,0,0
23060 byte 2,3,2,3
23061 byte 2,3,3,2
23062 byte 3,2,2,3
23063
23064 set FNIBS,7
23065 set FSTRT,0
23066
23067 set ESTRT,4
23068 set EDIGITS,2
23069
23070 global decbin
23071decbin:
23072 mov.l 0x0(%a0),FP_SCR0_EX(%a6)
23073 mov.l 0x4(%a0),FP_SCR0_HI(%a6)
23074 mov.l 0x8(%a0),FP_SCR0_LO(%a6)
23075
23076 lea FP_SCR0(%a6),%a0
23077
23078 movm.l &0x3c00,-(%sp)
23079 fmovm.x &0x1,-(%sp)
23080
23081
23082
23083
23084
23085
23086
23087
23088
23089
23090
23091
23092
23093
23094
23095
23096
23097
23098
23099
23100
23101calc_e:
23102 mov.l &EDIGITS,%d2
23103 mov.l &ESTRT,%d3
23104 mov.l (%a0),%d4
23105 clr.l %d1
23106e_gd:
23107 mulu.l &0xa,%d1
23108 bfextu %d4{%d3:&4},%d0
23109 add.l %d0,%d1
23110 addq.b &4,%d3
23111 dbf.w %d2,e_gd
23112 btst &30,%d4
23113 beq.b e_pos
23114 neg.l %d1
23115e_pos:
23116 sub.l &16,%d1
23117 bge.b e_save
23118 neg.l %d1
23119 or.l &0x40000000,%d4
23120 or.l &0x40000000,(%a0)
23121e_save:
23122 mov.l %d1,-(%sp)
23123
23124
23125
23126
23127
23128
23129
23130
23131
23132
23133
23134
23135
23136
23137
23138
23139
23140
23141
23142
23143
23144calc_m:
23145 mov.l &1,%d1
23146 fmov.s &0x00000000,%fp0
23147
23148
23149
23150
23151
23152
23153 bfextu (%a0){&28:&4},%d0
23154 fadd.b %d0,%fp0
23155
23156
23157
23158
23159loadlw:
23160 mov.l (%a0,%d1.L*4),%d4
23161 mov.l &FSTRT,%d3
23162 mov.l &FNIBS,%d2
23163md2b:
23164 fmul.s &0x41200000,%fp0
23165 bfextu %d4{%d3:&4},%d0
23166 fadd.b %d0,%fp0
23167
23168
23169
23170
23171
23172# else continue with this long word.
23173
23174 addq.b &4,%d3
23175 dbf.w %d2,md2b
23176nextlw:
23177 addq.l &1,%d1
23178 cmp.l %d1,&2
23179 ble.b loadlw
23180
23181
23182
23183m_sign:
23184 btst &31,(%a0)
23185 beq.b ap_st_z
23186 fneg.x %fp0
23187
23188
23189
23190
23191
23192
23193
23194
23195
23196
23197
23198
23199
23200
23201
23202
23203
23204
23205
23206
23207
23208
23209
23210
23211
23212
23213
23214
23215
23216
23217
23218
23219
23220
23221
23222
23223
23224
23225
23226
23227
23228
23229
23230
23231
23232
23233
23234
23235
23236
23237ap_st_z:
23238 mov.l (%sp),%d1
23239 cmp.l %d1,&27
23240 ble.w pwrten
23241 btst &30,(%a0)
23242 bne.b ap_st_n
23243 clr.l %d1
23244 mov.l (%a0),%d4
23245 bfextu %d4{&28:&4},%d0
23246 bne.b ap_p_fx
23247 addq.l &1,%d1
23248 mov.l &1,%d5
23249 mov.l (%a0,%d5.L*4),%d4
23250 bne.b ap_p_cl
23251 addq.l &8,%d1
23252 addq.l &1,%d5
23253 mov.l (%a0,%d5.L*4),%d4
23254ap_p_cl:
23255 clr.l %d3
23256 mov.l &7,%d2
23257ap_p_gd:
23258 bfextu %d4{%d3:&4},%d0
23259 bne.b ap_p_fx
23260 addq.l &4,%d3
23261 addq.l &1,%d1
23262 dbf.w %d2,ap_p_gd
23263ap_p_fx:
23264 mov.l %d1,%d0
23265 mov.l (%sp),%d1
23266 sub.l %d0,%d1
23267 bge.b ap_p_fm
23268 neg.l %d1
23269 mov.l (%a0),%d4
23270 or.l &0x40000000,%d4
23271 or.l &0x40000000,(%a0)
23272
23273
23274
23275
23276ap_p_fm:
23277 lea.l PTENRN(%pc),%a1
23278 clr.l %d3
23279 fmov.s &0x3f800000,%fp1
23280 mov.l &3,%d2
23281ap_p_el:
23282 asr.l &1,%d0
23283 bcc.b ap_p_en
23284 fmul.x (%a1,%d3),%fp1
23285ap_p_en:
23286 add.l &12,%d3
23287 tst.l %d0
23288 bne.b ap_p_el
23289 fmul.x %fp1,%fp0
23290 bra.b pwrten
23291
23292
23293
23294ap_st_n:
23295 clr.l %d1
23296 mov.l &2,%d5
23297 mov.l (%a0,%d5.L*4),%d4
23298 bne.b ap_n_cl
23299 sub.l &1,%d5
23300 addq.l &8,%d1
23301 mov.l (%a0,%d5.L*4),%d4
23302ap_n_cl:
23303 mov.l &28,%d3
23304 mov.l &7,%d2
23305ap_n_gd:
23306 bfextu %d4{%d3:&4},%d0
23307 bne.b ap_n_fx
23308 subq.l &4,%d3
23309 addq.l &1,%d1
23310 dbf.w %d2,ap_n_gd
23311ap_n_fx:
23312 mov.l %d1,%d0
23313 mov.l (%sp),%d1
23314 sub.l %d0,%d1
23315 bgt.b ap_n_fm
23316 neg.l %d1
23317 mov.l (%a0),%d4
23318 and.l &0xbfffffff,%d4
23319 and.l &0xbfffffff,(%a0)
23320
23321
23322
23323
23324ap_n_fm:
23325 lea.l PTENRN(%pc),%a1
23326 clr.l %d3
23327 fmov.s &0x3f800000,%fp1
23328 mov.l &3,%d2
23329ap_n_el:
23330 asr.l &1,%d0
23331 bcc.b ap_n_en
23332 fmul.x (%a1,%d3),%fp1
23333ap_n_en:
23334 add.l &12,%d3
23335 tst.l %d0
23336 bne.b ap_n_el
23337 fdiv.x %fp1,%fp0
23338
23339
23340
23341
23342
23343
23344
23345
23346
23347
23348
23349
23350
23351
23352
23353
23354
23355
23356
23357
23358
23359
23360
23361
23362
23363
23364
23365
23366
23367
23368
23369
23370
23371
23372
23373
23374
23375
23376
23377
23378
23379
23380
23381
23382pwrten:
23383 mov.l USER_FPCR(%a6),%d3
23384 bfextu %d3{&26:&2},%d2
23385 mov.l (%a0),%d4
23386 asl.l &2,%d2
23387 bfextu %d4{&0:&2},%d0
23388 add.l %d0,%d2
23389 lea.l RTABLE(%pc),%a1
23390 mov.b (%a1,%d2),%d0
23391 clr.l %d3
23392 bfins %d0,%d3{&26:&2}
23393 fmov.l %d3,%fpcr
23394 asr.l &1,%d0
23395 bcc.b not_rp
23396 lea.l PTENRP(%pc),%a1
23397 bra.b calc_p
23398not_rp:
23399 asr.l &1,%d0
23400 bcc.b not_rm
23401 lea.l PTENRM(%pc),%a1
23402 bra.b calc_p
23403not_rm:
23404 lea.l PTENRN(%pc),%a1
23405calc_p:
23406 mov.l %d1,%d0
23407 bpl.b no_neg
23408 neg.l %d0
23409 or.l &0x40000000,(%a0)
23410no_neg:
23411 clr.l %d3
23412 fmov.s &0x3f800000,%fp1
23413e_loop:
23414 asr.l &1,%d0
23415 bcc.b e_next
23416 fmul.x (%a1,%d3),%fp1
23417e_next:
23418 add.l &12,%d3
23419 tst.l %d0
23420 bne.b e_loop
23421
23422
23423
23424
23425# else divide fp0/fp1.
23426
23427
23428
23429
23430
23431
23432
23433pnorm:
23434 btst &30,(%a0)
23435 beq.b mul
23436div:
23437 fdiv.x %fp1,%fp0
23438 bra.b end_dec
23439mul:
23440 fmul.x %fp1,%fp0
23441
23442
23443
23444
23445
23446
23447
23448end_dec:
23449 fmov.l %fpsr,%d0
23450 bclr &inex2_bit+8,%d0
23451 beq.b no_exc
23452 ori.w &inx1a_mask,2+USER_FPSR(%a6)
23453no_exc:
23454 add.l &0x4,%sp
23455 fmovm.x (%sp)+,&0x40
23456 movm.l (%sp)+,&0x3c
23457 fmov.l &0x0,%fpcr
23458 fmov.l &0x0,%fpsr
23459 rts
23460
23461
23462
23463
23464
23465
23466
23467
23468
23469
23470
23471
23472
23473
23474
23475
23476
23477
23478
23479
23480
23481
23482
23483
23484
23485
23486
23487
23488
23489
23490
23491
23492
23493
23494
23495
23496
23497
23498
23499
23500
23501
23502
23503
23504
23505
23506
23507
23508
23509
23510
23511
23512
23513
23514
23515
23516
23517
23518
23519
23520
23521
23522
23523
23524
23525
23526
23527
23528
23529
23530
23531
23532
23533
23534
23535
23536
23537
23538
23539
23540
23541
23542
23543
23544
23545
23546
23547
23548
23549
23550
23551
23552
23553
23554
23555
23556
23557
23558
23559
23560
23561
23562
23563set BINDEC_FLG, EXC_TEMP
23564
23565
23566PLOG2:
23567 long 0x3FFD0000,0x9A209A84,0xFBCFF798,0x00000000
23568PLOG2UP1:
23569 long 0x3FFD0000,0x9A209A84,0xFBCFF799,0x00000000
23570
23571
23572FONE:
23573 long 0x3F800000,0x00000000,0x00000000,0x00000000
23574FTWO:
23575 long 0x40000000,0x00000000,0x00000000,0x00000000
23576FTEN:
23577 long 0x41200000,0x00000000,0x00000000,0x00000000
23578F4933:
23579 long 0x459A2800,0x00000000,0x00000000,0x00000000
23580
23581RBDTBL:
23582 byte 0,0,0,0
23583 byte 3,3,2,2
23584 byte 3,2,2,3
23585 byte 2,3,3,2
23586
23587
23588
23589
23590
23591
23592
23593
23594
23595
23596
23597
23598
23599
23600
23601
23602
23603
23604
23605
23606
23607
23608
23609
23610 global bindec
23611bindec:
23612 movm.l &0x3f20,-(%sp)
23613 fmovm.x &0x7,-(%sp)
23614
23615
23616
23617
23618
23619
23620
23621
23622 fmov.l &rm_mode*0x10,%fpcr
23623 mov.l (%a0),L_SCR2(%a6)
23624 mov.l %d0,%d7
23625
23626 clr.b BINDEC_FLG(%a6)
23627 cmpi.b STAG(%a6),&DENORM
23628 bne.w A2_str
23629
23630
23631
23632
23633un_de_norm:
23634 mov.w (%a0),%d0
23635 and.w &0x7fff,%d0
23636 mov.l 4(%a0),%d1
23637 mov.l 8(%a0),%d2
23638norm_loop:
23639 sub.w &1,%d0
23640 lsl.l &1,%d2
23641 roxl.l &1,%d1
23642 tst.l %d1
23643 bge.b norm_loop
23644
23645
23646
23647 tst.w %d0
23648 bgt.b pos_exp
23649 st BINDEC_FLG(%a6)
23650pos_exp:
23651 and.w &0x7fff,%d0
23652 mov.w %d0,(%a0)
23653 mov.l %d1,4(%a0)
23654 mov.l %d2,8(%a0)
23655
23656
23657
23658A2_str:
23659 mov.l (%a0),FP_SCR1(%a6)
23660 mov.l 4(%a0),FP_SCR1+4(%a6)
23661 mov.l 8(%a0),FP_SCR1+8(%a6)
23662 and.l &0x7fffffff,FP_SCR1(%a6)
23663
23664
23665
23666
23667
23668
23669
23670
23671
23672
23673
23674
23675
23676
23677
23678
23679
23680
23681
23682
23683
23684
23685
23686
23687
23688
23689
23690 tst.b BINDEC_FLG(%a6)
23691 beq.b A3_cont
23692 mov.l &-4933,%d6
23693 bra.b A4_str
23694A3_cont:
23695 mov.w FP_SCR1(%a6),%d0
23696 mov.w &0x3fff,FP_SCR1(%a6)
23697 fmov.x FP_SCR1(%a6),%fp0
23698 sub.w &0x3fff,%d0
23699 fadd.w %d0,%fp0
23700 fsub.s FONE(%pc),%fp0
23701 fbge.w pos_res
23702 fmul.x PLOG2UP1(%pc),%fp0
23703 fmov.l %fp0,%d6
23704 bra.b A4_str
23705pos_res:
23706 fmul.x PLOG2(%pc),%fp0
23707 fmov.l %fp0,%d6
23708
23709
23710
23711
23712
23713A4_str:
23714 fmov.l &0,%fpsr
23715
23716
23717
23718
23719
23720
23721 clr.w %d5
23722
23723
23724
23725
23726
23727
23728
23729
23730
23731
23732
23733
23734
23735
23736
23737
23738
23739
23740
23741
23742
23743
23744
23745
23746
23747
23748
23749
23750
23751
23752A6_str:
23753 tst.l %d7
23754 ble.b k_neg
23755 mov.l %d7,%d4
23756 bra.b len_ck
23757k_neg:
23758 mov.l %d6,%d4
23759 sub.l %d7,%d4
23760 addq.l &1,%d4
23761len_ck:
23762 tst.l %d4
23763 ble.b LEN_ng
23764 cmp.l %d4,&17
23765 ble.b A7_str
23766 mov.l &17,%d4
23767 tst.l %d7
23768 ble.b A7_str
23769 or.l &opaop_mask,USER_FPSR(%a6)
23770 bra.b A7_str
23771LEN_ng:
23772 mov.l &1,%d4
23773
23774
23775
23776
23777
23778
23779
23780
23781
23782
23783
23784
23785
23786
23787
23788
23789
23790
23791
23792
23793
23794
23795
23796
23797
23798
23799
23800
23801
23802
23803
23804
23805
23806
23807
23808
23809
23810
23811
23812
23813
23814
23815
23816
23817
23818
23819
23820
23821
23822
23823
23824A7_str:
23825 tst.l %d7
23826 bgt.b k_pos
23827 cmp.l %d7,%d6
23828 blt.b k_pos
23829 mov.l %d7,%d6
23830k_pos:
23831 mov.l %d6,%d0
23832 addq.l &1,%d0
23833 sub.l %d4,%d0
23834 swap %d5
23835 clr.w %d5
23836 clr.w %d2
23837 tst.l %d0
23838 bge.b iscale
23839 addq.w &1,%d5
23840 cmp.l %d0,&0xffffecd4
23841 bgt.b no_inf
23842 add.l &24,%d0
23843 mov.l &24,%d2
23844no_inf:
23845 neg.l %d0
23846iscale:
23847 fmov.s FONE(%pc),%fp1
23848 bfextu USER_FPCR(%a6){&26:&2},%d1
23849 lsl.w &1,%d1
23850 add.w %d5,%d1
23851 lsl.w &1,%d1
23852 tst.l L_SCR2(%a6)
23853 bge.b x_pos
23854 addq.l &1,%d1
23855x_pos:
23856 lea.l RBDTBL(%pc),%a2
23857 mov.b (%a2,%d1),%d3
23858 lsl.l &4,%d3
23859 fmov.l %d3,%fpcr
23860 lsr.l &4,%d3
23861 tst.b %d3
23862 bne.b not_rn
23863 lea.l PTENRN(%pc),%a1
23864 bra.b rmode
23865not_rn:
23866 lsr.b &1,%d3
23867 bcc.b not_rp2
23868 lea.l PTENRP(%pc),%a1
23869 bra.b rmode
23870not_rp2:
23871 lea.l PTENRM(%pc),%a1
23872rmode:
23873 clr.l %d3
23874e_loop2:
23875 lsr.l &1,%d0
23876 bcc.b e_next2
23877 fmul.x (%a1,%d3),%fp1
23878e_next2:
23879 add.l &12,%d3
23880 tst.l %d0
23881 bne.b e_loop2
23882
23883
23884
23885
23886
23887
23888
23889
23890
23891
23892 fmov.l &0,%fpsr
23893 fmov.l &rz_mode*0x10,%fpcr
23894
23895
23896
23897
23898
23899
23900
23901
23902
23903
23904
23905
23906
23907
23908
23909
23910
23911
23912
23913
23914
23915
23916
23917
23918
23919
23920
23921
23922
23923
23924
23925
23926
23927A9_str:
23928 fmov.x (%a0),%fp0
23929 fabs.x %fp0
23930 tst.w %d5
23931 bne.b sc_mul
23932 fdiv.x %fp1,%fp0
23933 bra.w A10_st
23934
23935sc_mul:
23936 tst.b BINDEC_FLG(%a6)
23937 beq.w A9_norm
23938
23939
23940
23941
23942
23943
23944
23945 fmovm.x &0x2,-(%sp)
23946
23947 mov.w (%sp),%d3
23948 andi.w &0x7fff,%d3
23949 ori.w &0x8000,(%a0)
23950 add.w (%a0),%d3
23951 subi.w &0x3fff,%d3
23952 add.w 36(%a1),%d3
23953 subi.w &0x3fff,%d3
23954 add.w 48(%a1),%d3
23955 subi.w &0x3fff,%d3
23956
23957 bmi.w sc_mul_err
23958
23959 andi.w &0x8000,(%sp)
23960 or.w %d3,(%sp)
23961 andi.w &0x7fff,(%a0)
23962 mov.l 0x8(%a0),-(%sp)
23963 mov.l 0x4(%a0),-(%sp)
23964 mov.l &0x3fff0000,-(%sp)
23965 fmovm.x (%sp)+,&0x80
23966 fmul.x (%sp)+,%fp0
23967
23968
23969
23970 mov.l 36+8(%a1),-(%sp)
23971 mov.l 36+4(%a1),-(%sp)
23972 mov.l &0x3fff0000,-(%sp)
23973 mov.l 48+8(%a1),-(%sp)
23974 mov.l 48+4(%a1),-(%sp)
23975 mov.l &0x3fff0000,-(%sp)
23976 fmul.x (%sp)+,%fp0
23977 fmul.x (%sp)+,%fp0
23978 bra.b A10_st
23979
23980sc_mul_err:
23981 bra.b sc_mul_err
23982
23983A9_norm:
23984 tst.w %d2
23985 beq.b A9_con
23986 fmul.x 36(%a1),%fp0
23987 fmul.x 48(%a1),%fp0
23988A9_con:
23989 fmul.x %fp1,%fp0
23990
23991
23992
23993
23994
23995
23996
23997
23998
23999
24000
24001
24002
24003
24004
24005
24006
24007
24008
24009
24010
24011A10_st:
24012 fmov.l %fpsr,%d0
24013 fmov.x %fp0,FP_SCR1(%a6)
24014 lea.l FP_SCR1(%a6),%a2
24015 btst &9,%d0
24016 beq.b A11_st
24017 or.l &1,8(%a2)
24018 fmov.x FP_SCR1(%a6),%fp0
24019
24020
24021
24022
24023
24024
24025
24026
24027A11_st:
24028 mov.l USER_FPCR(%a6),L_SCR1(%a6)
24029 and.l &0x00000030,USER_FPCR(%a6)
24030
24031
24032
24033
24034
24035
24036
24037
24038
24039
24040
24041
24042
24043
24044
24045
24046
24047
24048
24049
24050
24051
24052
24053
24054
24055
24056
24057A12_st:
24058 movm.l &0xc0c0,-(%sp)
24059 mov.l L_SCR1(%a6),-(%sp)
24060 mov.l L_SCR2(%a6),-(%sp)
24061
24062 lea.l FP_SCR1(%a6),%a0
24063 fmov.x %fp0,(%a0)
24064 tst.l L_SCR2(%a6)
24065 bge.b do_fint12
24066 or.l &0x80000000,(%a0)
24067do_fint12:
24068 mov.l USER_FPSR(%a6),-(%sp)
24069
24070
24071 fmov.l USER_FPCR(%a6),%fpcr
24072 fmov.l &0x0,%fpsr
24073
24074
24075
24076 fint.x FP_SCR1(%a6),%fp0
24077 fmov.l %fpsr,%d0
24078 or.w %d0,FPSR_EXCEPT(%a6)
24079
24080
24081
24082
24083 mov.b (%sp),USER_FPSR(%a6)
24084 add.l &4,%sp
24085
24086 mov.l (%sp)+,L_SCR2(%a6)
24087 mov.l (%sp)+,L_SCR1(%a6)
24088 movm.l (%sp)+,&0x303
24089
24090 mov.l L_SCR2(%a6),FP_SCR1(%a6)
24091 mov.l L_SCR1(%a6),USER_FPCR(%a6)
24092
24093
24094
24095
24096
24097
24098
24099
24100
24101
24102
24103
24104
24105
24106
24107
24108
24109
24110
24111
24112
24113
24114
24115
24116
24117
24118
24119
24120
24121
24122
24123
24124A13_st:
24125 swap %d5
24126 tst.w %d5
24127 bne not_zr
24128
24129
24130
24131 fmov.s FONE(%pc),%fp2
24132 mov.l %d4,%d0
24133 subq.l &1,%d0
24134 clr.l %d3
24135l_loop:
24136 lsr.l &1,%d0
24137 bcc.b l_next
24138 fmul.x (%a1,%d3),%fp2
24139l_next:
24140 add.l &12,%d3
24141 tst.l %d0
24142 bne.b l_loop
24143
24144
24145
24146
24147 tst.b BINDEC_FLG(%a6)
24148 beq.b A13_con
24149 fabs.x %fp0
24150 bra test_2
24151
24152
24153
24154A13_con:
24155 fabs.x %fp0
24156 fcmp.x %fp0,%fp2
24157 fbge.w test_2
24158 subq.l &1,%d6
24159 mov.w &1,%d5
24160 fmov.l &rm_mode*0x10,%fpcr
24161 fmul.s FTEN(%pc),%fp2
24162 bra.w A6_str
24163test_2:
24164 fmul.s FTEN(%pc),%fp2
24165 fcmp.x %fp0,%fp2
24166 fblt.w A14_st
24167 fbgt.w fix_ex
24168 fdiv.s FTEN(%pc),%fp0
24169 addq.l &1,%d6
24170 bra.b A14_st
24171fix_ex:
24172 addq.l &1,%d6
24173 mov.w &1,%d5
24174 fmov.l &rm_mode*0x10,%fpcr
24175 bra.w A6_str
24176
24177
24178
24179
24180
24181
24182not_zr:
24183 fmov.s FONE(%pc),%fp2
24184 mov.l %d4,%d0
24185 clr.l %d3
24186z_loop:
24187 lsr.l &1,%d0
24188 bcc.b z_next
24189 fmul.x (%a1,%d3),%fp2
24190z_next:
24191 add.l &12,%d3
24192 tst.l %d0
24193 bne.b z_loop
24194 fabs.x %fp0
24195 fcmp.x %fp0,%fp2
24196 fbneq.w A14_st
24197 fdiv.s FTEN(%pc),%fp0
24198 addq.l &1,%d6
24199 addq.l &1,%d4
24200 fmul.s FTEN(%pc),%fp2
24201
24202
24203
24204
24205
24206
24207
24208
24209
24210
24211
24212
24213
24214
24215
24216
24217
24218
24219
24220
24221
24222
24223
24224
24225
24226
24227
24228
24229
24230
24231
24232
24233A14_st:
24234 fmov.l &rz_mode*0x10,%fpcr
24235 fdiv.x %fp2,%fp0
24236 lea.l FP_SCR0(%a6),%a0
24237 fmov.x %fp0,(%a0)
24238 mov.l 4(%a0),%d2
24239 mov.l 8(%a0),%d3
24240 clr.l 4(%a0)
24241 clr.l 8(%a0)
24242 mov.l (%a0),%d0
24243 swap %d0
24244 beq.b no_sft
24245 sub.l &0x3ffd,%d0
24246 tst.l %d0
24247 bgt.b no_sft
24248 neg.l %d0
24249m_loop:
24250 lsr.l &1,%d2
24251 roxr.l &1,%d3
24252 dbf.w %d0,m_loop
24253no_sft:
24254 tst.l %d2
24255 bne.b no_zr
24256 tst.l %d3
24257 beq.b zer_m
24258no_zr:
24259 clr.l %d1
24260 add.l &0x00000080,%d3
24261 addx.l %d1,%d2
24262 and.l &0xffffff80,%d3
24263zer_m:
24264 mov.l %d4,%d0
24265 addq.l &3,%a0
24266 bsr binstr
24267
24268
24269
24270
24271
24272
24273
24274
24275
24276
24277
24278
24279
24280
24281
24282
24283
24284
24285
24286
24287
24288
24289
24290
24291
24292
24293
24294
24295
24296
24297
24298
24299
24300
24301
24302
24303
24304
24305A15_st:
24306 tst.b BINDEC_FLG(%a6)
24307 beq.b not_denorm
24308 ftest.x %fp0
24309 fbeq.w den_zero
24310 fmov.l %d6,%fp0
24311 fabs.x %fp0
24312 bra.b convrt
24313den_zero:
24314 tst.l %d7
24315 blt.b use_ilog
24316 fmov.s F4933(%pc),%fp0
24317 bra.b convrt
24318use_ilog:
24319 fmov.l %d6,%fp0
24320 fabs.x %fp0
24321 bra.b convrt
24322not_denorm:
24323 ftest.x %fp0
24324 fbneq.w not_zero
24325 fmov.s FONE(%pc),%fp0
24326 bra.b convrt
24327not_zero:
24328 fmov.l %d6,%fp0
24329 fabs.x %fp0
24330convrt:
24331 fdiv.x 24(%a1),%fp0
24332 fmov.x %fp0,FP_SCR1(%a6)
24333 mov.l 4(%a2),%d2
24334 mov.l 8(%a2),%d3
24335 mov.w (%a2),%d0
24336 beq.b x_loop_fin
24337 sub.w &0x3ffd,%d0
24338 neg.w %d0
24339x_loop:
24340 lsr.l &1,%d2
24341 roxr.l &1,%d3
24342 dbf.w %d0,x_loop
24343x_loop_fin:
24344 clr.l %d1
24345 add.l &0x00000080,%d3
24346 addx.l %d1,%d2
24347 and.l &0xffffff80,%d3
24348 mov.l &4,%d0
24349 lea.l L_SCR1(%a6),%a0
24350 bsr binstr
24351 mov.l L_SCR1(%a6),%d0
24352 mov.l &12,%d1
24353 lsr.l %d1,%d0
24354 bfins %d0,FP_SCR0(%a6){&4:&12}
24355 lsr.l %d1,%d0
24356 bfins %d0,FP_SCR0(%a6){&16:&4}
24357 tst.b %d0
24358 beq.b A16_st
24359 or.l &opaop_mask,USER_FPSR(%a6)
24360
24361
24362
24363
24364
24365
24366
24367
24368
24369
24370
24371
24372
24373
24374
24375
24376
24377
24378
24379
24380
24381
24382
24383
24384
24385A16_st:
24386 clr.l %d0
24387 and.b &0x0f,FP_SCR0(%a6)
24388 tst.l L_SCR2(%a6)
24389 bge.b mant_p
24390 mov.l &2,%d0
24391mant_p:
24392 tst.l %d6
24393 bge.b wr_sgn
24394 addq.l &1,%d0
24395wr_sgn:
24396 bfins %d0,FP_SCR0(%a6){&0:&2}
24397
24398
24399
24400 fmov.l &0,%fpsr
24401 fmovm.x (%sp)+,&0xe0
24402 movm.l (%sp)+,&0x4fc
24403 rts
24404
24405 global PTENRN
24406PTENRN:
24407 long 0x40020000,0xA0000000,0x00000000
24408 long 0x40050000,0xC8000000,0x00000000
24409 long 0x400C0000,0x9C400000,0x00000000
24410 long 0x40190000,0xBEBC2000,0x00000000
24411 long 0x40340000,0x8E1BC9BF,0x04000000
24412 long 0x40690000,0x9DC5ADA8,0x2B70B59E
24413 long 0x40D30000,0xC2781F49,0xFFCFA6D5
24414 long 0x41A80000,0x93BA47C9,0x80E98CE0
24415 long 0x43510000,0xAA7EEBFB,0x9DF9DE8E
24416 long 0x46A30000,0xE319A0AE,0xA60E91C7
24417 long 0x4D480000,0xC9767586,0x81750C17
24418 long 0x5A920000,0x9E8B3B5D,0xC53D5DE5
24419 long 0x75250000,0xC4605202,0x8A20979B
24420
24421 global PTENRP
24422PTENRP:
24423 long 0x40020000,0xA0000000,0x00000000
24424 long 0x40050000,0xC8000000,0x00000000
24425 long 0x400C0000,0x9C400000,0x00000000
24426 long 0x40190000,0xBEBC2000,0x00000000
24427 long 0x40340000,0x8E1BC9BF,0x04000000
24428 long 0x40690000,0x9DC5ADA8,0x2B70B59E
24429 long 0x40D30000,0xC2781F49,0xFFCFA6D6
24430 long 0x41A80000,0x93BA47C9,0x80E98CE0
24431 long 0x43510000,0xAA7EEBFB,0x9DF9DE8E
24432 long 0x46A30000,0xE319A0AE,0xA60E91C7
24433 long 0x4D480000,0xC9767586,0x81750C18
24434 long 0x5A920000,0x9E8B3B5D,0xC53D5DE5
24435 long 0x75250000,0xC4605202,0x8A20979B
24436
24437 global PTENRM
24438PTENRM:
24439 long 0x40020000,0xA0000000,0x00000000
24440 long 0x40050000,0xC8000000,0x00000000
24441 long 0x400C0000,0x9C400000,0x00000000
24442 long 0x40190000,0xBEBC2000,0x00000000
24443 long 0x40340000,0x8E1BC9BF,0x04000000
24444 long 0x40690000,0x9DC5ADA8,0x2B70B59D
24445 long 0x40D30000,0xC2781F49,0xFFCFA6D5
24446 long 0x41A80000,0x93BA47C9,0x80E98CDF
24447 long 0x43510000,0xAA7EEBFB,0x9DF9DE8D
24448 long 0x46A30000,0xE319A0AE,0xA60E91C6
24449 long 0x4D480000,0xC9767586,0x81750C17
24450 long 0x5A920000,0x9E8B3B5D,0xC53D5DE4
24451 long 0x75250000,0xC4605202,0x8A20979A
24452
24453
24454
24455
24456
24457
24458
24459
24460
24461
24462
24463
24464
24465
24466
24467
24468
24469
24470
24471
24472
24473
24474
24475
24476
24477
24478
24479
24480
24481
24482
24483
24484
24485
24486
24487
24488
24489
24490
24491
24492
24493
24494
24495
24496
24497
24498
24499
24500
24501
24502
24503
24504
24505
24506
24507
24508
24509
24510
24511
24512
24513 global binstr
24514binstr:
24515 movm.l &0xff00,-(%sp)
24516
24517
24518
24519
24520 mov.l &1,%d7
24521 subq.l &1,%d0
24522
24523
24524
24525loop:
24526 mov.l %d2,%d4
24527 mov.l %d3,%d5
24528
24529
24530
24531 bfextu %d2{&0:&3},%d1
24532 asl.l &3,%d2
24533 bfextu %d3{&0:&3},%d6
24534 asl.l &3,%d3
24535 or.l %d6,%d2
24536
24537
24538
24539 asl.l &1,%d5
24540 roxl.l &1,%d4
24541 swap %d6
24542 addx.w %d6,%d1
24543
24544
24545
24546 add.l %d5,%d3
24547 nop
24548 addx.l %d4,%d2
24549 nop
24550 addx.w %d6,%d1
24551 swap %d6
24552
24553
24554
24555 tst.w %d7
24556 beq.b first_d
24557sec_d:
24558 swap %d7
24559 asl.w &4,%d7
24560 add.w %d1,%d7
24561 mov.b %d7,(%a0)+
24562 swap %d7
24563 clr.w %d7
24564 dbf.w %d0,loop
24565 bra.b end_bstr
24566first_d:
24567 swap %d7
24568 mov.w %d1,%d7
24569 swap %d7
24570 addq.w &1,%d7
24571 dbf.w %d0,loop
24572 swap %d7
24573 lsl.w &4,%d7
24574 mov.b %d7,(%a0)+
24575
24576
24577
24578end_bstr:
24579 movm.l (%sp)+,&0xff
24580 rts
24581
24582
24583
24584
24585
24586
24587
24588
24589
24590
24591
24592
24593
24594
24595
24596
24597
24598
24599
24600
24601
24602
24603
24604
24605
24606
24607
24608
24609
24610
24611
24612
24613
24614
24615facc_in_b:
24616 movq.l &0x1,%d0
24617 bsr.w restore
24618
24619 mov.w &0x0121,EXC_VOFF(%a6)
24620 bra.w facc_finish
24621
24622facc_in_w:
24623 movq.l &0x2,%d0
24624 bsr.w restore
24625
24626 mov.w &0x0141,EXC_VOFF(%a6)
24627 bra.b facc_finish
24628
24629facc_in_l:
24630 movq.l &0x4,%d0
24631 bsr.w restore
24632
24633 mov.w &0x0101,EXC_VOFF(%a6)
24634 bra.b facc_finish
24635
24636facc_in_d:
24637 movq.l &0x8,%d0
24638 bsr.w restore
24639
24640 mov.w &0x0161,EXC_VOFF(%a6)
24641 bra.b facc_finish
24642
24643facc_in_x:
24644 movq.l &0xc,%d0
24645 bsr.w restore
24646
24647 mov.w &0x0161,EXC_VOFF(%a6)
24648 bra.b facc_finish
24649
24650
24651
24652facc_out_b:
24653 movq.l &0x1,%d0
24654 bsr.w restore
24655
24656 mov.w &0x00a1,EXC_VOFF(%a6)
24657 bra.b facc_finish
24658
24659facc_out_w:
24660 movq.l &0x2,%d0
24661 bsr.w restore
24662
24663 mov.w &0x00c1,EXC_VOFF(%a6)
24664 bra.b facc_finish
24665
24666facc_out_l:
24667 movq.l &0x4,%d0
24668 bsr.w restore
24669
24670 mov.w &0x0081,EXC_VOFF(%a6)
24671 bra.b facc_finish
24672
24673facc_out_d:
24674 movq.l &0x8,%d0
24675 bsr.w restore
24676
24677 mov.w &0x00e1,EXC_VOFF(%a6)
24678 bra.b facc_finish
24679
24680facc_out_x:
24681 mov.l &0xc,%d0
24682 bsr.w restore
24683
24684 mov.w &0x00e1,EXC_VOFF(%a6)
24685
24686
24687
24688facc_finish:
24689 mov.l USER_FPIAR(%a6),EXC_PC(%a6)
24690
24691 fmovm.x EXC_FPREGS(%a6),&0xc0
24692 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr,%fpiar
24693 movm.l EXC_DREGS(%a6),&0x0303
24694
24695 unlk %a6
24696
24697 mov.l (%sp),-(%sp)
24698 mov.l 0x8(%sp),0x4(%sp)
24699 mov.l 0xc(%sp),0x8(%sp)
24700 mov.l &0x00000001,0xc(%sp)
24701 mov.w 0x6(%sp),0xc(%sp)
24702 mov.w &0x4008,0x6(%sp)
24703
24704 btst &0x5,(%sp)
24705 beq.b facc_out2
24706 bset &0x2,0xd(%sp)
24707
24708facc_out2:
24709 bra.l _real_access
24710
24711
24712
24713
24714
24715
24716
24717
24718restore:
24719 mov.b EXC_OPWORD+0x1(%a6),%d1
24720 andi.b &0x38,%d1
24721 cmpi.b %d1,&0x18
24722 beq.w rest_inc
24723 cmpi.b %d1,&0x20
24724 beq.w rest_dec
24725 rts
24726
24727rest_inc:
24728 mov.b EXC_OPWORD+0x1(%a6),%d1
24729 andi.w &0x0007,%d1
24730
24731 mov.w (tbl_rest_inc.b,%pc,%d1.w*2),%d1
24732 jmp (tbl_rest_inc.b,%pc,%d1.w*1)
24733
24734tbl_rest_inc:
24735 short ri_a0 - tbl_rest_inc
24736 short ri_a1 - tbl_rest_inc
24737 short ri_a2 - tbl_rest_inc
24738 short ri_a3 - tbl_rest_inc
24739 short ri_a4 - tbl_rest_inc
24740 short ri_a5 - tbl_rest_inc
24741 short ri_a6 - tbl_rest_inc
24742 short ri_a7 - tbl_rest_inc
24743
24744ri_a0:
24745 sub.l %d0,EXC_DREGS+0x8(%a6)
24746 rts
24747ri_a1:
24748 sub.l %d0,EXC_DREGS+0xc(%a6)
24749 rts
24750ri_a2:
24751 sub.l %d0,%a2
24752 rts
24753ri_a3:
24754 sub.l %d0,%a3
24755 rts
24756ri_a4:
24757 sub.l %d0,%a4
24758 rts
24759ri_a5:
24760 sub.l %d0,%a5
24761 rts
24762ri_a6:
24763 sub.l %d0,(%a6)
24764 rts
24765
24766
24767
24768
24769
24770ri_a7:
24771 cmpi.b EXC_VOFF(%a6),&0x30
24772 bne.b ri_a7_done
24773
24774 btst &0x5,EXC_SR(%a6)
24775 bne.b ri_a7_done
24776 movc %usp,%a0
24777 sub.l %d0,%a0
24778 movc %a0,%usp
24779ri_a7_done:
24780 rts
24781
24782
24783rest_dec:
24784 neg.l %d0
24785 bra.b rest_inc
24786