Functions providing elementary mathematical functionality.
The scalar unit on the AIE has support for several fixed-point/integer and/or floating-point non-linear functions. Current support includes Sin/Cos, Inv, InvSqrt and Sqrt functions.
This floating point intrinsics can generate exceptions, for more information you can go here.
|
float | _expf (float x) |
| Exponent.
|
|
float | _logf (float x) |
| Logarithm.
|
|
float | _sqrtf (float a) |
| Square Root.
|
|
float | inv (float a) |
| Inverse.
|
|
int | inv (int a, int sft1, int sft2) |
| Inverse.
|
|
float | invsqrt (float a) |
| Inverse Square Root.
|
|
int | invsqrt (int a, int sft1, int sft2) |
| Inverse Square Root.
|
|
cint16 | sincos (unsigned int) |
| Sine and Cosine.
|
|
int | sqrt (int a, int sft1, int sft2) |
| Square Root.
|
|
Exponent.
- Parameters
-
a | Single precision floating-point input value |
- Returns
- Single precision floating point inverse square root
Logarithm.
- Parameters
-
a | Single precision floating-point input value |
- Returns
- Single precision floating point inverse square root
Square Root.
- Parameters
-
a | Single precision floating-point input value |
- Returns
- Single precision floating-point result
Inverse.
- Parameters
-
a | Single precision floating-point input value |
- Returns
- Single precision floating point inverse
int inv |
( |
int |
a, |
|
|
int |
sft1, |
|
|
int |
sft2 |
|
) |
| |
Inverse.
Equivalent to float2fix(inv(fix2float(a,sft1)),sft2).
- Parameters
-
a | Fixed-point input value |
sft1 | Decimal point of input value |
sft2 | Decimal point of output value |
- Returns
- Fixed-point result
Inverse Square Root.
- Parameters
-
a | Single precision floating-point input value |
- Returns
- Single precision floating point inverse square root
int invsqrt |
( |
int |
a, |
|
|
int |
sft1, |
|
|
int |
sft2 |
|
) |
| |
Inverse Square Root.
Equivalent to float2fix(invsqrt(fix2float(a,sft1)),sft2).
- Parameters
-
a | Fixed-point input value |
sft1 | Decimal point of input value |
sft2 | Decimal point of output value |
- Returns
- Fixed-point result
cint16 sincos |
( |
unsigned |
int | ) |
|
Sine and Cosine.
- Parameters
-
a | Fixed-point unsigned input value in Q1.31 format scaled with 1/Pi (input value 2^31 corresponds to Pi). Only the upper 20-bit of the input value are used. |
- Returns
- 32-bit integer concatenating Sine (bits [31:16]) and Cosine (bits [15:0]) in signed Q.15 fixed-point format
int sqrt |
( |
int |
a, |
|
|
int |
sft1, |
|
|
int |
sft2 |
|
) |
| |
Square Root.
Equivalent to float2fix(sqrt(fix2float(a,sft1)),sft2).
- Parameters
-
a | Fixed-point input value |
sft1 | Decimal point of input value |
sft2 | Decimal point of output value |
- Returns
- Fixed-point result