📄 fplsp.s
字号:
## copy, convert, and tag input argument# lea FP_SRC(%a6),%a0 mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input mov.l 0x8+0x4(%a6),0x4(%a0) mov.l 0x8+0x8(%a6),0x8(%a0) bsr.l tag # fetch operand type mov.b %d0,STAG(%a6) mov.b %d0,%d1 andi.l &0x00ff00ff,USER_FPSR(%a6) clr.l %d0 mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec tst.b %d1 bne.b _L6_2x bsr.l satan # operand is a NORM bra.b _L6_6x_L6_2x: cmpi.b %d1,&ZERO # is operand a ZERO? bne.b _L6_3x # no bsr.l src_zero # yes bra.b _L6_6x_L6_3x: cmpi.b %d1,&INF # is operand an INF? bne.b _L6_4x # no bsr.l spi_2 # yes bra.b _L6_6x_L6_4x: cmpi.b %d1,&QNAN # is operand a QNAN? bne.b _L6_5x # no bsr.l src_qnan # yes bra.b _L6_6x_L6_5x: bsr.l satand # operand is a DENORM_L6_6x:## Result is now in FP0# movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs fmovm.x EXC_FP1(%a6),&0x40 # restore fp1 unlk %a6 rts########################################################################## MONADIC TEMPLATE ########################################################################## global _fasins__fasins_: link %a6,&-LOCAL_SIZE movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1 fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1 fmov.l &0x0,%fpcr # zero FPCR## copy, convert, and tag input argument# fmov.s 0x8(%a6),%fp0 # load sgl input fmov.x %fp0,FP_SRC(%a6) lea FP_SRC(%a6),%a0 bsr.l tag # fetch operand type mov.b %d0,STAG(%a6) mov.b %d0,%d1 andi.l &0x00ff00ff,USER_FPSR(%a6) clr.l %d0 mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec tst.b %d1 bne.b _L7_2s bsr.l sasin # operand is a NORM bra.b _L7_6s_L7_2s: cmpi.b %d1,&ZERO # is operand a ZERO? bne.b _L7_3s # no bsr.l src_zero # yes bra.b _L7_6s_L7_3s: cmpi.b %d1,&INF # is operand an INF? bne.b _L7_4s # no bsr.l t_operr # yes bra.b _L7_6s_L7_4s: cmpi.b %d1,&QNAN # is operand a QNAN? bne.b _L7_5s # no bsr.l src_qnan # yes bra.b _L7_6s_L7_5s: bsr.l sasind # operand is a DENORM_L7_6s:## Result is now in FP0# movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs fmovm.x EXC_FP1(%a6),&0x40 # restore fp1 unlk %a6 rts global _fasind__fasind_: link %a6,&-LOCAL_SIZE movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1 fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1 fmov.l &0x0,%fpcr # zero FPCR## copy, convert, and tag input argument# fmov.d 0x8(%a6),%fp0 # load dbl input fmov.x %fp0,FP_SRC(%a6) lea FP_SRC(%a6),%a0 bsr.l tag # fetch operand type mov.b %d0,STAG(%a6) mov.b %d0,%d1 andi.l &0x00ff00ff,USER_FPSR(%a6) clr.l %d0 mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec mov.b %d1,STAG(%a6) tst.b %d1 bne.b _L7_2d bsr.l sasin # operand is a NORM bra.b _L7_6d_L7_2d: cmpi.b %d1,&ZERO # is operand a ZERO? bne.b _L7_3d # no bsr.l src_zero # yes bra.b _L7_6d_L7_3d: cmpi.b %d1,&INF # is operand an INF? bne.b _L7_4d # no bsr.l t_operr # yes bra.b _L7_6d_L7_4d: cmpi.b %d1,&QNAN # is operand a QNAN? bne.b _L7_5d # no bsr.l src_qnan # yes bra.b _L7_6d_L7_5d: bsr.l sasind # operand is a DENORM_L7_6d:## Result is now in FP0# movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs fmovm.x EXC_FP1(%a6),&0x40 # restore fp1 unlk %a6 rts global _fasinx__fasinx_: link %a6,&-LOCAL_SIZE movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1 fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1 fmov.l &0x0,%fpcr # zero FPCR## copy, convert, and tag input argument# lea FP_SRC(%a6),%a0 mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input mov.l 0x8+0x4(%a6),0x4(%a0) mov.l 0x8+0x8(%a6),0x8(%a0) bsr.l tag # fetch operand type mov.b %d0,STAG(%a6) mov.b %d0,%d1 andi.l &0x00ff00ff,USER_FPSR(%a6) clr.l %d0 mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec tst.b %d1 bne.b _L7_2x bsr.l sasin # operand is a NORM bra.b _L7_6x_L7_2x: cmpi.b %d1,&ZERO # is operand a ZERO? bne.b _L7_3x # no bsr.l src_zero # yes bra.b _L7_6x_L7_3x: cmpi.b %d1,&INF # is operand an INF? bne.b _L7_4x # no bsr.l t_operr # yes bra.b _L7_6x_L7_4x: cmpi.b %d1,&QNAN # is operand a QNAN? bne.b _L7_5x # no bsr.l src_qnan # yes bra.b _L7_6x_L7_5x: bsr.l sasind # operand is a DENORM_L7_6x:## Result is now in FP0# movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs fmovm.x EXC_FP1(%a6),&0x40 # restore fp1 unlk %a6 rts########################################################################## MONADIC TEMPLATE ########################################################################## global _fatanhs__fatanhs_: link %a6,&-LOCAL_SIZE movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1 fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1 fmov.l &0x0,%fpcr # zero FPCR## copy, convert, and tag input argument# fmov.s 0x8(%a6),%fp0 # load sgl input fmov.x %fp0,FP_SRC(%a6) lea FP_SRC(%a6),%a0 bsr.l tag # fetch operand type mov.b %d0,STAG(%a6) mov.b %d0,%d1 andi.l &0x00ff00ff,USER_FPSR(%a6) clr.l %d0 mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec tst.b %d1 bne.b _L8_2s bsr.l satanh # operand is a NORM bra.b _L8_6s_L8_2s: cmpi.b %d1,&ZERO # is operand a ZERO? bne.b _L8_3s # no bsr.l src_zero # yes bra.b _L8_6s_L8_3s: cmpi.b %d1,&INF # is operand an INF? bne.b _L8_4s # no bsr.l t_operr # yes bra.b _L8_6s_L8_4s: cmpi.b %d1,&QNAN # is operand a QNAN? bne.b _L8_5s # no bsr.l src_qnan # yes bra.b _L8_6s_L8_5s: bsr.l satanhd # operand is a DENORM_L8_6s:## Result is now in FP0# movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs fmovm.x EXC_FP1(%a6),&0x40 # restore fp1 unlk %a6 rts global _fatanhd__fatanhd_: link %a6,&-LOCAL_SIZE movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1 fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1 fmov.l &0x0,%fpcr # zero FPCR## copy, convert, and tag input argument# fmov.d 0x8(%a6),%fp0 # load dbl input fmov.x %fp0,FP_SRC(%a6) lea FP_SRC(%a6),%a0 bsr.l tag # fetch operand type mov.b %d0,STAG(%a6) mov.b %d0,%d1 andi.l &0x00ff00ff,USER_FPSR(%a6) clr.l %d0 mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec mov.b %d1,STAG(%a6) tst.b %d1 bne.b _L8_2d bsr.l satanh # operand is a NORM bra.b _L8_6d_L8_2d: cmpi.b %d1,&ZERO # is operand a ZERO? bne.b _L8_3d # no bsr.l src_zero # yes bra.b _L8_6d_L8_3d: cmpi.b %d1,&INF # is operand an INF? bne.b _L8_4d # no bsr.l t_operr # yes bra.b _L8_6d_L8_4d: cmpi.b %d1,&QNAN # is operand a QNAN? bne.b _L8_5d # no bsr.l src_qnan # yes bra.b _L8_6d_L8_5d: bsr.l satanhd # operand is a DENORM_L8_6d:## Result is now in FP0# movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs fmovm.x EXC_FP1(%a6),&0x40 # restore fp1 unlk %a6 rts global _fatanhx__fatanhx_: link %a6,&-LOCAL_SIZE movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1 fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1 fmov.l &0x0,%fpcr # zero FPCR## copy, convert, and tag input argument# lea FP_SRC(%a6),%a0 mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input mov.l 0x8+0x4(%a6),0x4(%a0) mov.l 0x8+0x8(%a6),0x8(%a0) bsr.l tag # fetch operand type mov.b %d0,STAG(%a6) mov.b %d0,%d1 andi.l &0x00ff00ff,USER_FPSR(%a6) clr.l %d0 mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec tst.b %d1 bne.b _L8_2x bsr.l satanh # operand is a NORM bra.b _L8_6x_L8_2x: cmpi.b %d1,&ZERO # is operand a ZERO? bne.b _L8_3x # no bsr.l src_zero # yes bra.b _L8_6x_L8_3x: cmpi.b %d1,&INF # is operand an INF? bne.b _L8_4x # no bsr.l t_operr # yes bra.b _L8_6x_L8_4x: cmpi.b %d1,&QNAN # is operand a QNAN? bne.b _L8_5x # no bsr.l src_qnan # yes bra.b _L8_6x_L8_5x: bsr.l satanhd # operand is a DENORM_L8_6x:## Result is now in FP0# movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs fmovm.x EXC_FP1(%a6),&0x40 # restore fp1 unlk %a6 rts########################################################################## MONADIC TEMPLATE ########################################################################## global _ftans__ftans_: link %a6,&-LOCAL_SIZE movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1 fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1 fmov.l &0x0,%fpcr # zero FPCR## copy, convert, and tag input argument# fmov.s 0x8(%a6),%fp0 # load sgl input fmov.x %fp0,FP_SRC(%a6) lea FP_SRC(%a6),%a0 bsr.l tag # fetch operand type mov.b %d0,STAG(%a6) mov.b %d0,%d1 andi.l &0x00ff00ff,USER_FPSR(%a6) clr.l %d0 mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec tst.b %d1 bne.b _L9_2s bsr.l stan # operand is a NORM bra.b _L9_6s_L9_2s: cmpi.b %d1,&ZERO # is operand a ZERO? bne.b _L9_3s # no bsr.l src_zero # yes bra.b _L9_6s_L9_3s: cmpi.b %d1,&INF # is operand an INF? bne.b _L9_4s # no bsr.l t_operr # yes bra.b _L9_6s_L9_4s: cmpi.b %d1,&QNAN # is operand a QNAN? bne.b _L9_5s # no bsr.l src_qnan # yes bra.b _L9_6s_L9_5s: bsr.l stand # operand is a DENORM_L9_6s:## Result is now in FP0# movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs fmovm.x EXC_FP1(%a6),&0x40 # restore fp1 unlk %a6 rts global _ftand__ftand_: link %a6,&-LOCAL_SIZE movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1 fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1 fmov.l &0x0,%fpcr # zero FPCR## copy, convert, and tag input argument# fmov.d 0x8(%a6),%fp0 # load dbl input fmov.x %fp0,FP_SRC(%a6) lea FP_SRC(%a6),%a0 bsr.l tag # fetch operand type mov.b %d0,STAG(%a6) mov.b %d0,%d1 andi.l &0x00ff00ff,USER_FPSR(%a6) clr.l %d0 mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec mov.b %d1,STAG(%a6) tst.b %d1 bne.b _L9_2d bsr.l stan # operand is a NORM bra.b _L9_6d_L9_2d: cmpi.b %d1,&ZERO # is operand a ZERO? bne.b _L9_3d # no bsr.l src_zero # yes bra.b _L9_6d_L9_3d: cmpi.b %d1,&INF # is operand an INF? bne.b _L9_4d # no bsr.l t_operr # yes bra.b _L9_6d_L9_4d: cmpi.b %d1,&QNAN # is operand a QNAN? bne.b _L9_5d # no bsr.l src_qnan # yes bra.b _L9_6d_L9_5d: bsr.l stand # operand is a DENORM_L9_6d:## Result is now in FP0# movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs fmovm.x EXC_FP1(%a6),&0x40 # restore fp1 unlk %a6 rts global _ftanx__ftanx_: link %a6,&-LOCAL_SIZE movm.l &0x0303,EXC_DREGS(%a6) # save d0-d1/a0-a1 fmovm.l %fpcr,%fpsr,USER_FPCR(%a6) # save ctrl regs fmovm.x &0xc0,EXC_FP0(%a6) # save fp0/fp1 fmov.l &0x0,%fpcr # zero FPCR## copy, convert, and tag input argument# lea FP_SRC(%a6),%a0 mov.l 0x8+0x0(%a6),0x0(%a0) # load ext input mov.l 0x8+0x4(%a6),0x4(%a0) mov.l 0x8+0x8(%a6),0x8(%a0) bsr.l tag # fetch operand type mov.b %d0,STAG(%a6) mov.b %d0,%d1 andi.l &0x00ff00ff,USER_FPSR(%a6) clr.l %d0 mov.b FPCR_MODE(%a6),%d0 # pass rnd mode,prec tst.b %d1 bne.b _L9_2x bsr.l stan # operand is a NORM bra.b _L9_6x_L9_2x: cmpi.b %d1,&ZERO # is operand a ZERO? bne.b _L9_3x # no bsr.l src_zero # yes bra.b _L9_6x_L9_3x: cmpi.b %d1,&INF # is operand an INF? bne.b _L9_4x # no bsr.l t_operr # yes bra.b _L9_6x_L9_4x: cmpi.b %d1,&QNAN # is operand a QNAN? bne.b _L9_5x # no bsr.l src_qnan # yes bra.b _L9_6x_L9_5x: bsr.l stand # operand is a DENORM_L9_6x:## Result is now in FP0# movm.l EXC_DREGS(%a6),&0x0303 # restore d0-d1/a0-a1 fmovm.l USER_FPCR(%a6),%fpcr,%fpsr # restore ctrl regs fmovm.x EXC_FP1(%a6),&0x40 # restore fp1 unlk %a6 rts#########################################################################
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -