BFP API Quick Reference#

The tables below list the functions of the block floating-point API. The “EW” column indicates whether the operation acts element-wise.

The “Signature” column is intended as a hint which quickly conveys the kind of the conceptual inputs to and outputs from the operation. The signatures are only intended to convey how many (conceptual) inputs and outputs there are, and their dimensionality.

The functions themselves will typically take more arguments than these signatures indicate. Check the function’s full documentation to get more detailed information.

The following symbols are used in the signatures:

Symbol

Description

\(\mathbb{S}\)

A scalar input or output value.

\(\mathbb{V}\)

A vector-valued input or output.

\(\mathbb{M}\)

A matrix-valued input or output.

\(\varnothing\)

Placeholder indicating no input or output.

For example, the operation signature \((\mathbb{V \times V \times S}) \to \mathbb{V}\) indicates the operation takes two vector inputs and a scalar input, and the output is a vector.

32-Bit BFP API Quick Reference#

Table 44 32-Bit BFP API - Quick Reference#

Function

EW

Signature

Brief

bfp_s32_init()

\((\mathbb{V \times S}) \to \mathbb{V}\)

Initialize (static)

bfp_s32_alloc()

\(\varnothing \to \mathbb{V}\)

Initialize (dynamic)

bfp_s32_dealloc()

\(\mathbb{V} \to \mathbb{\varnothing}\)

Deinitialize

bfp_s32_set()

x

\((\mathbb{V \times S}) \to \mathbb{V}\)

Set All Elements

bfp_s32_use_exponent()

\((\mathbb{V \times S}) \to \mathbb{V}\)

Force Exponent

bfp_s32_headroom()

\(\mathbb{V} \to \mathbb{S}\)

Get Headroom

bfp_s32_shl()

x

\((\mathbb{V \times S}) \to \mathbb{V}\)

Shift Mantissas

bfp_s32_add()

x

\((\mathbb{V \times V}) \to \mathbb{V}\)

Add Vector

bfp_s32_add_scalar()

\((\mathbb{V \times S}) \to \mathbb{V}\)

Add Scalar

bfp_s32_sub()

x

\((\mathbb{V \times V}) \to \mathbb{V}\)

Subtract Vector

bfp_s32_mul()

x

\((\mathbb{V \times V}) \to \mathbb{V}\)

Multiply Vector

bfp_s32_macc()

x

\((\mathbb{V \times V \times V}) \to \mathbb{V}\)

Multiply-Accumulate

bfp_s32_nmacc()

x

\((\mathbb{V \times V \times V}) \to \mathbb{V}\)

Negated Multiply-Accumulate

bfp_s32_scale()

\((\mathbb{V \times S}) \to \mathbb{V}\)

Multiply Scalar

bfp_s32_abs()

x

\(\mathbb{V} \to \mathbb{V}\)

Absolute Values

bfp_s32_sum()

\(\mathbb{V} \to \mathbb{S}\)

Sum Elements

bfp_s32_dot()

\((\mathbb{V \times V}) \to \mathbb{S}\)

Inner Product

bfp_s32_clip()

x

\((\mathbb{V \times S \times S}) \to \mathbb{V}\)

Clip Bounds

bfp_s32_rect()

x

\(\mathbb{V} \to \mathbb{V}\)

Rectify Elements

bfp_s32_to_bfp_s16()

\(\mathbb{V} \to \mathbb{V}\)

Convert to 16-bit

bfp_s32_sqrt()

x

\(\mathbb{V} \to \mathbb{V}\)

Square Root

bfp_s32_inverse()

x

\(\mathbb{V} \to \mathbb{V}\)

Multiplicative Inverse

bfp_s32_abs_sum()

\(\mathbb{V} \to \mathbb{S}\)

Absolute Sum Elements

bfp_s32_mean()

\(\mathbb{V} \to \mathbb{S}\)

Vector Mean Value

bfp_s32_energy()

\(\mathbb{V} \to \mathbb{S}\)

Vector Energy

bfp_s32_rms()

\(\mathbb{V} \to \mathbb{S}\)

Vector RMS Value

bfp_s32_max()

\(\mathbb{V} \to \mathbb{S}\)

Vector Max Element

bfp_s32_min()

\(\mathbb{V} \to \mathbb{S}\)

Vector Min Element

bfp_s32_max_elementwise()

x

\((\mathbb{V \times V}) \to \mathbb{V}\)

Elementwise Max

bfp_s32_min_elementwise()

x

\((\mathbb{V \times V}) \to \mathbb{V}\)

Elementwise Min

bfp_s32_argmax()

\(\mathbb{V} \to \mathbb{S}\)

Max Element Index

bfp_s32_argmin()

\(\mathbb{V} \to \mathbb{S}\)

Min Element Index

bfp_s32_convolve_valid()

\((\mathbb{V \times V}) \to \mathbb{V}\)

Convolve With Kernel (Valid mode)

bfp_s32_convolve_same()

\((\mathbb{V \times V}) \to \mathbb{V}\)

Convolve With Kernel (Same mode)

16-Bit BFP API Quick Reference#

Table 45 16-Bit BFP API - Quick Reference#

Function

EW

Signature

Brief

bfp_s16_init()

\((\mathbb{V \times S}) \to \mathbb{V}\)

Initialize (static)

bfp_s16_alloc()

\(\varnothing \to \mathbb{V}\)

Initialize (dynamic)

bfp_s16_dealloc()

\(\mathbb{V} \to \mathbb{\varnothing}\)

Deinitialize

bfp_s16_set()

x

\((\mathbb{V \times S}) \to \mathbb{V}\)

Set All Elements

bfp_s16_use_exponent()

\((\mathbb{V \times S}) \to \mathbb{V}\)

Force Exponent

bfp_s16_headroom()

\(\mathbb{V} \to \mathbb{S}\)

Get Headroom

bfp_s16_shl()

x

\((\mathbb{V \times S}) \to \mathbb{V}\)

Shift Mantissas

bfp_s16_add()

x

\((\mathbb{V \times V}) \to \mathbb{V}\)

Add Vector

bfp_s16_add_scalar()

\((\mathbb{V \times S}) \to \mathbb{V}\)

Add Scalar

bfp_s16_sub()

x

\((\mathbb{V \times V}) \to \mathbb{V}\)

Subtract Vector

bfp_s16_mul()

x

\((\mathbb{V \times V}) \to \mathbb{V}\)

Multiply Vector

bfp_s16_macc()

x

\((\mathbb{V \times V \times V}) \to \mathbb{V}\)

Multiply-Accumulate

bfp_s16_nmacc()

x

\((\mathbb{V \times V \times V}) \to \mathbb{V}\)

Negated Multiply-Accumulate

bfp_s16_scale()

\((\mathbb{V \times S}) \to \mathbb{V}\)

Multiply Scalar

bfp_s16_abs()

x

\(\mathbb{V} \to \mathbb{V}\)

Absolute Values

bfp_s16_sum()

\(\mathbb{V} \to \mathbb{S}\)

Sum Elements

bfp_s16_dot()

\((\mathbb{V \times V}) \to \mathbb{S}\)

Inner Product

bfp_s16_clip()

x

\((\mathbb{V \times S \times S}) \to \mathbb{V}\)

Clip Bounds

bfp_s16_rect()

x

\(\mathbb{V} \to \mathbb{V}\)

Rectify Elements

bfp_s16_to_bfp_s32()

x

\(\mathbb{V} \to \mathbb{V}\)

Convert to 32-bit

bfp_s16_sqrt()

x

\(\mathbb{V} \to \mathbb{V}\)

Square Root

bfp_s16_inverse()

x

\(\mathbb{V} \to \mathbb{V}\)

Multiplicative Inverse

bfp_s16_abs_sum()

\(\mathbb{V} \to \mathbb{V}\)

Absolute Sum Elements

bfp_s16_mean()

\(\mathbb{V} \to \mathbb{V}\)

Vector Mean Value

bfp_s16_energy()

\(\mathbb{V} \to \mathbb{S}\)

Vector Energy

bfp_s16_rms()

\(\mathbb{V} \to \mathbb{S}\)

Vector RMS Value

bfp_s16_max()

