⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fpsymbol.h

📁 用于嵌入式Linux系统的标准C的库函数
💻 H
📖 第 1 页 / 共 5 页
字号:
     .ifeqs "@p2@","NO_ERR"       load 1,CP_READ_FLAGS|CP_NO_ERR,p1,0     .else       .err       .print "cp_read_flags: bad parameter list"     .endif     .exitm;   .endif;;   .if $narg>=3     .err     .print "cp_read_flags: too many parameters"   .endif; .endm;;;;============================================================================;  MACRO NAME: cp_read_status;;  WRITTEN BY: Bob Perlman;;  MOST RECENT UPDATE:  April 18, 1988;;  FUNCTION:   Transfers the contents of the Am29027 status register;              to the Am29000;;  PARAMETERS:;    reg     - the Am29000 g.p. register into which the current Am29027;              status register contents are to be written.;;    NO_ERR  - indicates that exception reporting is to be suppressed for this;              transfer.;;  USAGE:;;    cp_read_status  reg [,START];;       Ex:     cp_read_status  lr2        Transfers the Am29027 status register;                                          contents to lr2.;;               cp_read_status  lr2,NO_ERR Transfers the Am29027 status register;                                          contents to lr2, and suppresses;                                          exception reporting for this;                                          transfer.;;;============================================================================; .macro cp_read_status,p1,p2;   .if $narg==0     .err     .print "cp_read_status: missing parameter(s)"   .endif;;   .if $narg==1     load 1,CP_READ_STATUS,p1,0     .exitm   .endif;;   .if $narg==2;     .ifeqs "@p2@","NO_ERR"       load 1,CP_READ_STATUS|CP_NO_ERR,p1,0     .else       .err       .print "cp_read_status: bad parameter list"     .endif     .exitm;   .endif;;   .if $narg>=3     .err     .print "cp_read_status: too many parameters"   .endif; .endm;;;;============================================================================;  MACRO NAME: cp_read_state_wd;;  WRITTEN BY: Bob Perlman;;  MOST RECENT UPDATE:  April 18, 1988;;  FUNCTION:   Transfers the next Am29027 state word to the Am29000;;  PARAMETERS:;    reg     - the Am29000 g.p. register into which the next Am29027;              state word contents are to be written.;;  USAGE:;;    cp_read_state_wd  reg;;       Ex:     cp_read_state_wd  lr2  Transfers the next Am29027 state word;                                      to lr2.;;============================================================================; .macro cp_read_state_wd,p1;   .if $narg==0     .err     .print "cp_read_state_wd: missing parameter"   .endif;;   .if $narg==1     load 1,CP_SAVE_STATE,p1,0     .exitm   .endif;;   .if $narg>=2     .err     .print "cp_read_state_wd: too many parameters"   .endif; .endm;;;;============================================================================;  MACRO NAME: cp_save_state;;  WRITTEN BY: Bob Perlman;;  MOST RECENT UPDATE:  April 18, 1988;;  FUNCTION:   Transfers the current Am29027 state to the Am29000;;  PARAMETERS:;    reg     - the first of 30 Am29000 g.p. registers in which Am29027 state;              is saved.;;  USAGE:;;    cp_save_state  reg;;    This macro transfers the current Am29027 state to a block of 30 Am29000;    registers.  State is stored in the following order:;;              reg      instruction register;              reg+1    I-Temp;              reg+2    R MSBs;              reg+3    R LSBs;              reg+4    S MSBs;              reg+5    S LSBs;              reg+6    R-Temp MSBs;              reg+7    R-Temp LSBs;              reg+8    S-Temp MSBs;              reg+9    S-Temp LSBs;              reg+10   status;              reg+11   precision;              reg+12   RF0 MSBs;              reg+13   RF0 LSBs;                .         .;                .         .;                .         .;              reg+26   RF7 MSBs;              reg+27   RF7 LSBs;              reg+28   mode MSBs;              reg+29   mode LSBs;;;       Ex:     cp_save_state  lr2     Transfers the current Am29027 state to;                                      the Am29000, starting at lr2.;;  NOTES:;       1) This macro stores all 64-bit quantities in "big-endian" order,;          i.e. MSBs first.  For example, the 32 MSBs of register R are;          stored in reg+2, and the 32 LSBs are stored in reg+3.  The Am29027;          transfers these quantites in "little-endian" order; the macro;          is responsible for swapping MS and LS words.;;============================================================================; .macro cp_save_state,p1;   .if $narg==0     .err     .print "cp_save_state: missing parameter"   .endif;;   .if $narg==1     cp_read_sp p1,NO_ERR                                    ;guarantee that we're at beginning of                                    ; save state sequence     cp_read_state_wd %%((&p1)+ 0)  ; instruction     cp_read_state_wd %%((&p1)+ 1)  ; I-Temp     cp_read_state_wd %%((&p1)+ 3)  ; R MSBs     cp_read_state_wd %%((&p1)+ 2)  ; R LSBs     cp_read_state_wd %%((&p1)+ 5)  ; S MSBs     cp_read_state_wd %%((&p1)+ 4)  ; S LSBs     cp_read_state_wd %%((&p1)+ 7)  ; R-Temp MSBs     cp_read_state_wd %%((&p1)+ 6)  ; R-Temp LSBs     cp_read_state_wd %%((&p1)+ 9)  ; S-Temp MSBs     cp_read_state_wd %%((&p1)+ 8)  ; S-Temp LSBs     cp_read_state_wd %%((&p1)+10)  ; status     cp_read_state_wd %%((&p1)+11)  ; precision     cp_read_state_wd %%((&p1)+13)  ; RF0 MSBs     cp_read_state_wd %%((&p1)+12)  ; RF0 LSBs     cp_read_state_wd %%((&p1)+15)  ; RF1 MSBs     cp_read_state_wd %%((&p1)+14)  ; RF1 LSBs     cp_read_state_wd %%((&p1)+17)  ; RF2 MSBs     cp_read_state_wd %%((&p1)+16)  ; RF2 LSBs     cp_read_state_wd %%((&p1)+19)  ; RF3 MSBs     cp_read_state_wd %%((&p1)+18)  ; RF3 LSBs     cp_read_state_wd %%((&p1)+21)  ; RF4 MSBs     cp_read_state_wd %%((&p1)+20)  ; RF4 LSBs     cp_read_state_wd %%((&p1)+23)  ; RF5 MSBs     cp_read_state_wd %%((&p1)+22)  ; RF5 LSBs     cp_read_state_wd %%((&p1)+25)  ; RF6 MSBs     cp_read_state_wd %%((&p1)+24)  ; RF6 LSBs     cp_read_state_wd %%((&p1)+27)  ; RF7 MSBs     cp_read_state_wd %%((&p1)+26)  ; RF7 LSBs     cp_read_state_wd %%((&p1)+29)  ; mode MSBs     cp_read_state_wd %%((&p1)+28)  ; mode LSBs     .exitm   .endif;;   .if $narg>=2     .err     .print "cp_save_state: too many parameters"   .endif; .endm;;;;;;============================================================================;  MACRO NAME: cp_restore_state;;  WRITTEN BY: Bob Perlman;;  MOST RECENT UPDATE:  April 18, 1988;;  FUNCTION:   Restores Am29027 state;;  PARAMETERS:;    reg     - the first of 30 Am29000 g.p. registers containing Am29027;              state.;;    temp    - a scratch register used by cp_restore_state;;  USAGE:;;    cp_restore_state  reg,temp;;    This macro restores Am29027 state by transferring 30 words to the;    Am29027; these words are taken from a block of Am29000 g.p. registers;    starting at "reg."  The words are assumed to be stored in the following;    order:;;              reg      instruction register;              reg+1    I-Temp;              reg+2    R MSBs;              reg+3    R LSBs;              reg+4    S MSBs;              reg+5    S LSBs;              reg+6    R-Temp MSBs;              reg+7    R-Temp LSBs;              reg+8    S-Temp MSBs;              reg+9    S-Temp LSBs;              reg+10   status;              reg+11   precision;              reg+12   RF0 MSBs;              reg+13   RF0 LSBs;                .         .;                .         .;                .         .;              reg+26   RF7 MSBs;              reg+27   RF7 LSBs;              reg+28   mode MSBs;              reg+29   mode LSBs;;;       Ex:     cp_restore_state  lr2,gr70  Restores Am29027 state by;                                           transferring a block of 30 words;                                           that begins at lr2.  Register gr70;                                           is used as scratch storage by this;                                           macro.;;;============================================================================; .macro cp_restore_state,p1,p2;   .if $narg<=1     .err     .print "cp_restore_state: missing parameter(s)"   .endif;;   .if $narg==2     const p2,0                     ;clear the status register     cp_write_status p2;     cp_write_mode %%((&p1)+28)     ;restore the mode register;     const  p2,0x80000018           ; restore RF0     consth p2,0x80000018     cp_write_inst p2     cp_write_r %%((&p1)+12),START;     consth p2,0x90000018           ; restore RF1     cp_write_inst p2     cp_write_r %%((&p1)+14),START;     consth p2,0xA0000018           ; restore RF2     cp_write_inst p2     cp_write_r %%((&p1)+16),START;     consth p2,0xB0000018           ; restore RF3     cp_write_inst p2     cp_write_r %%((&p1)+18),START;     consth p2,0xC0000018           ; restore RF4     cp_write_inst p2     cp_write_r %%((&p1)+20),START;     consth p2,0xD0000018           ; restore RF5     cp_write_inst p2     cp_write_r %%((&p1)+22),START;     consth p2,0xE0000018           ; restore RF6     cp_write_inst p2     cp_write_r %%((&p1)+24),START;     consth p2,0xF0000018           ; restore RF7     cp_write_inst p2     cp_write_r %%((&p1)+26),START;     cp_read_sp p2                  ; do a dummy read, to guarantee that                                    ; the last operation is complete;     cp_write_prec %%((&p1)+11)     ; restore precision;     cp_write_r %%((&p1)+2)         ; restore R     cp_write_s %%((&p1)+4)         ; restore S     cp_write_inst %%((&p1)+0)      ; restore instruction     cp_advance_temps               ; move R,S, and inst. to working registers;     cp_write_r %%((&p1)+6)         ; restore R-Temp     cp_write_s %%((&p1)+8)         ; restore S-Temp     cp_write_inst %%((&p1)+1)      ; restore I-Temp;; restore the status register, retime last operation;     cp_write_status %%((&p1)+10),RESTORE;     .exitm   .endif;;   .if $narg>=3     .err     .print "cp_restore_state: too many parameters"   .endif; .endm;;;;============================================================================;  MACRO NAME: cp_build_inst;;  WRITTEN BY: Bob Perlman;;  MOST RECENT UPDATE:  April 24, 1988;                    :  January 4, 1989 Rich Parker;;  FUNCTION:   Builds a 32-bit Am29027 instruction in an Am29000 g.p.;              register.;;  PARAMETERS:;    reg       - the Am29000 g.p. register into which the instruction word;                is to be written;;    op_code   - mnemonic specifying the operation to be performed;                (e.g. FADD, P_TIMES_Q);;    precision - precision specification for destination, source operands:;                  D_S - double-prec. result, single-prec. input(s);                  D_D - double-prec. result, double-prec. input(s);                  S_S - single-prec. result, single-prec. input(s);                  S_D - single-prec. result, double-prec. input(s);;    dest      - destination for the operation result:;                  RF0 - store result in Am29027 register file location RF0;                  RF1 - store result in Am29027 register file location RF1;                  RF2 - store result in Am29027 reg

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -