| AI Engine Intrinsics User Guide (AIE) v2025.2

Loading...
Searching...
No Matches
Functions
Datatype Conversions
Intrinsics » Vector Conversions

Support for converting floating-point vectors to fixed-point vectors and fixed-point vectors to floating-point vectors. More...

## Overview

Support for converting floating-point vectors to fixed-point vectors and fixed-point vectors to floating-point vectors.

These intrinsics can generate exceptions, for more information you can go here.

Note
  These intrinsics do real conversions. No bit reinterpretation takes place.

## Functions
v8float | fix2float (v8int32 ivec)
| Fixed-point to Floating-point conversion without scaling.
v8float | fix2float (v8int32 ivec, int sft)
| Fixed-point to Floating-point conversion with scaling.
v8int32 | float2fix (v8float v)
| Floating-point to Fixed-point conversion without scaling.
v8int32 | float2fix (v8float v, int sft)
| Floating-point to Fixed-point conversion with scaling.

## Function Documentation

## ◆ fix2float() [1/2]

v8float fix2float | ( | v8int32 | ivec | ) |

Fixed-point to Floating-point conversion without scaling.

Parameters

  n | Integer input value

This is a vectorized version of fix2float(int n)

## ◆ fix2float() [2/2]

v8float fix2float | ( | v8int32 | ivec,
|  | int | sft
| ) |  |

Fixed-point to Floating-point conversion with scaling.

Parameters

  n | Integer input value
  sft | Binary point of input value. Range [-32:31].

This is a vectorized version of fix2float(int n, int sft)

## ◆ float2fix() [1/2]

v8int32 float2fix | ( | v8float | v | ) |

Floating-point to Fixed-point conversion without scaling.

Parameters

  n | Floating point input value

This is a vectorized version of float2fix(float n)

## ◆ float2fix() [2/2]

v8int32 float2fix | ( | v8float | v,
|  | int | sft
| ) |  |

Floating-point to Fixed-point conversion with scaling.

Parameters

  n | Floating point input value
  sft | Binary point of output value. Range [-32:31].

This is a vectorized version of float2fix(float n, int sft)

Note
  If FLOAT2FIX_FAST is not defined, this is an alias to float2fix_safe(v8float v, int sft). Otherwise it is an alias to float2fix_fast(v8float v, int sft)