\(\mathbb{V} \to \mathbb{S}\)

Vector Max Element

bfp_s16_min()

\(\mathbb{V} \to \mathbb{S}\)

Vector Min Element

bfp_s16_max_elementwise()

x

\((\mathbb{V \times V}) \to \mathbb{V}\)

Elementwise Max

bfp_s16_min_elementwise()

x

\((\mathbb{V \times V}) \to \mathbb{V}\)

Elementwise Min

bfp_s16_argmax()

\(\mathbb{V} \to \mathbb{S}\)

Max Element Index

bfp_s16_argmin()

\(\mathbb{V} \to \mathbb{S}\)

Min Element Index

bfp_s16_accumulate()

x

\((\mathbb{V \times V}) \to \mathbb{V}\)

Elementwise Accumulate

Complex 32-bit BFP API Quick Reference#

Table 46 Complex 32-Bit BFP API - Quick Reference#

Function

EW

Signature

Brief

bfp_complex_s32_init()

\((\mathbb{V \times S}) \to \mathbb{V}\)

Initialize (static

bfp_complex_s32_alloc()

\(\varnothing \to \mathbb{V}\)

Initialize (dynamic

bfp_complex_s32_dealloc()

\(\mathbb{V} \to \mathbb{\varnothing}\)

Deinitialize

bfp_complex_s32_set()

x

\((\mathbb{V \times S}) \to \mathbb{V}\)

Set All Elements

bfp_complex_s32_use_exponent()

\((\mathbb{V \times S}) \to \mathbb{V}\)

Force Exponent

bfp_complex_s32_headroom()

\(\mathbb{V} \to \mathbb{S}\)

Get Headroom

bfp_complex_s32_shl()

x

\((\mathbb{V \times S}) \to \mathbb{V}\)

Shift Mantissas

bfp_complex_s32_real_mul()

x

\((\mathbb{V \times V}) \to \mathbb{V}\)

Real Vector Multiply

bfp_complex_s32_mul()

x

\((\mathbb{V \times V}) \to \mathbb{V}\)

Complex Vector Multiply

bfp_complex_s32_conj_mul()

x

\((\mathbb{V \times V}) \to \mathbb{V}\)

Complex Vector Conjugate Multiply

bfp_complex_s32_macc()

x

\((\mathbb{V \times V \times V}) \to \mathbb{V}\)

Complex Vector Multiply-Accumulate

bfp_complex_s32_nmacc()

x

\((\mathbb{V \times V \times V}) \to \mathbb{V}\)

Complex Vector Negated Multiply-Accumulate

bfp_complex_s32_conj_macc()

x

\((\mathbb{V \times V \times V}) \to \mathbb{V}\)

Complex Vector Conjugate Multiply-Accumulate

bfp_complex_s32_conj_nmacc()

x

\((\mathbb{V \times V \times V}) \to \mathbb{V}\)

Complex Vector Negated Conjugate Multiply-Accumulate

bfp_complex_s32_real_scale()

\((\mathbb{V \times S}) \to \mathbb{V}\)

Real Scalar Multiply

bfp_complex_s32_scale()

\((\mathbb{V \times S}) \to \mathbb{V}\)

Complex Scalar Multiply

bfp_complex_s32_add()

x

\((\mathbb{V \times V}) \to \mathbb{V}\)

Complex Vector Add

bfp_complex_s32_add_scalar()

\((\mathbb{V \times S}) \to \mathbb{V}\)

Complex Scalar Add

bfp_complex_s32_sub()

\((\mathbb{V \times V}) \to \mathbb{V}\)

Complex Vector Subtract

bfp_complex_s32_to_bfp_complex_s16()

x

\(\mathbb{V} \to \mathbb{V}\)

Convert to 16-bit

bfp_complex_s32_squared_mag()

x

\(\mathbb{V} \to \mathbb{V}\)

Squared Magnitude

bfp_complex_s32_mag()

x

\(\mathbb{V} \to \mathbb{V}\)

Magnitude

bfp_complex_s32_sum()

\(\mathbb{V} \to \mathbb{S}\)

Vector Sum

bfp_complex_s32_conjugate()

x

\(\mathbb{V} \to \mathbb{V}\)

Complex Conjugate

bfp_complex_s32_energy()

\(\mathbb{V} \to \mathbb{S}\)

Vector Energy

bfp_complex_s32_make()

x

\((\mathbb{V \times V}) \to \mathbb{V}\)

Construct Complex From Real and Imag

bfp_complex_s32_real_part()

x

\(\mathbb{V} \to \mathbb{V}\)

Real Part

bfp_complex_s32_imag_part()

x

\(\mathbb{V} \to \mathbb{V}\)

Imag Part

Complex 16-bit BFP API Quick Reference#

Table 47 Complex 16-Bit BFP API - Quick Reference#

Function

EW

Signature

Brief

bfp_complex_s16_init()

\((\mathbb{V \times S}) \to \mathbb{V}\)

Initialize (static)

bfp_complex_s16_alloc()

\(\varnothing \to \mathbb{V}\)

Initialize (dynamic)

bfp_complex_s16_dealloc()

\(\mathbb{V} \to \mathbb{\varnothing}\)

Deinitialize

bfp_complex_s16_set()

x

\((\mathbb{V \times S}) \to \mathbb{V}\)

Set All Elements

bfp_complex_s16_use_exponent()

\((\mathbb{V \times S}) \to \mathbb{V}\)

Force Exponent

bfp_complex_s16_headroom()

\(\mathbb{V} \to \mathbb{S}\)

Get Headroom

bfp_complex_s16_shl()

x

\((\mathbb{V \times S}) \to \mathbb{V}\)

Shift Mantissas

bfp_complex_s16_real_mul()

x

\((\mathbb{V \times V}) \to \mathbb{V}\)

Real Vector Multiply

bfp_complex_s16_mul()

x

\((\mathbb{V \times V}) \to \mathbb{V}\)

Complex Vector Multiply

bfp_complex_s16_conj_mul()

x

\((\mathbb{V \times V}) \to \mathbb{V}\)

Complex Vector Conjugate Multiply

bfp_complex_s16_macc()

x

\((\mathbb{V \times V \times V}) \to \mathbb{V}\)

Complex Vector Multiply-Accumulate

bfp_complex_s16_nmacc()

x

\((\mathbb{V \times V \times V}) \to \mathbb{V}\)

Complex Vector Negated Multiply-Accumulate

bfp_complex_s16_conj_macc()

x

\((\mathbb{V \times V \times V}) \to \mathbb{V}\)

Complex Vector Conjugate Multiply-Accumulate

bfp_complex_s16_conj_nmacc()

x

\((\mathbb{V \times V \times V}) \to \mathbb{V}\)

Complex Vector Negated Conjugate Multiply-Accumulate

bfp_complex_s16_real_scale()

\((\mathbb{V \times S}) \to \mathbb{V}\)

Real Scalar Multiply

bfp_complex_s16_scale()

\((\mathbb{V \times S}) \to \mathbb{V}\)

Complex Scalar Multiply

bfp_complex_s16_add()

x

\((\mathbb{V \times V}) \to \mathbb{V}\)

Complex Vector Add

bfp_complex_s16_add_scalar()

\((\mathbb{V \times S}) \to \mathbb{V}\)

Complex Scalar Add

bfp_complex_s16_sub()

\((\mathbb{V \times V}) \to \mathbb{V}\)

Complex Vector Subtract

bfp_complex_s16_to_bfp_complex_s32()

x

\(\mathbb{V} \to \mathbb{V}\)

Convert to 32-bit

bfp_complex_s16_squared_mag()

x

\(\mathbb{V} \to \mathbb{V}\)

Squared Magnitude

bfp_complex_s16_sum()

\(\mathbb{V} \to \mathbb{S}\)

Vector Sum

bfp_complex_s16_mag()

x

\(\mathbb{V} \to \mathbb{V}\)

Magnitude

bfp_complex_s16_conjugate()

x

\(\mathbb{V} \to \mathbb{V}\)

Complex Conjugate

bfp_complex_s16_energy()

\(\mathbb{V} \to \mathbb{S}\)

Vector Energy