IPU C++ memory intrinsics

Functions that target IPU memory instructions.

These function definitions target specific IPU memory instructions and may be used in C++ IPU code. These cover post-incrementing load and store instructions.

Refer to the “Tile Worker ISA” for more detailed information on the instructions targeted by these intrinsics.

Defines

IPU_MEMORY_INTRINSICS_INCLUDED
namespace ipu

IPU intrinsic functions.

Functions

inline half load_postinc(const half **a, int i)

Post-incrementing load, targeting the ldb16step instruction.

Parameters
  • a – Address of the variable holding the address to load from. Gets incremented by i after the load.

  • i – Value by which to increment a after load.

Returns

The value in memory whose address is given by a, as a half.

inline void store_postinc(half2 **a, half2 v, int i)

Post-incrementing store, targeting the st32step instruction.

Parameters
  • a – Address of the variable holding the address to store to. Gets incremented by i after the store.

  • v – Value to store, of type half2.

  • i – Value by which to increment a after store.

inline half2 load_postinc(const half2 **a, int i)

Post-incrementing load, targeting the ld32step instruction.

Parameters
  • a – Address of the variable holding the address to load from. Gets incremented by i after the load.

  • i – Value by which to increment a after load.

Returns

The value in memory whose address is given by a, as a half2.

inline void store_postinc(half4 **a, half4 v, int i)

Post-incrementing store, targeting the st64step instruction.

Parameters
  • a – Address of the variable holding the address to store to. Gets incremented by i after the store.

  • v – Value to store, of type half4.

  • i – Value by which to increment a after store.

inline half4 load_postinc(const half4 **a, int i)

Post-incrementing load, targeting the ld64step instruction.

Parameters
  • a – Address of the variable holding the address to load from. Gets incremented by i after the load.

  • i – Value by which to increment a after load.

Returns

The value in memory whose address is given by a, as a half4.

inline void store_postinc(float **a, float v, int i)

Post-incrementing store, targeting the st32step instruction.

Parameters
  • a – Address of the variable holding the address to store to. Gets incremented by i after the store.

  • v – Value to store, of type float.

  • i – Value by which to increment a after store.

inline float load_postinc(const float **a, int i)

Post-incrementing load, targeting the ld32step instruction.

Parameters
  • a – Address of the variable holding the address to load from. Gets incremented by i after the load.

  • i – Value by which to increment a after load.

Returns

The value in memory whose address is given by a, as a float.

inline void store_postinc(float2 **a, float2 v, int i)

Post-incrementing store, targeting the st64step instruction.

Parameters
  • a – Address of the variable holding the address to store to. Gets incremented by i after the store.

  • v – Value to store, of type float2.

  • i – Value by which to increment a after store.

inline float2 load_postinc(const float2 **a, int i)

Post-incrementing load, targeting the ld64step instruction.

Parameters
  • a – Address of the variable holding the address to load from. Gets incremented by i after the load.

  • i – Value by which to increment a after load.

Returns

The value in memory whose address is given by a, as a float2.

inline void store_postinc(int **a, int v, int i)

Post-incrementing store, targeting the stm32step instruction if i is a variable stride, and st32step otherwise.

Parameters
  • a – Address of the variable holding the address to store to. Gets incremented by i after the store.

  • v – Value to store, of type int.

  • i – Value by which to increment a after store.

inline int load_postinc(const int **a, int i)

Post-incrementing load, targeting the ld32step instruction.

Parameters
  • a – Address of the variable holding the address to load from. Gets incremented by i after the load.

  • i – Value by which to increment a after load.

Returns

The value in memory whose address is given by a, as an int.

inline void store_postinc(unsigned **a, unsigned v, int i)

Post-incrementing store, targeting the stm32step instruction if i is a variable stride, and st32step otherwise.

Parameters
  • a – Address of the variable holding the address to store to. Gets incremented by i after the store.

  • v – Value to store, of type unsigned.

  • i – Value by which to increment a after store.

inline unsigned load_postinc(const unsigned **a, int i)

Post-incrementing load, targeting the ld32step instruction.

Parameters
  • a – Address of the variable holding the address to load from. Gets incremented by i after the load.

  • i – Value by which to increment a after load.

Returns

The value in memory whose address is given by a, as an unsigned.

inline void store_postinc(int2 **a, int2 v, int i)

Post-incrementing store.

Parameters
  • a – Address of the variable holding the address to store to. Gets incremented by i after the store.

  • v – Value to store, of type int2.

  • i – Value by which to increment a after store.

inline int2 load_postinc(const int2 **a, int i)

Post-incrementing load.

Parameters
  • a – Address of the variable holding the address to load from. Gets incremented by i after the load.

  • i – Value by which to increment a after load.

Returns

The value in memory whose address is given by a, as an int2.

inline void store_postinc(uint2 **a, uint2 v, int i)

Post-incrementing store.

Parameters
  • a – Address of the variable holding the address to store to. Gets incremented by i after the store.

  • v – Value to store, of type uint2.

  • i – Value by which to increment a after store.

