18c2ecf20Sopenharmony_ci| 28c2ecf20Sopenharmony_ci| fpsp.h 3.3 3.3 38c2ecf20Sopenharmony_ci| 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci| Copyright (C) Motorola, Inc. 1990 68c2ecf20Sopenharmony_ci| All Rights Reserved 78c2ecf20Sopenharmony_ci| 88c2ecf20Sopenharmony_ci| For details on the license for this file, please see the 98c2ecf20Sopenharmony_ci| file, README, in this same directory. 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci| fpsp.h --- stack frame offsets during FPSP exception handling 128c2ecf20Sopenharmony_ci| 138c2ecf20Sopenharmony_ci| These equates are used to access the exception frame, the fsave 148c2ecf20Sopenharmony_ci| frame and any local variables needed by the FPSP package. 158c2ecf20Sopenharmony_ci| 168c2ecf20Sopenharmony_ci| All FPSP handlers begin by executing: 178c2ecf20Sopenharmony_ci| 188c2ecf20Sopenharmony_ci| link a6,#-LOCAL_SIZE 198c2ecf20Sopenharmony_ci| fsave -(a7) 208c2ecf20Sopenharmony_ci| movem.l d0-d1/a0-a1,USER_DA(a6) 218c2ecf20Sopenharmony_ci| fmovem.x fp0-fp3,USER_FP0(a6) 228c2ecf20Sopenharmony_ci| fmove.l fpsr/fpcr/fpiar,USER_FPSR(a6) 238c2ecf20Sopenharmony_ci| 248c2ecf20Sopenharmony_ci| After initialization, the stack looks like this: 258c2ecf20Sopenharmony_ci| 268c2ecf20Sopenharmony_ci| A7 ---> +-------------------------------+ 278c2ecf20Sopenharmony_ci| | | 288c2ecf20Sopenharmony_ci| | FPU fsave area | 298c2ecf20Sopenharmony_ci| | | 308c2ecf20Sopenharmony_ci| +-------------------------------+ 318c2ecf20Sopenharmony_ci| | | 328c2ecf20Sopenharmony_ci| | FPSP Local Variables | 338c2ecf20Sopenharmony_ci| | including | 348c2ecf20Sopenharmony_ci| | saved registers | 358c2ecf20Sopenharmony_ci| | | 368c2ecf20Sopenharmony_ci| +-------------------------------+ 378c2ecf20Sopenharmony_ci| A6 ---> | Saved A6 | 388c2ecf20Sopenharmony_ci| +-------------------------------+ 398c2ecf20Sopenharmony_ci| | | 408c2ecf20Sopenharmony_ci| | Exception Frame | 418c2ecf20Sopenharmony_ci| | | 428c2ecf20Sopenharmony_ci| | | 438c2ecf20Sopenharmony_ci| 448c2ecf20Sopenharmony_ci| Positive offsets from A6 refer to the exception frame. Negative 458c2ecf20Sopenharmony_ci| offsets refer to the Local Variable area and the fsave area. 468c2ecf20Sopenharmony_ci| The fsave frame is also accessible from the top via A7. 478c2ecf20Sopenharmony_ci| 488c2ecf20Sopenharmony_ci| On exit, the handlers execute: 498c2ecf20Sopenharmony_ci| 508c2ecf20Sopenharmony_ci| movem.l USER_DA(a6),d0-d1/a0-a1 518c2ecf20Sopenharmony_ci| fmovem.x USER_FP0(a6),fp0-fp3 528c2ecf20Sopenharmony_ci| fmove.l USER_FPSR(a6),fpsr/fpcr/fpiar 538c2ecf20Sopenharmony_ci| frestore (a7)+ 548c2ecf20Sopenharmony_ci| unlk a6 558c2ecf20Sopenharmony_ci| 568c2ecf20Sopenharmony_ci| and then either "bra fpsp_done" if the exception was completely 578c2ecf20Sopenharmony_ci| handled by the package, or "bra real_xxxx" which is an external 588c2ecf20Sopenharmony_ci| label to a routine that will process a real exception of the 598c2ecf20Sopenharmony_ci| type that was generated. Some handlers may omit the "frestore" 608c2ecf20Sopenharmony_ci| if the FPU state after the exception is idle. 618c2ecf20Sopenharmony_ci| 628c2ecf20Sopenharmony_ci| Sometimes the exception handler will transform the fsave area 638c2ecf20Sopenharmony_ci| because it needs to report an exception back to the user. This 648c2ecf20Sopenharmony_ci| can happen if the package is entered for an unimplemented float 658c2ecf20Sopenharmony_ci| instruction that generates (say) an underflow. Alternatively, 668c2ecf20Sopenharmony_ci| a second fsave frame can be pushed onto the stack and the 678c2ecf20Sopenharmony_ci| handler exit code will reload the new frame and discard the old. 688c2ecf20Sopenharmony_ci| 698c2ecf20Sopenharmony_ci| The registers d0, d1, a0, a1 and fp0-fp3 are always saved and 708c2ecf20Sopenharmony_ci| restored from the "local variable" area and can be used as 718c2ecf20Sopenharmony_ci| temporaries. If a routine needs to change any 728c2ecf20Sopenharmony_ci| of these registers, it should modify the saved copy and let 738c2ecf20Sopenharmony_ci| the handler exit code restore the value. 748c2ecf20Sopenharmony_ci| 758c2ecf20Sopenharmony_ci|---------------------------------------------------------------------- 768c2ecf20Sopenharmony_ci| 778c2ecf20Sopenharmony_ci| Local Variables on the stack 788c2ecf20Sopenharmony_ci| 798c2ecf20Sopenharmony_ci .set LOCAL_SIZE,192 | bytes needed for local variables 808c2ecf20Sopenharmony_ci .set LV,-LOCAL_SIZE | convenient base value 818c2ecf20Sopenharmony_ci| 828c2ecf20Sopenharmony_ci .set USER_DA,LV+0 | save space for D0-D1,A0-A1 838c2ecf20Sopenharmony_ci .set USER_D0,LV+0 | saved user D0 848c2ecf20Sopenharmony_ci .set USER_D1,LV+4 | saved user D1 858c2ecf20Sopenharmony_ci .set USER_A0,LV+8 | saved user A0 868c2ecf20Sopenharmony_ci .set USER_A1,LV+12 | saved user A1 878c2ecf20Sopenharmony_ci .set USER_FP0,LV+16 | saved user FP0 888c2ecf20Sopenharmony_ci .set USER_FP1,LV+28 | saved user FP1 898c2ecf20Sopenharmony_ci .set USER_FP2,LV+40 | saved user FP2 908c2ecf20Sopenharmony_ci .set USER_FP3,LV+52 | saved user FP3 918c2ecf20Sopenharmony_ci .set USER_FPCR,LV+64 | saved user FPCR 928c2ecf20Sopenharmony_ci .set FPCR_ENABLE,USER_FPCR+2 | FPCR exception enable 938c2ecf20Sopenharmony_ci .set FPCR_MODE,USER_FPCR+3 | FPCR rounding mode control 948c2ecf20Sopenharmony_ci .set USER_FPSR,LV+68 | saved user FPSR 958c2ecf20Sopenharmony_ci .set FPSR_CC,USER_FPSR+0 | FPSR condition code 968c2ecf20Sopenharmony_ci .set FPSR_QBYTE,USER_FPSR+1 | FPSR quotient 978c2ecf20Sopenharmony_ci .set FPSR_EXCEPT,USER_FPSR+2 | FPSR exception 988c2ecf20Sopenharmony_ci .set FPSR_AEXCEPT,USER_FPSR+3 | FPSR accrued exception 998c2ecf20Sopenharmony_ci .set USER_FPIAR,LV+72 | saved user FPIAR 1008c2ecf20Sopenharmony_ci .set FP_SCR1,LV+76 | room for a temporary float value 1018c2ecf20Sopenharmony_ci .set FP_SCR2,LV+92 | room for a temporary float value 1028c2ecf20Sopenharmony_ci .set L_SCR1,LV+108 | room for a temporary long value 1038c2ecf20Sopenharmony_ci .set L_SCR2,LV+112 | room for a temporary long value 1048c2ecf20Sopenharmony_ci .set STORE_FLG,LV+116 1058c2ecf20Sopenharmony_ci .set BINDEC_FLG,LV+117 | used in bindec 1068c2ecf20Sopenharmony_ci .set DNRM_FLG,LV+118 | used in res_func 1078c2ecf20Sopenharmony_ci .set RES_FLG,LV+119 | used in res_func 1088c2ecf20Sopenharmony_ci .set DY_MO_FLG,LV+120 | dyadic/monadic flag 1098c2ecf20Sopenharmony_ci .set UFLG_TMP,LV+121 | temporary for uflag errata 1108c2ecf20Sopenharmony_ci .set CU_ONLY,LV+122 | cu-only flag 1118c2ecf20Sopenharmony_ci .set VER_TMP,LV+123 | temp holding for version number 1128c2ecf20Sopenharmony_ci .set L_SCR3,LV+124 | room for a temporary long value 1138c2ecf20Sopenharmony_ci .set FP_SCR3,LV+128 | room for a temporary float value 1148c2ecf20Sopenharmony_ci .set FP_SCR4,LV+144 | room for a temporary float value 1158c2ecf20Sopenharmony_ci .set FP_SCR5,LV+160 | room for a temporary float value 1168c2ecf20Sopenharmony_ci .set FP_SCR6,LV+176 1178c2ecf20Sopenharmony_ci| 1188c2ecf20Sopenharmony_ci|NEXT equ LV+192 ;need to increase LOCAL_SIZE 1198c2ecf20Sopenharmony_ci| 1208c2ecf20Sopenharmony_ci|-------------------------------------------------------------------------- 1218c2ecf20Sopenharmony_ci| 1228c2ecf20Sopenharmony_ci| fsave offsets and bit definitions 1238c2ecf20Sopenharmony_ci| 1248c2ecf20Sopenharmony_ci| Offsets are defined from the end of an fsave because the last 10 1258c2ecf20Sopenharmony_ci| words of a busy frame are the same as the unimplemented frame. 1268c2ecf20Sopenharmony_ci| 1278c2ecf20Sopenharmony_ci .set CU_SAVEPC,LV-92 | micro-pc for CU (1 byte) 1288c2ecf20Sopenharmony_ci .set FPR_DIRTY_BITS,LV-91 | fpr dirty bits 1298c2ecf20Sopenharmony_ci| 1308c2ecf20Sopenharmony_ci .set WBTEMP,LV-76 | write back temp (12 bytes) 1318c2ecf20Sopenharmony_ci .set WBTEMP_EX,WBTEMP | wbtemp sign and exponent (2 bytes) 1328c2ecf20Sopenharmony_ci .set WBTEMP_HI,WBTEMP+4 | wbtemp mantissa [63:32] (4 bytes) 1338c2ecf20Sopenharmony_ci .set WBTEMP_LO,WBTEMP+8 | wbtemp mantissa [31:00] (4 bytes) 1348c2ecf20Sopenharmony_ci| 1358c2ecf20Sopenharmony_ci .set WBTEMP_SGN,WBTEMP+2 | used to store sign 1368c2ecf20Sopenharmony_ci| 1378c2ecf20Sopenharmony_ci .set FPSR_SHADOW,LV-64 | fpsr shadow reg 1388c2ecf20Sopenharmony_ci| 1398c2ecf20Sopenharmony_ci .set FPIARCU,LV-60 | Instr. addr. reg. for CU (4 bytes) 1408c2ecf20Sopenharmony_ci| 1418c2ecf20Sopenharmony_ci .set CMDREG2B,LV-52 | cmd reg for machine 2 1428c2ecf20Sopenharmony_ci .set CMDREG3B,LV-48 | cmd reg for E3 exceptions (2 bytes) 1438c2ecf20Sopenharmony_ci| 1448c2ecf20Sopenharmony_ci .set NMNEXC,LV-44 | NMNEXC (unsup,snan bits only) 1458c2ecf20Sopenharmony_ci .set nmn_unsup_bit,1 | 1468c2ecf20Sopenharmony_ci .set nmn_snan_bit,0 | 1478c2ecf20Sopenharmony_ci| 1488c2ecf20Sopenharmony_ci .set NMCEXC,LV-43 | NMNEXC & NMCEXC 1498c2ecf20Sopenharmony_ci .set nmn_operr_bit,7 1508c2ecf20Sopenharmony_ci .set nmn_ovfl_bit,6 1518c2ecf20Sopenharmony_ci .set nmn_unfl_bit,5 1528c2ecf20Sopenharmony_ci .set nmc_unsup_bit,4 1538c2ecf20Sopenharmony_ci .set nmc_snan_bit,3 1548c2ecf20Sopenharmony_ci .set nmc_operr_bit,2 1558c2ecf20Sopenharmony_ci .set nmc_ovfl_bit,1 1568c2ecf20Sopenharmony_ci .set nmc_unfl_bit,0 1578c2ecf20Sopenharmony_ci| 1588c2ecf20Sopenharmony_ci .set STAG,LV-40 | source tag (1 byte) 1598c2ecf20Sopenharmony_ci .set WBTEMP_GRS,LV-40 | alias wbtemp guard, round, sticky 1608c2ecf20Sopenharmony_ci .set guard_bit,1 | guard bit is bit number 1 1618c2ecf20Sopenharmony_ci .set round_bit,0 | round bit is bit number 0 1628c2ecf20Sopenharmony_ci .set stag_mask,0xE0 | upper 3 bits are source tag type 1638c2ecf20Sopenharmony_ci .set denorm_bit,7 | bit determines if denorm or unnorm 1648c2ecf20Sopenharmony_ci .set etemp15_bit,4 | etemp exponent bit #15 1658c2ecf20Sopenharmony_ci .set wbtemp66_bit,2 | wbtemp mantissa bit #66 1668c2ecf20Sopenharmony_ci .set wbtemp1_bit,1 | wbtemp mantissa bit #1 1678c2ecf20Sopenharmony_ci .set wbtemp0_bit,0 | wbtemp mantissa bit #0 1688c2ecf20Sopenharmony_ci| 1698c2ecf20Sopenharmony_ci .set STICKY,LV-39 | holds sticky bit 1708c2ecf20Sopenharmony_ci .set sticky_bit,7 1718c2ecf20Sopenharmony_ci| 1728c2ecf20Sopenharmony_ci .set CMDREG1B,LV-36 | cmd reg for E1 exceptions (2 bytes) 1738c2ecf20Sopenharmony_ci .set kfact_bit,12 | distinguishes static/dynamic k-factor 1748c2ecf20Sopenharmony_ci| ;on packed move outs. NOTE: this 1758c2ecf20Sopenharmony_ci| ;equate only works when CMDREG1B is in 1768c2ecf20Sopenharmony_ci| ;a register. 1778c2ecf20Sopenharmony_ci| 1788c2ecf20Sopenharmony_ci .set CMDWORD,LV-35 | command word in cmd1b 1798c2ecf20Sopenharmony_ci .set direction_bit,5 | bit 0 in opclass 1808c2ecf20Sopenharmony_ci .set size_bit2,12 | bit 2 in size field 1818c2ecf20Sopenharmony_ci| 1828c2ecf20Sopenharmony_ci .set DTAG,LV-32 | dest tag (1 byte) 1838c2ecf20Sopenharmony_ci .set dtag_mask,0xE0 | upper 3 bits are dest type tag 1848c2ecf20Sopenharmony_ci .set fptemp15_bit,4 | fptemp exponent bit #15 1858c2ecf20Sopenharmony_ci| 1868c2ecf20Sopenharmony_ci .set WB_BYTE,LV-31 | holds WBTE15 bit (1 byte) 1878c2ecf20Sopenharmony_ci .set wbtemp15_bit,4 | wbtemp exponent bit #15 1888c2ecf20Sopenharmony_ci| 1898c2ecf20Sopenharmony_ci .set E_BYTE,LV-28 | holds E1 and E3 bits (1 byte) 1908c2ecf20Sopenharmony_ci .set E1,2 | which bit is E1 flag 1918c2ecf20Sopenharmony_ci .set E3,1 | which bit is E3 flag 1928c2ecf20Sopenharmony_ci .set SFLAG,0 | which bit is S flag 1938c2ecf20Sopenharmony_ci| 1948c2ecf20Sopenharmony_ci .set T_BYTE,LV-27 | holds T and U bits (1 byte) 1958c2ecf20Sopenharmony_ci .set XFLAG,7 | which bit is X flag 1968c2ecf20Sopenharmony_ci .set UFLAG,5 | which bit is U flag 1978c2ecf20Sopenharmony_ci .set TFLAG,4 | which bit is T flag 1988c2ecf20Sopenharmony_ci| 1998c2ecf20Sopenharmony_ci .set FPTEMP,LV-24 | fptemp (12 bytes) 2008c2ecf20Sopenharmony_ci .set FPTEMP_EX,FPTEMP | fptemp sign and exponent (2 bytes) 2018c2ecf20Sopenharmony_ci .set FPTEMP_HI,FPTEMP+4 | fptemp mantissa [63:32] (4 bytes) 2028c2ecf20Sopenharmony_ci .set FPTEMP_LO,FPTEMP+8 | fptemp mantissa [31:00] (4 bytes) 2038c2ecf20Sopenharmony_ci| 2048c2ecf20Sopenharmony_ci .set FPTEMP_SGN,FPTEMP+2 | used to store sign 2058c2ecf20Sopenharmony_ci| 2068c2ecf20Sopenharmony_ci .set ETEMP,LV-12 | etemp (12 bytes) 2078c2ecf20Sopenharmony_ci .set ETEMP_EX,ETEMP | etemp sign and exponent (2 bytes) 2088c2ecf20Sopenharmony_ci .set ETEMP_HI,ETEMP+4 | etemp mantissa [63:32] (4 bytes) 2098c2ecf20Sopenharmony_ci .set ETEMP_LO,ETEMP+8 | etemp mantissa [31:00] (4 bytes) 2108c2ecf20Sopenharmony_ci| 2118c2ecf20Sopenharmony_ci .set ETEMP_SGN,ETEMP+2 | used to store sign 2128c2ecf20Sopenharmony_ci| 2138c2ecf20Sopenharmony_ci .set EXC_SR,4 | exception frame status register 2148c2ecf20Sopenharmony_ci .set EXC_PC,6 | exception frame program counter 2158c2ecf20Sopenharmony_ci .set EXC_VEC,10 | exception frame vector (format+vector#) 2168c2ecf20Sopenharmony_ci .set EXC_EA,12 | exception frame effective address 2178c2ecf20Sopenharmony_ci| 2188c2ecf20Sopenharmony_ci|-------------------------------------------------------------------------- 2198c2ecf20Sopenharmony_ci| 2208c2ecf20Sopenharmony_ci| FPSR/FPCR bits 2218c2ecf20Sopenharmony_ci| 2228c2ecf20Sopenharmony_ci .set neg_bit,3 | negative result 2238c2ecf20Sopenharmony_ci .set z_bit,2 | zero result 2248c2ecf20Sopenharmony_ci .set inf_bit,1 | infinity result 2258c2ecf20Sopenharmony_ci .set nan_bit,0 | not-a-number result 2268c2ecf20Sopenharmony_ci| 2278c2ecf20Sopenharmony_ci .set q_sn_bit,7 | sign bit of quotient byte 2288c2ecf20Sopenharmony_ci| 2298c2ecf20Sopenharmony_ci .set bsun_bit,7 | branch on unordered 2308c2ecf20Sopenharmony_ci .set snan_bit,6 | signalling nan 2318c2ecf20Sopenharmony_ci .set operr_bit,5 | operand error 2328c2ecf20Sopenharmony_ci .set ovfl_bit,4 | overflow 2338c2ecf20Sopenharmony_ci .set unfl_bit,3 | underflow 2348c2ecf20Sopenharmony_ci .set dz_bit,2 | divide by zero 2358c2ecf20Sopenharmony_ci .set inex2_bit,1 | inexact result 2 2368c2ecf20Sopenharmony_ci .set inex1_bit,0 | inexact result 1 2378c2ecf20Sopenharmony_ci| 2388c2ecf20Sopenharmony_ci .set aiop_bit,7 | accrued illegal operation 2398c2ecf20Sopenharmony_ci .set aovfl_bit,6 | accrued overflow 2408c2ecf20Sopenharmony_ci .set aunfl_bit,5 | accrued underflow 2418c2ecf20Sopenharmony_ci .set adz_bit,4 | accrued divide by zero 2428c2ecf20Sopenharmony_ci .set ainex_bit,3 | accrued inexact 2438c2ecf20Sopenharmony_ci| 2448c2ecf20Sopenharmony_ci| FPSR individual bit masks 2458c2ecf20Sopenharmony_ci| 2468c2ecf20Sopenharmony_ci .set neg_mask,0x08000000 2478c2ecf20Sopenharmony_ci .set z_mask,0x04000000 2488c2ecf20Sopenharmony_ci .set inf_mask,0x02000000 2498c2ecf20Sopenharmony_ci .set nan_mask,0x01000000 2508c2ecf20Sopenharmony_ci| 2518c2ecf20Sopenharmony_ci .set bsun_mask,0x00008000 | 2528c2ecf20Sopenharmony_ci .set snan_mask,0x00004000 2538c2ecf20Sopenharmony_ci .set operr_mask,0x00002000 2548c2ecf20Sopenharmony_ci .set ovfl_mask,0x00001000 2558c2ecf20Sopenharmony_ci .set unfl_mask,0x00000800 2568c2ecf20Sopenharmony_ci .set dz_mask,0x00000400 2578c2ecf20Sopenharmony_ci .set inex2_mask,0x00000200 2588c2ecf20Sopenharmony_ci .set inex1_mask,0x00000100 2598c2ecf20Sopenharmony_ci| 2608c2ecf20Sopenharmony_ci .set aiop_mask,0x00000080 | accrued illegal operation 2618c2ecf20Sopenharmony_ci .set aovfl_mask,0x00000040 | accrued overflow 2628c2ecf20Sopenharmony_ci .set aunfl_mask,0x00000020 | accrued underflow 2638c2ecf20Sopenharmony_ci .set adz_mask,0x00000010 | accrued divide by zero 2648c2ecf20Sopenharmony_ci .set ainex_mask,0x00000008 | accrued inexact 2658c2ecf20Sopenharmony_ci| 2668c2ecf20Sopenharmony_ci| FPSR combinations used in the FPSP 2678c2ecf20Sopenharmony_ci| 2688c2ecf20Sopenharmony_ci .set dzinf_mask,inf_mask+dz_mask+adz_mask 2698c2ecf20Sopenharmony_ci .set opnan_mask,nan_mask+operr_mask+aiop_mask 2708c2ecf20Sopenharmony_ci .set nzi_mask,0x01ffffff | clears N, Z, and I 2718c2ecf20Sopenharmony_ci .set unfinx_mask,unfl_mask+inex2_mask+aunfl_mask+ainex_mask 2728c2ecf20Sopenharmony_ci .set unf2inx_mask,unfl_mask+inex2_mask+ainex_mask 2738c2ecf20Sopenharmony_ci .set ovfinx_mask,ovfl_mask+inex2_mask+aovfl_mask+ainex_mask 2748c2ecf20Sopenharmony_ci .set inx1a_mask,inex1_mask+ainex_mask 2758c2ecf20Sopenharmony_ci .set inx2a_mask,inex2_mask+ainex_mask 2768c2ecf20Sopenharmony_ci .set snaniop_mask,nan_mask+snan_mask+aiop_mask 2778c2ecf20Sopenharmony_ci .set naniop_mask,nan_mask+aiop_mask 2788c2ecf20Sopenharmony_ci .set neginf_mask,neg_mask+inf_mask 2798c2ecf20Sopenharmony_ci .set infaiop_mask,inf_mask+aiop_mask 2808c2ecf20Sopenharmony_ci .set negz_mask,neg_mask+z_mask 2818c2ecf20Sopenharmony_ci .set opaop_mask,operr_mask+aiop_mask 2828c2ecf20Sopenharmony_ci .set unfl_inx_mask,unfl_mask+aunfl_mask+ainex_mask 2838c2ecf20Sopenharmony_ci .set ovfl_inx_mask,ovfl_mask+aovfl_mask+ainex_mask 2848c2ecf20Sopenharmony_ci| 2858c2ecf20Sopenharmony_ci|-------------------------------------------------------------------------- 2868c2ecf20Sopenharmony_ci| 2878c2ecf20Sopenharmony_ci| FPCR rounding modes 2888c2ecf20Sopenharmony_ci| 2898c2ecf20Sopenharmony_ci .set x_mode,0x00 | round to extended 2908c2ecf20Sopenharmony_ci .set s_mode,0x40 | round to single 2918c2ecf20Sopenharmony_ci .set d_mode,0x80 | round to double 2928c2ecf20Sopenharmony_ci| 2938c2ecf20Sopenharmony_ci .set rn_mode,0x00 | round nearest 2948c2ecf20Sopenharmony_ci .set rz_mode,0x10 | round to zero 2958c2ecf20Sopenharmony_ci .set rm_mode,0x20 | round to minus infinity 2968c2ecf20Sopenharmony_ci .set rp_mode,0x30 | round to plus infinity 2978c2ecf20Sopenharmony_ci| 2988c2ecf20Sopenharmony_ci|-------------------------------------------------------------------------- 2998c2ecf20Sopenharmony_ci| 3008c2ecf20Sopenharmony_ci| Miscellaneous equates 3018c2ecf20Sopenharmony_ci| 3028c2ecf20Sopenharmony_ci .set signan_bit,6 | signalling nan bit in mantissa 3038c2ecf20Sopenharmony_ci .set sign_bit,7 3048c2ecf20Sopenharmony_ci| 3058c2ecf20Sopenharmony_ci .set rnd_stky_bit,29 | round/sticky bit of mantissa 3068c2ecf20Sopenharmony_ci| this can only be used if in a data register 3078c2ecf20Sopenharmony_ci .set sx_mask,0x01800000 | set s and x bits in word $48 3088c2ecf20Sopenharmony_ci| 3098c2ecf20Sopenharmony_ci .set LOCAL_EX,0 3108c2ecf20Sopenharmony_ci .set LOCAL_SGN,2 3118c2ecf20Sopenharmony_ci .set LOCAL_HI,4 3128c2ecf20Sopenharmony_ci .set LOCAL_LO,8 3138c2ecf20Sopenharmony_ci .set LOCAL_GRS,12 | valid ONLY for FP_SCR1, FP_SCR2 3148c2ecf20Sopenharmony_ci| 3158c2ecf20Sopenharmony_ci| 3168c2ecf20Sopenharmony_ci .set norm_tag,0x00 | tag bits in {7:5} position 3178c2ecf20Sopenharmony_ci .set zero_tag,0x20 3188c2ecf20Sopenharmony_ci .set inf_tag,0x40 3198c2ecf20Sopenharmony_ci .set nan_tag,0x60 3208c2ecf20Sopenharmony_ci .set dnrm_tag,0x80 3218c2ecf20Sopenharmony_ci| 3228c2ecf20Sopenharmony_ci| fsave sizes and formats 3238c2ecf20Sopenharmony_ci| 3248c2ecf20Sopenharmony_ci .set VER_4,0x40 | fpsp compatible version numbers 3258c2ecf20Sopenharmony_ci| are in the $40s {$40-$4f} 3268c2ecf20Sopenharmony_ci .set VER_40,0x40 | original version number 3278c2ecf20Sopenharmony_ci .set VER_41,0x41 | revision version number 3288c2ecf20Sopenharmony_ci| 3298c2ecf20Sopenharmony_ci .set BUSY_SIZE,100 | size of busy frame 3308c2ecf20Sopenharmony_ci .set BUSY_FRAME,LV-BUSY_SIZE | start of busy frame 3318c2ecf20Sopenharmony_ci| 3328c2ecf20Sopenharmony_ci .set UNIMP_40_SIZE,44 | size of orig unimp frame 3338c2ecf20Sopenharmony_ci .set UNIMP_41_SIZE,52 | size of rev unimp frame 3348c2ecf20Sopenharmony_ci| 3358c2ecf20Sopenharmony_ci .set IDLE_SIZE,4 | size of idle frame 3368c2ecf20Sopenharmony_ci .set IDLE_FRAME,LV-IDLE_SIZE | start of idle frame 3378c2ecf20Sopenharmony_ci| 3388c2ecf20Sopenharmony_ci| exception vectors 3398c2ecf20Sopenharmony_ci| 3408c2ecf20Sopenharmony_ci .set TRACE_VEC,0x2024 | trace trap 3418c2ecf20Sopenharmony_ci .set FLINE_VEC,0x002C | real F-line 3428c2ecf20Sopenharmony_ci .set UNIMP_VEC,0x202C | unimplemented 3438c2ecf20Sopenharmony_ci .set INEX_VEC,0x00C4 3448c2ecf20Sopenharmony_ci| 3458c2ecf20Sopenharmony_ci .set dbl_thresh,0x3C01 3468c2ecf20Sopenharmony_ci .set sgl_thresh,0x3F81 3478c2ecf20Sopenharmony_ci| 348