SSBM Decomp
Loading...
Searching...
No Matches
math.c File Reference
#include "math.h"
#include <platform.h>

Data Structures

union  FloatU32

Macros

#define EXP_MASK   0x7F800000
#define EXP_ZERO   0x3F800000
#define MANT_MASK   0x007FFFFF
#define SIGN_BIT   0x80000000
#define F32_BIT_CAST(raw_x)
#define F32_UNBIASED_EXPONENT(raw_x)
#define F32_HIGH_MANTISSA_BITS(raw_x)
#define F32_LOW_MANTISSA_BITS(raw_x)
#define LN2   0.6931472f
#define SECTION_SDATA2

Functions

float logf (float x)

Variables

SECTION_SDATA2 u32 MSL_Math_804DE1B0 = 0xBF000030
SECTION_SDATA2 u32 MSL_Math_804DE1B4 = 0x3EAAAA36
SECTION_SDATA2 const FloatU32 __float_nan = { 0x7FFFFFFF }
SECTION_SDATA2 const FloatU32 __float_huge = { 0x7F800000 }
const float __ln_F []
 Math lookup tables - defined in math_data.c Keeping them in a separate compilation unit prevents the compiler from hoisting array base addresses, which is needed to match the original code.
const float __one_over_F []
 __one_over_F[n] = 1.0 / (1.0 + n/128) for n = 0..128
const float __sincos_on_quadrant []
const float __sincos_poly []

Macro Definition Documentation

◆ EXP_MASK

#define EXP_MASK   0x7F800000

◆ EXP_ZERO

#define EXP_ZERO   0x3F800000

◆ MANT_MASK

#define MANT_MASK   0x007FFFFF

◆ SIGN_BIT

#define SIGN_BIT   0x80000000

◆ F32_BIT_CAST

#define F32_BIT_CAST ( raw_x)
Value:
(*(float*) &raw_x)

◆ F32_UNBIASED_EXPONENT

#define F32_UNBIASED_EXPONENT ( raw_x)
Value:
(((raw_x & 0xFF800000) >> 23) - /*exponent bias*/ 127)

◆ F32_HIGH_MANTISSA_BITS

#define F32_HIGH_MANTISSA_BITS ( raw_x)
Value:
((raw_x >> 16) & 0x7F)

◆ F32_LOW_MANTISSA_BITS

#define F32_LOW_MANTISSA_BITS ( raw_x)
Value:
(raw_x & 0xFFFF)

◆ LN2

#define LN2   0.6931472f

◆ SECTION_SDATA2

#define SECTION_SDATA2

Function Documentation

◆ logf()

float logf ( float x)

Variable Documentation

◆ MSL_Math_804DE1B0

SECTION_SDATA2 u32 MSL_Math_804DE1B0 = 0xBF000030

◆ MSL_Math_804DE1B4

SECTION_SDATA2 u32 MSL_Math_804DE1B4 = 0x3EAAAA36

◆ __float_nan

SECTION_SDATA2 const FloatU32 __float_nan = { 0x7FFFFFFF }

◆ __float_huge

SECTION_SDATA2 const FloatU32 __float_huge = { 0x7F800000 }

◆ __ln_F

const float __ln_F[]
extern

Math lookup tables - defined in math_data.c Keeping them in a separate compilation unit prevents the compiler from hoisting array base addresses, which is needed to match the original code.

Math lookup tables - defined in math_data.c Keeping them in a separate compilation unit prevents the compiler from hoisting array base addresses, which is needed to match the original code.

These arrays are kept in a separate compilation unit so that functions like logf() generate separate address loads for each table access, rather than hoisting a shared base pointer. __ln_F[n] = ln(1.0 + n/128) for n = 0 .. 128

◆ __one_over_F

const float __one_over_F[]
extern

__one_over_F[n] = 1.0 / (1.0 + n/128) for n = 0..128

◆ __sincos_on_quadrant

const float __sincos_on_quadrant[]
extern

◆ __sincos_poly

const float __sincos_poly[]
extern