PSPSDK 2024-10-31
|
#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 |
#define PSP_MATH_LN2 0.69314718055994530942 |
#define PSP_MATH_LOG2E 1.4426950408889634074 |
#define PSP_MATH_PI 3.14159265358979323846 |
#define PSP_MATH_SQRT2 1.41421356237309504880 |
#define PSP_MATH_TWOPI (PSP_MATH_PI * 2.0) |
ArcCos.
References pspFpuAtan(), and x.
ArcSin.
References pspFpuAtan(), and x.
Clear the cause bits.
clear | - Bitmask of the bits to clear, one or more of PspFpuExceptions |
References PSP_FPU_CAUSE_POS, pspFpuGetFCR31(), pspFpuSetFCR31(), and x.
Clear the condition bits.
clear | - Bitmask of the bits to clear |
References PSP_FPU_CC0_POS, PSP_FPU_CC17_POS, pspFpuGetFCR31(), pspFpuSetFCR31(), and x.
Clear the flags bits.
clear | - Bitmask of the bits to clear, one or more of PspFpuExceptions |
References PSP_FPU_FLAGS_POS, pspFpuGetFCR31(), pspFpuSetFCR31(), and x.
Cosine.
References COS_SIN_DIV, PSP_MATH_PI, x, and y.
Exponential.
References f, i, PSP_MATH_LN2, PSP_MATH_LOG2E, x, and z.
Get the cause bits (only useful if you installed your own exception handler)
References PSP_FPU_CAUSE_MASK, PSP_FPU_CAUSE_POS, pspFpuGetFCR31(), and x.
Get the condition flags (8 bits)
References PSP_FPU_CC0_MASK, PSP_FPU_CC0_POS, PSP_FPU_CC17_MASK, PSP_FPU_CC17_POS, pspFpuGetFCR31(), and x.
Get the exception enable flags.
References PSP_FPU_ENABLE_MASK, PSP_FPU_ENABLE_POS, pspFpuGetFCR31(), and x.
Get the current value of the control/status register.
References x.
Referenced by pspFpuClearCause(), pspFpuClearCondbits(), pspFpuClearFlags(), pspFpuGetCause(), pspFpuGetCondbits(), pspFpuGetEnable(), pspFpuGetFlags(), pspFpuGetFS(), pspFpuGetRoundmode(), pspFpuSetEnable(), pspFpuSetFS(), and pspFpuSetRoundmode().
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, pspFpuGetFCR31(), and x.
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, pspFpuGetFCR31(), and x.
enum PspFpuRoundMode pspFpuGetRoundmode | ( | void | ) |
Get the current round mode.
References PSP_FPU_RM_MASK, and pspFpuGetFCR31().
References PSP_MATH_TWOPI, and x.
Set the enable flags bits.
enable | - Bitmask of exceptions to enable, zero or more of PspFpuExceptions |
References PSP_FPU_ENABLE_POS, pspFpuGetFCR31(), pspFpuSetFCR31(), and x.
Set the current value of the control/status register.
var | - The value to set. |
References x.
Referenced by pspFpuClearCause(), pspFpuClearCondbits(), pspFpuClearFlags(), pspFpuSetEnable(), pspFpuSetFS(), and pspFpuSetRoundmode().
Set the FS bit.
fs | - 0 or 1 to unset or set fs |
References PSP_FPU_FS_POS, pspFpuGetFCR31(), pspFpuSetFCR31(), and x.
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(), pspFpuSetFCR31(), and x.
Sine.
References COS_SIN_DIV, PSP_MATH_PI, x, and y.