?? mathhardlib.c
字號:
/* * Load exception vectors with addresses of routines from * Motorola 68060 floating point exception handlers. * * The 060 floating point emulation software needs to filter the * following vectors, itself. If an error is caught that must be * passed back to the OS, then that software package will do it * by re-establishing the exception frame and jumping directly * into "excStub". */ fpsp060COTblInit (); intVecSet ((FUNCPTR *)IV_LINE_1111_EMULATOR, (FUNCPTR) (FPSP_060_FLINE)); intVecSet ((FUNCPTR *)IV_UNIMP_DATA_TYPE, (FUNCPTR) (FPSP_060_UNSUPP)); intVecSet ((FUNCPTR *)IV_UNIMP_EFFECTIVE_ADDRESS,(FUNCPTR) (FPSP_060_EFFADD)); /* * underflow and overflow exceptions are non maskable: therefore we need * exception handlers to be installed by default to trap these exception. */ intVecSet ((FUNCPTR *)IV_UNDERFLOW, (FUNCPTR) (FPSP_060_UNFL)); intVecSet ((FUNCPTR *)IV_OVERFLOW, (FUNCPTR) (FPSP_060_OVFL));#if 0 /* * */ intVecSet ((FUNCPTR *)IV_FPCP_INEXACT_RESULT, (FUNCPTR) (FPSP_060_INEX)); intVecSet ((FUNCPTR *)IV_DIVIDE_BY_ZERO, (FUNCPTR) (FPSP_060_DZ)); intVecSet ((FUNCPTR *)IV_OPERAND_ERROR, (FUNCPTR) (FPSP_060_OPERR)); intVecSet ((FUNCPTR *)IV_SIGNALING_NAN, (FUNCPTR) (FPSP_060_SNAN));#endif#endif /* (CPU==MC68060) */#if ((CPU==MC68040) || (CPU==MC68060)) gccUss040Init (); /* harmless call to drag in gccUss040Lib.o */#endif /* (CPU==MC68040 || CPU==MC68060) */ /* Don't do more unless there really is hardware support */ fppInit(); /* attempt to init hardware support */ if (fppProbe() != OK) /* is there a coprocessor? */ return; /* exit if no */ /* Load hardware routine addresses into global variables * defined in mathALib.s. */ /* Double-precision routines */ mathAcosFunc = mathHardAcos; mathAsinFunc = mathHardAsin; mathAtanFunc = mathHardAtan; mathAtan2Func = mathHardAtan2; mathCeilFunc = mathHardCeil; mathCosFunc = mathHardCos; mathCoshFunc = mathHardCosh; mathExpFunc = mathHardExp; mathFabsFunc = mathHardFabs; mathFmodFunc = mathHardFmod; mathFloorFunc = mathHardFloor; mathInfinityFunc = mathHardInfinity; mathIrintFunc = mathHardIrint; mathIroundFunc = mathHardIround; mathLogFunc = mathHardLog; mathLog2Func = mathHardLog2; mathLog10Func = mathHardLog10; mathPowFunc = mathHardPow; mathRoundFunc = mathHardRound; mathSinFunc = mathHardSin; mathSincosFunc = mathHardSincos; mathSinhFunc = mathHardSinh; mathSqrtFunc = mathHardSqrt; mathTanFunc = mathHardTan; mathTanhFunc = mathHardTanh; mathTruncFunc = mathHardTrunc; /* Single-precision functions (unsupported) */ if (mathAcosfFunc == (FLTFUNCPTR) mathErrNoInit) mathAcosfFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathAsinfFunc == (FLTFUNCPTR) mathErrNoInit) mathAsinfFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathAtanfFunc == (FLTFUNCPTR) mathErrNoInit) mathAtanfFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathAtan2fFunc == (FLTFUNCPTR) mathErrNoInit) mathAtan2fFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathCbrtfFunc == (FLTFUNCPTR) mathErrNoInit) mathCbrtfFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathCeilfFunc == (FLTFUNCPTR) mathErrNoInit) mathCeilfFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathCosfFunc == (FLTFUNCPTR) mathErrNoInit) mathCosfFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathCoshfFunc == (FLTFUNCPTR) mathErrNoInit) mathCoshfFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathExpfFunc == (FLTFUNCPTR) mathErrNoInit) mathExpfFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathFabsfFunc == (FLTFUNCPTR) mathErrNoInit) mathFabsfFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathFmodfFunc == (FLTFUNCPTR) mathErrNoInit) mathFmodfFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathFloorfFunc == (FLTFUNCPTR) mathErrNoInit) mathFloorfFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathHypotfFunc == (FLTFUNCPTR) mathErrNoInit) mathHypotfFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathInfinityfFunc == (FLTFUNCPTR) mathErrNoInit) mathInfinityfFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathIrintfFunc == (FUNCPTR) mathErrNoInit) mathIrintfFunc = (FUNCPTR) mathHardNoSingle; if (mathIroundfFunc == (FUNCPTR) mathErrNoInit) mathIroundfFunc = (FUNCPTR) mathHardNoSingle; if (mathLogfFunc == (FLTFUNCPTR) mathErrNoInit) mathLogfFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathLog2fFunc == (FLTFUNCPTR) mathErrNoInit) mathLog2fFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathLog10fFunc == (FLTFUNCPTR) mathErrNoInit) mathLog10fFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathPowfFunc == (FLTFUNCPTR) mathErrNoInit) mathPowfFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathRoundfFunc == (FLTFUNCPTR) mathErrNoInit) mathRoundfFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathSinfFunc == (FLTFUNCPTR) mathErrNoInit) mathSinfFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathSincosfFunc == mathErrNoInit) mathSincosfFunc = mathHardNoSingle; if (mathSinhfFunc == (FLTFUNCPTR) mathErrNoInit) mathSinhfFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathSqrtfFunc == (FLTFUNCPTR) mathErrNoInit) mathSqrtfFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathTanfFunc == (FLTFUNCPTR) mathErrNoInit) mathTanfFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathTanhfFunc == (FLTFUNCPTR) mathErrNoInit) mathTanhfFunc = (FLTFUNCPTR) mathHardNoSingle; if (mathTruncfFunc == (FLTFUNCPTR) mathErrNoInit) mathTruncfFunc = (FLTFUNCPTR) mathHardNoSingle; /* Miscellaneous unsupported functions */ if (mathCbrtFunc == (DBLFUNCPTR) mathErrNoInit) mathCbrtFunc = (DBLFUNCPTR) mathHardCbrt; if (mathHypotFunc == (DBLFUNCPTR) mathErrNoInit) mathHypotFunc = (DBLFUNCPTR) mathHardHypot; }/******************************************************************************** mathHardNoSingle - log error message for unsupported single-precision fp** This routine will generate a log message to the VxWorks console if* an attempt is made to use single-precision math functions with the* hardware floating point coprocessor (not supported).**/LOCAL void mathHardNoSingle () { if (_func_logMsg != NULL) (* _func_logMsg) ("ERROR - single-precision flt. point not supported\n", 0,0,0,0,0,0); }/******************************************************************************** mathHardCbrt - log error message for unsupported cube root function** This routine will generate a log message to the VxWorks console if* an attempt is made to use the cbrt() cube root function with the* hardware floating point coprocessor (not supported).**/LOCAL void mathHardCbrt () { if (_func_logMsg != NULL) (* _func_logMsg) ("ERROR - floating point cube root not supported\n", 0,0,0,0,0,0); }/******************************************************************************** mathHardHypot - log error message for unsupported hypot function** This routine will generate a log message to the VxWorks console if* an attempt is made to use the hypot() Euclidean distance function with* the hardware floating point coprocessor (not supported).**/LOCAL void mathHardHypot () { if (_func_logMsg != NULL) (* _func_logMsg) ("ERROR - h/w floating point hypot not supported\n", 0,0,0,0,0,0); }
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -