| AI Engine API User Guide (AIE-API) 2025.2

Loading...
Searching...
No Matches
Functions
Bits

## Overview

Bitwise logical operations.

## Functions
template<Vector Vec1, Vector Vec2> requires (is_same_vector_v<Vec1, Vec2> && (!detail::is_complex_v<typename Vec1::value_type>) && (!detail::is_floating_point_v<typename Vec1::value_type>))
auto | aie::bit_and (const Vec1 &v1, const Vec2 &v2) -> aie_dm_resource_remove_t< Vec1 >
| Returns a vector with the bit-wise AND of the elements of the two input vectors.
template<Elem E, Vector Vec> requires (is_valid_elem_op_v<E, typename Vec::value_type> && (!detail::is_complex_v<typename Vec::value_type>) && (!detail::is_floating_point_v<typename Vec::value_type>))
auto | aie::bit_and (E a, const Vec &v) -> aie_dm_resource_remove_t< Vec >
| Returns a vector with the bit-wise AND of a value and all the elements of the input vector.
template<Vector Vec> requires ((!detail::is_complex_v<typename Vec::value_type>) && (!detail::is_floating_point_v<typename Vec::value_type>))
auto | aie::bit_not (const Vec &v) -> aie_dm_resource_remove_t< Vec >
| Returns a vector with the bit-wise NEG of the elements of the input vector.
template<Vector Vec1, Vector Vec2> requires (is_same_vector_v<Vec1, Vec2> && (!detail::is_complex_v<typename Vec1::value_type>) && (!detail::is_floating_point_v<typename Vec1::value_type>))
auto | aie::bit_or (const Vec1 &v1, const Vec2 &v2) -> aie_dm_resource_remove_t< Vec1 >
| Returns a vector with the bit-wise OR of the elements of the two input vectors.
template<Elem E, Vector Vec> requires (is_valid_elem_op_v<E, typename Vec::value_type> && (!detail::is_complex_v<typename Vec::value_type>) && (!detail::is_floating_point_v<typename Vec::value_type>))
auto | aie::bit_or (E a, const Vec &v) -> aie_dm_resource_remove_t< Vec >
| Returns a vector with the bit-wise OR of a value and all the elements of the input vector.
template<Vector Vec1, Vector Vec2> requires (is_same_vector_v<Vec1, Vec2> && (!detail::is_complex_v<typename Vec1::value_type>) && (!detail::is_floating_point_v<typename Vec1::value_type>))
auto | aie::bit_xor (const Vec1 &v1, const Vec2 &v2) -> aie_dm_resource_remove_t< Vec1 >
| Returns a vector with the bit-wise XOR of the elements of the two input vectors.
template<Elem E, Vector Vec> requires (is_valid_elem_op_v<E, typename Vec::value_type> && (!detail::is_complex_v<typename Vec::value_type>) && (!detail::is_floating_point_v<typename Vec::value_type>))
auto | aie::bit_xor (E a, const Vec &v) -> aie_dm_resource_remove_t< Vec >
| Returns a vector with the bit-wise XOR of a value and all the elements of the input vector.
template<Vector Vec>
auto | aie::downshift (const Vec &v, unsigned shift) -> aie_dm_resource_remove_t< Vec >
| Returns a vector with all values arithmetically downshifted by specified number of bits.
template<Vector Vec>
auto | aie::logical_downshift (const Vec &v, unsigned shift) -> aie_dm_resource_remove_t< Vec >
| Returns a vector with all values logically downshifted by specified number of bits.
template<Vector Vec>
auto | aie::upshift (const Vec &v, unsigned shift) -> aie_dm_resource_remove_t< Vec >
| Returns a vector with all values upshifted by specified number of bits.

## Function Documentation

## ◆ bit_and() [1/2]

template<Vector Vec1, Vector Vec2>
requires (is_same_vector_v<Vec1, Vec2> && (!detail::is_complex_v<typename Vec1::value_type>) && (!detail::is_floating_point_v<typename Vec1::value_type>))

auto aie::bit_and | ( | const Vec1 & | v1,
|  | const Vec2 & | v2 ) -> aie_dm_resource_remove_t<Vec1>

Returns a vector with the bit-wise AND of the elements of the two input vectors.

The vectors must have the same type and size.

for (unsigned i = 0; i < Elems; ++i)
out[i] = v1[i] & v2[i];

Note
  This is a scalar operation on AIE

Parameters

  v1 | First input vector. The type must meet aie::Vector.
  v2 | Second input vector. The type must meet aie::Vector.

## ◆ bit_and() [2/2]

template<Elem E, Vector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type> && (!detail::is_complex_v<typename Vec::value_type>) && (!detail::is_floating_point_v<typename Vec::value_type>))

auto aie::bit_and | ( | E | a,
|  | const Vec & | v ) -> aie_dm_resource_remove_t<Vec>

Returns a vector with the bit-wise AND of a value and all the elements of the input vector.

The type of the value and the type of the vector elements must be the same.

