Rate This Document
Findability
Accuracy
Completeness
Readability

SIMD Instruction Set

A single-instruction, multiple-data (SIMD) instruction set is a set of instructions for processing multiple data streams by using a single instruction. A single-instruction, single-data (SISD) instruction set a set of instructions that can only process a single data stream by using a single instruction.

Conceptually, SIMD outperforms SISD in data-intensive computing scenarios. Take the addition instruction as an example, as shown in Figure 1. The CPU executes one instruction: A1 + B1 = C1, and then executes the next instruction: A2 + B2 = C2. The subsequent calculations are completed in this sequence. The four addition operations need to be performed serially. When SIMD is used, the CPU needs to execute only one instruction to complete four addition calculation operations, and the four addition calculation operations are executed in parallel. In such a scenario, SIMD instruction performance is better than conventional SISD instruction performance.

Figure 1 SISD and SIMD

The parallel execution is implemented because some dedicated vector registers are added during physical design of the CPU. The length of these registers is usually greater than that of the general-purpose register. For example, the length of the vector register of the Kunpeng processor is 128 bits, and the maximum length of the general-purpose register is 64 bits. Therefore, multiple pieces of data can be put into these registers at the same time. Note that the data types of the multiple pieces of data must be the same.

The vector registers vary based on architectures. Therefore, SIMD instruction sets supported by different architectures vary. When developing and using an SIMD instruction set on the Kunpeng platform, check whether the SIMD instruction set is supported.