Rate This Document
Findability
Accuracy
Completeness
Readability

NEON Instructions

The general NEON instruction format is as follows:

{<prefix>}<op>{<suffix>} Vd.<T>, Vn.<T>, Vm.<T>
  • {} indicates that the parameter is optional.
  • <prefix> is generally used to identify the data type processed by the NEON instruction. For example, S indicates a signed integer, U indicates an unsigned integer, F indicates a floating point number, and P indicates a Boolean data type.
  • <op> indicates the operation type of the NEON instruction. For example, ADD indicates an addition operation.
  • <suffix> indicates an operation behavior of the NEON instruction. For example, P indicates that a vector is operated by pair, V indicates that an operation is performed across all data channels, and 2 indicates that an operation is performed on the high-order bits of data in a wide or narrow instruction.
  • <T> indicates the width of data processed by the NEON instruction. For example, B indicates an 8-bit data width, H indicates a 16-bit data width, S indicates a 32-bit data width, and D indicates a 64-bit data width.

The following describes two NEON instructions.

  • ADDHN2: Two 128-bit vectors are added to generate a 64-bit vector, which is stored as the upper 64 bits of the NEON register.
  • SADDL2: Two upper 64-bit vectors of the NEON register are added to generate a 128-bit vector.

NEON instructions can be classified into normal instructions, wide instructions, narrow instructions, saturating instructions, and long instructions based on operand types.

  • Normal instruction: generates a vector of the same size and type (usually the same) as the operand vector.
  • Long instruction: performs an operation on a double-word vector operand to produce a quad-word vector. The generated elements are twice the width of the operand elements and of the same type. Its flag is L, for example, VMOVL.
  • Wide instruction: performs an operation on a double-word vector operand and a quad-word vector operand to generate a quad-word vector. Its flag is W, for example, VADDW.
  • Narrow instruction: performs an operation on a quad-word vector operand to generate a double-word vector. The result is generally half the width of the original. Its flag is N, for example, VMOVN.
  • Saturating instruction: automatically limits the data width to the range when the actual width exceeds the range specified by the data type. Its flag is Q, for example, VQSHRUN.