for (unsigned i = 0; i < Elems; ++i)
out[i] = a & v[i];
aie_dm_resource::a
@ a
Memory access is bound to resource a
Definition aie_doc.hpp:1380

Note
  This is a scalar operation on AIE

Parameters

  a | Value. The type must meet aie::Elem.
  v | Input vector. The type must meet aie::Vector.

## ◆ bit_not()

template<Vector Vec>
requires ((!detail::is_complex_v<typename Vec::value_type>) && (!detail::is_floating_point_v<typename Vec::value_type>))

auto aie::bit_not | ( | const Vec & | v | ) | -> aie_dm_resource_remove_t<Vec>

Returns a vector with the bit-wise NEG of the elements of the input vector.

for (unsigned i = 0; i < Elems; ++i)
out[i] = ~v[i];

Note
  This is a scalar operation on AIE

Parameters

  v | Input vector. The type must meet aie::Vector.

## ◆ bit_or() [1/2]

template<Vector Vec1, Vector Vec2>
requires (is_same_vector_v<Vec1, Vec2> && (!detail::is_complex_v<typename Vec1::value_type>) && (!detail::is_floating_point_v<typename Vec1::value_type>))

auto aie::bit_or | ( | const Vec1 & | v1,
|  | const Vec2 & | v2 ) -> aie_dm_resource_remove_t<Vec1>

Returns a vector with the bit-wise OR of the elements of the two input vectors.

The vectors must have the same type and size.

for (unsigned i = 0; i < Elems; ++i)
out[i] = v1[i] | v2[i];

Note
  This is a scalar operation on AIE

Parameters

  v1 | First input vector. The type must meet aie::Vector.
  v2 | Second input vector. The type must meet aie::Vector.

## ◆ bit_or() [2/2]

template<Elem E, Vector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type> && (!detail::is_complex_v<typename Vec::value_type>) && (!detail::is_floating_point_v<typename Vec::value_type>))

auto aie::bit_or | ( | E | a,
|  | const Vec & | v ) -> aie_dm_resource_remove_t<Vec>

Returns a vector with the bit-wise OR of a value and all the elements of the input vector.

The type of the value and the type of the vector elements must be the same.

for (unsigned i = 0; i < Elems; ++i)
out[i] = a | v[i];

Note
  This is a scalar operation on AIE

Parameters

  a | Value. The type must meet aie::Elem.
  v | Input vector. The type must meet aie::Vector.

## ◆ bit_xor() [1/2]

template<Vector Vec1, Vector Vec2>
requires (is_same_vector_v<Vec1, Vec2> && (!detail::is_complex_v<typename Vec1::value_type>) && (!detail::is_floating_point_v<typename Vec1::value_type>))

auto aie::bit_xor | ( | const Vec1 & | v1,
|  | const Vec2 & | v2 ) -> aie_dm_resource_remove_t<Vec1>

Returns a vector with the bit-wise XOR of the elements of the two input vectors.

The vectors must have the same type and size.

for (unsigned i = 0; i < Elems; ++i)
out[i] = v1[i] ^ v2[i];

Note
  This is a scalar operation on AIE

Parameters

  v1 | First input vector. The type must meet aie::Vector.
  v2 | Second input vector. The type must meet aie::Vector.

## ◆ bit_xor() [2/2]

template<Elem E, Vector Vec>
requires (is_valid_elem_op_v<E, typename Vec::value_type> && (!detail::is_complex_v<typename Vec::value_type>) && (!detail::is_floating_point_v<typename Vec::value_type>))

auto aie::bit_xor | ( | E | a,
|  | const Vec & | v ) -> aie_dm_resource_remove_t<Vec>

Returns a vector with the bit-wise XOR of a value and all the elements of the input vector.

The type of the value and the type of the vector elements must be the same.

for (unsigned i = 0; i < Elems; ++i)
out[i] = a ^ v[i];

Note
  This is a scalar operation on AIE

Parameters

  a | Value. The type must meet aie::Elem.
  v | Input vector. The type must meet aie::Vector.

## ◆ downshift()

template<Vector Vec>

auto aie::downshift | ( | const Vec & | v,
|  | unsigned | shift ) -> aie_dm_resource_remove_t<Vec>

Returns a vector with all values arithmetically downshifted by specified number of bits.

Parameters

  v | Input vector
  shift | Number of bits to downshift by

## ◆ logical_downshift()

template<Vector Vec>

auto aie::logical_downshift | ( | const Vec & | v,
|  | unsigned | shift ) -> aie_dm_resource_remove_t<Vec>

Returns a vector with all values logically downshifted by specified number of bits.

Parameters

  v | Input vector
  shift | Number of bits to downshift by

## ◆ upshift()

template<Vector Vec>

auto aie::upshift | ( | const Vec & | v,
|  | unsigned | shift ) -> aie_dm_resource_remove_t<Vec>

Returns a vector with all values upshifted by specified number of bits.

Parameters

  v | Input vector
  shift | Number of bits to upshift by