?? l_entry.s
字號:
/* l_entry.s - Motorola 68040 FP entry points (LIB) *//* Copyright 1991-1993 Wind River Systems, Inc. */ .data .globl _copyright_wind_river .long _copyright_wind_river/*modification history--------------------01j,28jan97,ms fixed SPR 7822 (bug from 01i check-in - never part of product)01i,31may96,ms updated to mototorola version 2.301h,21jul93,kdl added .text (SPR #2372).01g,18sep92,kdl restored title line clobbered in 01f checkin.01f,18sep92,kdl changed multi-reg (fpsr/fpcr) saves to use offset USER_FPCR instead of USER_FPSR, to reflect actual save order (SPR #1455).01e,23aug92,jcf changed bxxx to jxx.01d,20aug92,kdl added changes from Motorola FPSP v2.2 to correctly save fpcr.01c,26may92,rrr the tree shuffle01b,09jan92,kdl added modification history; general cleanup.01a,15aug91,kdl original version, from Motorola FPSP v2.0.*//*DESCRIPTIONThis file contains Motorola FPSP library interface entry points forvarious floating point operations.*/| section 8#include "fpsp040L.h"| xref __l_tag| xref __l_szero| xref __l_sinf| xref __l_sopr_inf| xref __l_sone| xref __l_spi_2| xref __l_szr_inf| xref __l_src_nan| xref __l_t_operr| xref __l_t_dz2| xref __l_snzrinx| xref __l_ld_pone| xref __l_ld_pinf| xref __l_ld_ppi2| xref __l_ssincosz| xref __l_ssincosi| xref __l_ssincosnan| xref __l_setoxm1i|| MONADIC.GEN 1.3 4/30/91|| MONADIC.GEN --- generic MONADIC template|| This version saves all registers that will be used by the emulation| routines and restores all but FP0 on exit. The FPSR is| updated to reflect the result of the operation. Return value| is placed in FP0 for single, double and extended results.|| The package subroutines expect the incoming fpcr to be zeroed| since they need extended precision to work properly. The/* 'final' fpcr is expected in d1 so that the calculated result */| can be properly sized and rounded. Also, if the incoming fpcr| has enabled any exceptions, the exception will be taken on the| final fmovem in this template.|| Customizations:| 1. Remove the moveml at the entry and exit of| each routine if your compiler treats those| registers as scratch./* 2. Likewise, don't save FP0/FP1 if they are scratch */| registers.| 3. Delete handling of the fpsr if you only care about| the result.| 4. Some (most?) C compilers convert all float arguments| to double, and provide no support at all for extended| precision so remove the __l_facoss and __l_facosx entry points.| 5. Move the result to d0/d1 if the compiler is that old.| Copyright (C) Motorola, Inc. 1991| All Rights Reserved|| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA| The copyright notice above does not evidence any| actual or intended publication of such source code.| xref __l_tag| xref __l_sacos| xref __l_ld_ppi2| xref __l_t_operr| xref __l_mon_nan| xref __l_sacosd .text .globl __l_facoss__l_facoss: link a6,#-LOCAL_SIZE moveml d0-d1/a0-a1,a6@(USER_DA) fmovemx fp0-fp3,a6@(USER_FP0) fmovel fpsr,a6@(USER_FPSR) fmovel fpcr,a6@(USER_FPCR) fmovel fpcr,d1 /* | user's rounding mode/precision */ fmovel #0,fpcr | force rounding mode/prec to extended,rn|| copy, convert and tag input argument| fmoves a6@(8),fp0 fmovex fp0,a6@(ETEMP) lea a6@(ETEMP),a0 bsrl __l_tag moveb d0,a6@(STAG) tstb d0 jne L_1012 bsrl __l_sacos | normalized (regular) number jra L_1016L_1012: cmpb #0x20,d0 | zero? jne L_1013 bsrl __l_ld_ppi2 jra L_1016L_1013: cmpb #0x40,d0 | infinity? jne L_1014 bsrl __l_t_operr jra L_1016L_1014: cmpb #0x60,d0 | NaN? jne L_1015 bsrl __l_mon_nan jra L_1016L_1015: bsrl __l_sacosd | assuming a denorm...L_1016: fmovel fpsr,d0 | update status register orb a6@(USER_FPSR+3),d0 | add previously accrued exceptions fmovel d0,fpsr|| Result is now in FP0| moveml a6@(USER_DA),d0-d1/a0-a1 fmovemx a6@(USER_FP1),fp1-fp3 | note: fp0 not restored fmovel a6@(USER_FPCR),fpcr | fpcr restored unlk a6 rts .globl __l_facosd__l_facosd: link a6,#-LOCAL_SIZE moveml d0-d1/a0-a1,a6@(USER_DA) fmovemx fp0-fp3,a6@(USER_FP0) fmovel fpsr,a6@(USER_FPSR) fmovel fpcr,a6@(USER_FPCR) fmovel fpcr,d1 /* | user's rounding mode/precision */ fmovel #0,fpcr | force rounding mode/prec to extended,rn|| copy, convert and tag input argument| fmoved a6@(8),fp0 fmovex fp0,a6@(ETEMP) lea a6@(ETEMP),a0 bsrl __l_tag moveb d0,a6@(STAG) tstb d0 jne L_1017 bsrl __l_sacos | normalized (regular) number jra L_101BL_1017: cmpb #0x20,d0 | zero? jne L_1018 bsrl __l_ld_ppi2 jra L_101BL_1018: cmpb #0x40,d0 | infinity? jne L_1019 bsrl __l_t_operr jra L_101BL_1019: cmpb #0x60,d0 | NaN? jne L_101A bsrl __l_mon_nan jra L_101BL_101A: bsrl __l_sacosd | assuming a denorm...L_101B: fmovel fpsr,d0 | update status register orb a6@(USER_FPSR+3),d0 | add previously accrued exceptions fmovel d0,fpsr|| Result is now in FP0| moveml a6@(USER_DA),d0-d1/a0-a1 fmovemx a6@(USER_FP1),fp1-fp3 | note: fp0 not restored fmovel a6@(USER_FPCR),fpcr | fpcr restored unlk a6 rts .globl __l_facosx__l_facosx: link a6,#-LOCAL_SIZE moveml d0-d1/a0-a1,a6@(USER_DA) fmovemx fp0-fp3,a6@(USER_FP0) fmovel fpsr,a6@(USER_FPSR) fmovel fpcr,a6@(USER_FPCR) fmovel fpcr,d1 /* | user's rounding mode/precision */ fmovel #0,fpcr | force rounding mode/prec to extended,rn|| copy, convert and tag input argument| fmovex a6@(8),fp0 fmovex fp0,a6@(ETEMP) lea a6@(ETEMP),a0 bsrl __l_tag moveb d0,a6@(STAG) tstb d0 jne L_101C bsrl __l_sacos | normalized (regular) number jra L_101GL_101C: cmpb #0x20,d0 | zero? jne L_101D bsrl __l_ld_ppi2 jra L_101GL_101D: cmpb #0x40,d0 | infinity? jne L_101E bsrl __l_t_operr jra L_101GL_101E: cmpb #0x60,d0 | NaN? jne L_101F bsrl __l_mon_nan jra L_101GL_101F: bsrl __l_sacosd | assuming a denorm...L_101G: fmovel fpsr,d0 | update status register orb a6@(USER_FPSR+3),d0 | add previously accrued exceptions fmovel d0,fpsr|| Result is now in FP0| moveml a6@(USER_DA),d0-d1/a0-a1 fmovemx a6@(USER_FP1),fp1-fp3 | note: fp0 not restored fmovel a6@(USER_FPCR),fpcr | fpcr restored unlk a6 rts|| MONADIC.GEN 1.3 4/30/91|| MONADIC.GEN --- generic MONADIC template|| This version saves all registers that will be used by the emulation| routines and restores all but FP0 on exit. The FPSR is| updated to reflect the result of the operation. Return value| is placed in FP0 for single, double and extended results.|| The package subroutines expect the incoming fpcr to be zeroed| since they need extended precision to work properly. The/* | 'final' fpcr is expected in d1 so that the calculated result */| can be properly sized and rounded. Also, if the incoming fpcr| has enabled any exceptions, the exception will be taken on the| final fmovem in this template.|| Customizations:| 1. Remove the moveml at the entry and exit of| each routine if your compiler treats those| registers as scratch./* | 2. Likewise, don't save FP0/FP1 if they are scratch */| registers.| 3. Delete handling of the fpsr if you only care about| the result.| 4. Some (most?) C compilers convert all float arguments| to double, and provide no support at all for extended| precision so remove the __l_fasins and __l_fasinx entry points.| 5. Move the result to d0/d1 if the compiler is that old.| Copyright (C) Motorola, Inc. 1991| All Rights Reserved|| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA| The copyright notice above does not evidence any| actual or intended publication of such source code.| xref __l_tag| xref __l_sasin| xref __l_szero| xref __l_t_operr| xref __l_mon_nan| xref __l_sasind .globl __l_fasins__l_fasins: link a6,#-LOCAL_SIZE moveml d0-d1/a0-a1,a6@(USER_DA) fmovemx fp0-fp3,a6@(USER_FP0) fmovel fpsr,a6@(USER_FPSR) fmovel fpcr,a6@(USER_FPCR) fmovel fpcr,d1 /* | user's rounding mode/precision */ fmovel #0,fpcr | force rounding mode/prec to extended,rn|| copy, convert and tag input argument| fmoves a6@(8),fp0 fmovex fp0,a6@(ETEMP) lea a6@(ETEMP),a0 bsrl __l_tag moveb d0,a6@(STAG) tstb d0 jne L_1022 bsrl __l_sasin | normalized (regular) number jra L_1026L_1022: cmpb #0x20,d0 | zero? jne L_1023 bsrl __l_szero jra L_1026L_1023: cmpb #0x40,d0 | infinity? jne L_1024 bsrl __l_t_operr jra L_1026L_1024: cmpb #0x60,d0 | NaN? jne L_1025 bsrl __l_mon_nan jra L_1026L_1025: bsrl __l_sasind | assuming a denorm...L_1026: fmovel fpsr,d0 | update status register orb a6@(USER_FPSR+3),d0 | add previously accrued exceptions fmovel d0,fpsr|| Result is now in FP0| moveml a6@(USER_DA),d0-d1/a0-a1 fmovemx a6@(USER_FP1),fp1-fp3 | note: fp0 not restored fmovel a6@(USER_FPCR),fpcr | fpcr restored unlk a6 rts .globl __l_fasind__l_fasind: link a6,#-LOCAL_SIZE moveml d0-d1/a0-a1,a6@(USER_DA) fmovemx fp0-fp3,a6@(USER_FP0) fmovel fpsr,a6@(USER_FPSR) fmovel fpcr,a6@(USER_FPCR) fmovel fpcr,d1 /* | user's rounding mode/precision */ fmovel #0,fpcr | force rounding mode/prec to extended,rn|| copy, convert and tag input argument| fmoved a6@(8),fp0 fmovex fp0,a6@(ETEMP) lea a6@(ETEMP),a0 bsrl __l_tag moveb d0,a6@(STAG) tstb d0 jne L_1027 bsrl __l_sasin | normalized (regular) number jra L_102BL_1027: cmpb #0x20,d0 | zero? jne L_1028 bsrl __l_szero jra L_102BL_1028: cmpb #0x40,d0 | infinity? jne L_1029 bsrl __l_t_operr jra L_102BL_1029: cmpb #0x60,d0 | NaN? jne L_102A bsrl __l_mon_nan jra L_102BL_102A: bsrl __l_sasind | assuming a denorm...L_102B: fmovel fpsr,d0 | update status register orb a6@(USER_FPSR+3),d0 | add previously accrued exceptions fmovel d0,fpsr|| Result is now in FP0| moveml a6@(USER_DA),d0-d1/a0-a1 fmovemx a6@(USER_FP1),fp1-fp3 | note: fp0 not restored fmovel a6@(USER_FPCR),fpcr | fpcr restored unlk a6 rts .globl __l_fasinx__l_fasinx: link a6,#-LOCAL_SIZE moveml d0-d1/a0-a1,a6@(USER_DA) fmovemx fp0-fp3,a6@(USER_FP0) fmovel fpsr,a6@(USER_FPSR) fmovel fpcr,a6@(USER_FPCR) fmovel fpcr,d1 /* | user's rounding mode/precision */ fmovel #0,fpcr | force rounding mode/prec to extended,rn|| copy, convert and tag input argument| fmovex a6@(8),fp0 fmovex fp0,a6@(ETEMP) lea a6@(ETEMP),a0 bsrl __l_tag moveb d0,a6@(STAG) tstb d0 jne L_102C bsrl __l_sasin | normalized (regular) number jra L_102GL_102C: cmpb #0x20,d0 | zero? jne L_102D bsrl __l_szero jra L_102GL_102D: cmpb #0x40,d0 | infinity? jne L_102E bsrl __l_t_operr jra L_102GL_102E: cmpb #0x60,d0 | NaN? jne L_102F bsrl __l_mon_nan jra L_102GL_102F: bsrl __l_sasind | assuming a denorm...L_102G: fmovel fpsr,d0 | update status register orb a6@(USER_FPSR+3),d0 | add previously accrued exceptions fmovel d0,fpsr|| Result is now in FP0| moveml a6@(USER_DA),d0-d1/a0-a1 fmovemx a6@(USER_FP1),fp1-fp3 | note: fp0 not restored fmovel a6@(USER_FPCR),fpcr | fpcr restored unlk a6 rts|| MONADIC.GEN 1.3 4/30/91|| MONADIC.GEN --- generic MONADIC template|| This version saves all registers that will be used by the emulation| routines and restores all but FP0 on exit. The FPSR is| updated to reflect the result of the operation. Return value| is placed in FP0 for single, double and extended results.|| The package subroutines expect the incoming fpcr to be zeroed| since they need extended precision to work properly. The/* | 'final' fpcr is expected in d1 so that the calculated result */| can be properly sized and rounded. Also, if the incoming fpcr| has enabled any exceptions, the exception will be taken on the| final fmovem in this template.|| Customizations:| 1. Remove the moveml at the entry and exit of| each routine if your compiler treats those| registers as scratch./* | 2. Likewise, don't save FP0/FP1 if they are scratch */| registers.| 3. Delete handling of the fpsr if you only care about| the result.| 4. Some (most?) C compilers convert all float arguments| to double, and provide no support at all for extended| precision so remove the __l_fatans and __l_fatanx entry points.| 5. Move the result to d0/d1 if the compiler is that old.| Copyright (C) Motorola, Inc. 1991| All Rights Reserved|| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA| The copyright notice above does not evidence any| actual or intended publication of such source code.| xref __l_tag| xref __l_satan| xref __l_szero| xref __l_spi_2| xref __l_mon_nan| xref __l_satand .globl __l_fatans__l_fatans: link a6,#-LOCAL_SIZE moveml d0-d1/a0-a1,a6@(USER_DA) fmovemx fp0-fp3,a6@(USER_FP0) fmovel fpsr,a6@(USER_FPSR) fmovel fpcr,a6@(USER_FPCR) fmovel fpcr,d1 /* | user's rounding mode/precision */ fmovel #0,fpcr | force rounding mode/prec to extended,rn|| copy, convert and tag input argument| fmoves a6@(8),fp0 fmovex fp0,a6@(ETEMP) lea a6@(ETEMP),a0 bsrl __l_tag moveb d0,a6@(STAG) tstb d0 jne L_1032 bsrl __l_satan | normalized (regular) number jra L_1036L_1032: cmpb #0x20,d0 | zero? jne L_1033 bsrl __l_szero jra L_1036L_1033: cmpb #0x40,d0 | infinity? jne L_1034 bsrl __l_spi_2 jra L_1036L_1034: cmpb #0x60,d0 | NaN? jne L_1035 bsrl __l_mon_nan jra L_1036
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -