AI Engine Intrinsics  (AIE) r2p21
 All Data Structures Namespaces Functions Variables Typedefs Groups Pages
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 _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

float _sqrtf ( float  a)

Square Root.

Parameters
aSingle precision floating-point input value
Returns
Single precision floating-point result
float inv ( float  a)

Inverse.

Parameters
aSingle 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
aFixed-point input value
sft1Decimal point of input value
sft2Decimal point of output value
Returns
Fixed-point result
float invsqrt ( float  a)

Inverse Square Root.

Parameters
aSingle 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
aFixed-point input value
sft1Decimal point of input value
sft2Decimal point of output value
Returns
Fixed-point result
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
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