inline uint2 load_postinc(const uint2 **a, int i)

Post-incrementing load.

Parameters
  • a – Address of the variable holding the address to load from. Gets incremented by i after the load.

  • i – Value by which to increment a after load.

Returns

The value in memory whose address is given by a, as a uint2.

inline void store_postinc(short **a, short v, int i)

Post-incrementing store.

Parameters
  • a – Address of the variable holding the address to store to. Gets incremented by i after the store.

  • v – Value to store, of type short.

  • i – Value by which to increment a after store.

inline short load_postinc(const short **a, int i)

Post-incrementing load, targeting the lds16step instruction.

Parameters
  • a – Address of the variable holding the address to load from. Gets incremented by i after the load.

  • i – Value by which to increment a after load.

Returns

The value in memory whose address is given by a, as a short.

inline void store_postinc(unsigned short **a, unsigned short v, int i)

Post-incrementing store.

Parameters
  • a – Address of the variable holding the address to store to. Gets incremented by i after the store.

  • v – Value to store, of type unsigned short.

  • i – Value by which to increment a after store.

inline unsigned short load_postinc(const unsigned short **a, int i)

Post-incrementing load, targeting the ldz16step instruction.

Parameters
  • a – Address of the variable holding the address to load from. Gets incremented by i after the load.

  • i – Value by which to increment a after load.

Returns

The value in memory whose address is given by a, as an unsigned short.

inline void store_postinc(short2 **a, short2 v, int i)

Post-incrementing store, targeting the stm32step instruction if i is a variable stride, and st32step otherwise.

Parameters
  • a – Address of the variable holding the address to store to. Gets incremented by i after the store.

  • v – Value to store, of type short2.

  • i – Value by which to increment a after store.

inline short2 load_postinc(const short2 **a, int i)

Post-incrementing load, targeting the ld32step instruction.

Parameters
  • a – Address of the variable holding the address to load from. Gets incremented by i after the load.

  • i – Value by which to increment a after load.

Returns

The value in memory whose address is given by a, as a short2.

inline void store_postinc(ushort2 **a, ushort2 v, int i)

Post-incrementing store, targeting the stm32step instruction if i is a variable stride, and st32step otherwise.

Parameters
  • a – Address of the variable holding the address to store to. Gets incremented by i after the store.

  • v – Value to store, of type ushort2.

  • i – Value by which to increment a after store.

inline ushort2 load_postinc(const ushort2 **a, int i)

Post-incrementing load, targeting the ld32step instruction.

Parameters
  • a – Address of the variable holding the address to load from. Gets incremented by i after the load.

  • i – Value by which to increment a after load.

Returns

The value in memory whose address is given by a, as a ushort2.

inline void store_postinc(short4 **a, short4 v, int i)

Post-incrementing store.

Parameters
  • a – Address of the variable holding the address to store to. Gets incremented by i after the store.

  • v – Value to store, of type short4.

  • i – Value by which to increment a after store.

inline short4 load_postinc(const short4 **a, int i)

Post-incrementing load.

Parameters
  • a – Address of the variable holding the address to load from. Gets incremented by i after the load.

  • i – Value by which to increment a after load.

Returns

The value in memory whose address is given by a, as a short4.

inline void store_postinc(ushort4 **a, ushort4 v, int i)

Post-incrementing store.

Parameters
  • a – Address of the variable holding the address to store to. Gets incremented by i after the store.

  • v – Value to store, of type ushort4.

  • i – Value by which to increment a after store.

inline ushort4 load_postinc(const ushort4 **a, int i)

Post-incrementing load.

Parameters
  • a – Address of the variable holding the address to load from. Gets incremented by i after the load.

  • i – Value by which to increment a after load.

Returns

The value in memory whose address is given by a, as a ushort4.

inline void store_postinc(char **a, char v, int i)

Post-incrementing store.

Parameters
  • a – Address of the variable holding the address to store to. Gets incremented by i after the store.

  • v – Value to store, of type char.

  • i – Value by which to increment a after store.

inline char load_postinc(const char **a, int i)

Post-incrementing load, targeting the lds8step instruction.

Parameters
  • a – Address of the variable holding the address to load from. Gets incremented by i after the load.

  • i – Value by which to increment a after load.

Returns

The value in memory whose address is given by a, as a char.

inline void store_postinc(unsigned char **a, unsigned char v, int i)

Post-incrementing store.

Parameters
  • a – Address of the variable holding the address to store to. Gets incremented by i after the store.

  • v – Value to store, of type unsigned char.

  • i – Value by which to increment a after store.

inline unsigned char load_postinc(const unsigned char **a, int i)

Post-incrementing load, targeting the ldz8step instruction.

Parameters
  • a – Address of the variable holding the address to load from. Gets incremented by i after the load.

  • i – Value by which to increment a after load.

Returns

The value in memory whose address is given by a, as an unsigned char.