Inline functions for the DC's special math instructions.
More...
#include <sys/cdefs.h>
#include <arch/types.h>
Go to the source code of this file.
Macros |
#define | F_PI 3.1415926f |
Functions |
float | fipr (float x, float y, float z, float w, float a, float b, float c, float d) |
float | fipr_magnitude_sqr (float x, float y, float z, float w) |
| Floating point inner product w/self (square of vector magnitude)
|
float | fsin (float r) |
| Floating point sine.
|
float | fcos (float r) |
| Floating point cosine.
|
float | ftan (float r) |
| Floating point tangent.
|
float | fisin (int d) |
| Integer sine.
|
float | ficos (int d) |
| Integer cosine.
|
float | fitan (int d) |
| Integer tangent.
|
float | fsqrt (float f) |
| Floating point square root.
|
float | frsqrt (float f) |
Detailed Description
Inline functions for the DC's special math instructions.
- Author:
- Andrew Kieschnick
Macro Definition Documentation
PI constant (if you don't want full math.h)
Function Documentation
Floating point cosine.
- Parameters:
-
r | a floating point number between 0 and 2*PI |
- Returns:
- cos(r), where r is [0..2*PI]
Integer cosine.
- Parameters:
-
d | an integer between 0 and 65535 |
- Returns:
- cos(d), where d is [0..65535]
float fipr |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z, |
|
|
float |
w, |
|
|
float |
a, |
|
|
float |
b, |
|
|
float |
c, |
|
|
float |
d |
|
) |
| |
|
inline |
- Returns:
- v1 dot v2 (inner product)
float fipr_magnitude_sqr |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z, |
|
|
float |
w |
|
) |
| |
|
inline |
Floating point inner product w/self (square of vector magnitude)
- Returns:
- v1 dot v1 (square of magnitude)
Integer sine.
- Parameters:
-
d | an integer between 0 and 65535 |
- Returns:
- sin(d), where d is [0..65535]
Integer tangent.
- Parameters:
-
d | an integer between 0 and 65535 |
- Returns:
- tan(d), where d is [0..65535]
Floating point sine.
- Parameters:
-
r | a floating point number between 0 and 2*PI |
- Returns:
- sin(r), where r is [0..2*PI]
Floating point square root.
- Returns:
- sqrt(f)
Floating point tangent.
- Parameters:
-
r | a floating point number between 0 and 2*PI |
- Returns:
- tan(r), where r is [0..2*PI]