AI Engine Intrinsics User Guide (AIE) v2024.2
Loading...
Searching...
No Matches
Elementary Functions

Overview

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.

Functions

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.
 

Function Documentation

◆ _expf()

float _expf ( float  x)

Exponent.

Parameters
aSingle precision floating-point input value
Returns
Single precision floating point inverse square root

◆ _logf()

float _logf ( float  x)

Logarithm.

Parameters
aSingle precision floating-point input value
Returns
Single precision floating point inverse square root

◆ _sqrtf()

float _sqrtf ( float  a)

Square Root.

Parameters
aSingle precision floating-point input value
Returns
Single precision floating-point result

◆ inv() [1/2]

float inv ( float  a)

Inverse.

Parameters
aSingle precision floating-point input value
Returns
Single precision floating point inverse

◆ inv() [2/2]

int inv ( int  a,
int  sft1,
int  sft2 
)

Inverse.

Equivalent to float2fix(inv(fix2float(a,sft1)),sft2).

Parameters
aFixed-point input value
sft1Decimal point of input value
sft2Decimal point of output value
Returns
Fixed-point result

◆ invsqrt() [1/2]

float invsqrt ( float  a)

Inverse Square Root.

Parameters
aSingle precision floating-point input value
Returns
Single precision floating point inverse square root

◆ invsqrt() [2/2]

int invsqrt ( int  a,
int  sft1,
int  sft2 
)

Inverse Square Root.

Equivalent to float2fix(invsqrt(fix2float(a,sft1)),sft2).

Parameters
aFixed-point input value
sft1Decimal point of input value
sft2Decimal point of output value
Returns
Fixed-point result

◆ sincos()

cint16 sincos ( unsigned int  )

Sine and Cosine.

Parameters
aFixed-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

◆ sqrt()

int sqrt ( int  a,
int  sft1,
int  sft2 
)

Square Root.

Equivalent to float2fix(sqrt(fix2float(a,sft1)),sft2).

Parameters
aFixed-point input value
sft1Decimal point of input value
sft2Decimal point of output value
Returns
Fixed-point result