|
PSPSDK 2025-10-12
|
#include "pspfpu.h"
Macros | |
| #define | PSP_MATH_PI 3.14159265358979323846 |
| #define | PSP_MATH_TWOPI (PSP_MATH_PI * 2.0) |
| #define | PSP_MATH_SQRT2 1.41421356237309504880 |
| #define | PSP_MATH_LN2 0.69314718055994530942 |
| #define | PSP_MATH_LOG2E 1.4426950408889634074 |
| #define | COS_SIN_DIV 0.208 |
Functions | |
| uint32_t | pspFpuGetFCR31 (void) |
| Get the current value of the control/status register. | |
| void | pspFpuSetFCR31 (uint32_t var) |
| Set the current value of the control/status register. | |
| void | pspFpuSetRoundmode (enum PspFpuRoundMode mode) |
| Set the current round mode. | |
| enum PspFpuRoundMode | pspFpuGetRoundmode (void) |
| Get the current round mode. | |
| uint32_t | pspFpuGetFlags (void) |
| Get the exception flags (set when an exception occurs but the actual exception bit is not enabled) | |
| void | pspFpuClearFlags (uint32_t clear) |
| Clear the flags bits. | |
| uint32_t | pspFpuGetEnable (void) |
| Get the exception enable flags. | |
| void | pspFpuSetEnable (uint32_t enable) |
| Set the enable flags bits. | |
| uint32_t | pspFpuGetCause (void) |
| Get the cause bits (only useful if you installed your own exception handler) | |
| void | pspFpuClearCause (uint32_t clear) |
| Clear the cause bits. | |
| uint32_t | pspFpuGetFS (void) |
| Get the current value of the FS bit (if FS is 0 then an exception occurs with denormalized values, if 1 then they are rewritten as 0. | |
| void | pspFpuSetFS (uint32_t fs) |
| Set the FS bit. | |
| uint32_t | pspFpuGetCondbits (void) |
| Get the condition flags (8 bits) | |
| void | pspFpuClearCondbits (uint32_t clear) |
| Clear the condition bits. | |
| float | pspFpuAbs (float fs) |
| returns absolute value | |
| int | pspFpuCeil (float fs) |
| Round up. | |
| int | pspFpuFloor (float fs) |
| Truncate. | |
| float | pspFpuMax (float fs1, float fs2) |
| select maximum value | |
| float | pspFpuMin (float fs1, float fs2) |
| select minimum value | |
| float | pspFpuNeg (float fs) |
| Sign reversal. | |
| int | pspFpuRound (float fs) |
| Round to nearest. | |
| float | pspFpuRsqrt (float fs) |
| float | pspFpuSqrt (float fs) |
| Square root. | |
| int | pspFpuTrunc (float fs) |
| Round towards zero. | |
| float | pspFpuFmod (float fs, float fd) |
| float | pspFpuFrac (float fs) |
| float | pspFpuReinterpretFloat (uint32_t ui) |
| uint32_t | pspFpuReinterpretUint (float fs) |
| int | pspFpuIsEqual (float fs1, float fs2) |
| float | pspFpuSignFloat (float fs) |
| int | pspFpuSignInt (float fs) |
| float | pspFpuPositiveZero (void) |
| Positive zero. | |
| float | pspFpuNegativeZero (void) |
| Negative zero. | |
| int | pspFpuIsZero (float f) |
| Test for zero value. | |
| int | pspFpuIsPositiveZero (float f) |
| Test for positive zero. | |
| int | pspFpuIsNegativeZero (float f) |
| Test for negative zero. | |
| int | pspFpuIsDenormal (float f) |
| Test for denormalized number. | |
| int | pspFpuIsZeroOrDenormal (float f) |
| Test for zero or denormalized number. | |
| float | pspFpuPositiveInf (void) |
| Positive infinity. | |
| float | pspFpuNegativeInf (void) |
| Negative infinity. | |
| int | pspFpuIsInf (float f) |
| Test for infinity. | |
| float | pspFpuPositiveNaN (void) |
| NaN (positive SNaN) | |
| float | pspFpuNegativeNaN (void) |
| NaN (negative SNaN) | |
| float | pspFpuPositiveQNaN (void) |
| Quiet NaN (positive QNaN) | |
| float | pspFpuNegativeQNaN (void) |
| Quiet NaN (positive QNaN) | |
| float | pspFpuPositiveSNaN (unsigned int uiSignal) |
| Signaling NaN (positive SNaN) | |
| float | pspFpuNegativeSNaN (unsigned int uiSignal) |
| Signaling NaN (negative SNaN) | |
| int | pspFpuIsNaN (float f) |
| Test for NaN. | |
| int | pspFpuIsInfOrNaN (float f) |
| Test for infinity or NaN. | |
| float | pspFpuNormalizePhase (float fs) |
| float | pspFpuLog (float x) |
| Natural Logarithm. | |
| float | pspFpuExp (float x) |
| Exponential. | |
| float | pspFpuSin (float x) |
| Sine. | |
| float | pspFpuCos (float x) |
| Cosine. | |
| float | pspFpuAtan (float x) |
| Arc tangent. | |
| float | pspFpuAsin (float x) |
| ArcSin. | |
| float | pspFpuAcos (float x) |
| ArcCos. | |
| #define COS_SIN_DIV 0.208 |
Referenced by pspFpuCos(), and pspFpuSin().
| #define PSP_MATH_LN2 0.69314718055994530942 |
Referenced by pspFpuExp().
| #define PSP_MATH_LOG2E 1.4426950408889634074 |
Referenced by pspFpuExp().
| #define PSP_MATH_PI 3.14159265358979323846 |
Referenced by pspFpuAtan(), pspFpuCos(), and pspFpuSin().
| #define PSP_MATH_SQRT2 1.41421356237309504880 |
| #define PSP_MATH_TWOPI (PSP_MATH_PI * 2.0) |
Referenced by pspFpuNormalizePhase().
| float pspFpuAbs | ( | float | fs | ) |
returns absolute value
| float pspFpuAcos | ( | float | x | ) |
ArcCos.
References pspFpuAtan().
| float pspFpuAsin | ( | float | x | ) |
ArcSin.
References pspFpuAtan().
| float pspFpuAtan | ( | float | x | ) |
| int pspFpuCeil | ( | float | fs | ) |
Round up.
| void pspFpuClearCause | ( | uint32_t | clear | ) |
Clear the cause bits.
| clear | - Bitmask of the bits to clear, one or more of PspFpuExceptions |
References PSP_FPU_CAUSE_POS, pspFpuGetFCR31(), and pspFpuSetFCR31().
| void pspFpuClearCondbits | ( | uint32_t | clear | ) |
Clear the condition bits.
| clear | - Bitmask of the bits to clear |
References PSP_FPU_CC0_POS, PSP_FPU_CC17_POS, pspFpuGetFCR31(), and pspFpuSetFCR31().
| void pspFpuClearFlags | ( | uint32_t | clear | ) |
Clear the flags bits.
| clear | - Bitmask of the bits to clear, one or more of PspFpuExceptions |
References PSP_FPU_FLAGS_POS, pspFpuGetFCR31(), and pspFpuSetFCR31().
| float pspFpuCos | ( | float | x | ) |
Cosine.
References COS_SIN_DIV, and PSP_MATH_PI.
| float pspFpuExp | ( | float | x | ) |
Exponential.
References PSP_MATH_LN2, and PSP_MATH_LOG2E.
| int pspFpuFloor | ( | float | fs | ) |
Truncate.
| float pspFpuFmod | ( | float | fs, |
| float | fd ) |
| float pspFpuFrac | ( | float | fs | ) |
| uint32_t pspFpuGetCause | ( | void | ) |
Get the cause bits (only useful if you installed your own exception handler)
References PSP_FPU_CAUSE_MASK, PSP_FPU_CAUSE_POS, and pspFpuGetFCR31().
| uint32_t pspFpuGetCondbits | ( | void | ) |
Get the condition flags (8 bits)
References PSP_FPU_CC0_MASK, PSP_FPU_CC0_POS, PSP_FPU_CC17_MASK, PSP_FPU_CC17_POS, and pspFpuGetFCR31().
| uint32_t pspFpuGetEnable | ( | void | ) |
Get the exception enable flags.
References PSP_FPU_ENABLE_MASK, PSP_FPU_ENABLE_POS, and pspFpuGetFCR31().
| uint32_t pspFpuGetFCR31 | ( | void | ) |
Get the current value of the control/status register.
Referenced by pspFpuClearCause(), pspFpuClearCondbits(), pspFpuClearFlags(), pspFpuGetCause(), pspFpuGetCondbits(), pspFpuGetEnable(), pspFpuGetFlags(), pspFpuGetFS(), pspFpuGetRoundmode(), pspFpuSetEnable(), pspFpuSetFS(), and pspFpuSetRoundmode().
| uint32_t pspFpuGetFlags | ( | void | ) |
Get the exception flags (set when an exception occurs but the actual exception bit is not enabled)
References PSP_FPU_FLAGS_MASK, PSP_FPU_FLAGS_POS, and pspFpuGetFCR31().
| uint32_t pspFpuGetFS | ( | void | ) |
Get the current value of the FS bit (if FS is 0 then an exception occurs with denormalized values, if 1 then they are rewritten as 0.
References PSP_FPU_FS_MASK, PSP_FPU_FS_POS, and pspFpuGetFCR31().
| enum PspFpuRoundMode pspFpuGetRoundmode | ( | void | ) |
Get the current round mode.
References PSP_FPU_RM_MASK, and pspFpuGetFCR31().
| int pspFpuIsDenormal | ( | float | f | ) |
Test for denormalized number.
| int pspFpuIsEqual | ( | float | fs1, |
| float | fs2 ) |
| int pspFpuIsInf | ( | float | f | ) |
Test for infinity.
| int pspFpuIsInfOrNaN | ( | float | f | ) |
Test for infinity or NaN.
| int pspFpuIsNaN | ( | float | f | ) |
Test for NaN.
| int pspFpuIsNegativeZero | ( | float | f | ) |
Test for negative zero.
| int pspFpuIsPositiveZero | ( | float | f | ) |
Test for positive zero.
| int pspFpuIsZero | ( | float | f | ) |
Test for zero value.
| int pspFpuIsZeroOrDenormal | ( | float | f | ) |
Test for zero or denormalized number.
| float pspFpuLog | ( | float | x | ) |
Natural Logarithm.
| float pspFpuMax | ( | float | fs1, |
| float | fs2 ) |
select maximum value
| float pspFpuMin | ( | float | fs1, |
| float | fs2 ) |
select minimum value
| float pspFpuNeg | ( | float | fs | ) |
Sign reversal.
| float pspFpuNegativeInf | ( | void | ) |
Negative infinity.
| float pspFpuNegativeNaN | ( | void | ) |
NaN (negative SNaN)
| float pspFpuNegativeQNaN | ( | void | ) |
Quiet NaN (positive QNaN)
| float pspFpuNegativeSNaN | ( | unsigned int | uiSignal | ) |
Signaling NaN (negative SNaN)
| float pspFpuNegativeZero | ( | void | ) |
Negative zero.
| float pspFpuNormalizePhase | ( | float | fs | ) |
References PSP_MATH_TWOPI.
| float pspFpuPositiveInf | ( | void | ) |
Positive infinity.
| float pspFpuPositiveNaN | ( | void | ) |
NaN (positive SNaN)
| float pspFpuPositiveQNaN | ( | void | ) |
Quiet NaN (positive QNaN)
| float pspFpuPositiveSNaN | ( | unsigned int | uiSignal | ) |
Signaling NaN (positive SNaN)
| float pspFpuPositiveZero | ( | void | ) |
Positive zero.
| float pspFpuReinterpretFloat | ( | uint32_t | ui | ) |
| uint32_t pspFpuReinterpretUint | ( | float | fs | ) |
| int pspFpuRound | ( | float | fs | ) |
Round to nearest.
| float pspFpuRsqrt | ( | float | fs | ) |
| void pspFpuSetEnable | ( | uint32_t | enable | ) |
Set the enable flags bits.
| enable | - Bitmask of exceptions to enable, zero or more of PspFpuExceptions |
References PSP_FPU_ENABLE_POS, pspFpuGetFCR31(), and pspFpuSetFCR31().
| void pspFpuSetFCR31 | ( | uint32_t | var | ) |
Set the current value of the control/status register.
| var | - The value to set. |
Referenced by pspFpuClearCause(), pspFpuClearCondbits(), pspFpuClearFlags(), pspFpuSetEnable(), pspFpuSetFS(), and pspFpuSetRoundmode().
| void pspFpuSetFS | ( | uint32_t | fs | ) |
Set the FS bit.
| fs | - 0 or 1 to unset or set fs |
References PSP_FPU_FS_POS, pspFpuGetFCR31(), and pspFpuSetFCR31().
| void pspFpuSetRoundmode | ( | enum PspFpuRoundMode | mode | ) |
Set the current round mode.
| mode | - The rounding mode to set, one of PspFpuRoundMode |
References PSP_FPU_RM_MASK, pspFpuGetFCR31(), and pspFpuSetFCR31().
| float pspFpuSignFloat | ( | float | fs | ) |
| int pspFpuSignInt | ( | float | fs | ) |
| float pspFpuSin | ( | float | x | ) |
Sine.
References COS_SIN_DIV, and PSP_MATH_PI.
| float pspFpuSqrt | ( | float | fs | ) |
Square root.
| int pspFpuTrunc | ( | float | fs | ) |
Round towards zero.