General Definition

Description

This is a generic form (instruction template) for an instruction with three source operands (src, dst, and a scalar). Note that it gives no out-of-box instruction code.

Prototype

instruction (mask, dst, src, scalar, repeat_times, dst_rep_stride, src_rep_stride, )

Parameters

Table 1

Parameter

Input/Output

Description

instruction

Input

A string specifying the instruction name. Only lowercase letters are supported in TIK DSL.

mask

Input

For details, see the description of the mask parameter in Table 1.

dst

Output

Destination Vector operand or source operand 1, which points to the start element of the tensor. The supported data types vary depending on the specific instruction.

The scope of the tensor is the Unified Buffer.

src

Input

Source Vector operand 0, which points to the start element of the tensor. The supported data types vary depending on the specific instruction.

The scope of the tensor is the Unified Buffer.

scalar

Input

A Scalar or immediate, for the source Scalar operand.

repeat_times

Input

Repeat times (or iterations).

dst_rep_stride

Input

Repeat stride size for the destination Vector operand between the corresponding blocks of successive iterations.

src_rep_stride

Input

Repeat stride size for the source Vector operand between the corresponding blocks of successive iterations.

Restrictions

  • repeat_times ∈ [0, 255]. Must be a Scalar of type int16/int32/int64/uint16/uint32/uint64, an immediate of type int (other than 0), or an Expr of type int16/int32/int64/uint16/uint32/uint64.
  • dst_rep_stride and src_rep_stride , in the unit of 32 bytes. Must be a Scalar of type int16/int32/int64/uint16/uint32/uint64, an immediate of type int, or an Expr of type int16/int32/int64/uint16/uint32/uint64.
  • dst is both the destination operand and the source operand.
  • To save memory space, you can define a tensor reused by the source and destination operands (which means they have overlapped addresses). The general instruction restrictions are as follows.
    • In the event of a single iteration repeat (repeat_times = 1), the source operand must completely overlap the destination operand.
    • In the event of multiple iteration repeats (repeat_times > 1), if there is a dependency between the source operand and the destination operand, that is, the destination operand of the Nth iteration is the source operand of the (N+1)th iteration, address overlapping is not allowed.
  • For details about the alignment requirements of the operand address offset, see General Restrictions.