Advanced Topic 39 of 51 Computer Architecture & Logic
SIMD and Vector Processing
Applying one instruction to many data elements at once.
How it works
SIMD, single instruction multiple data, applies one operation to many data elements packed in a wide register at once, for example eight 32-bit floats in a 256-bit register. Instruction sets such as SSE, AVX, NEON and RISC-V vector extensions provide such operations, and masks or predicates control which lanes are active. Throughput rises with width, but data must be laid out contiguously and aligned.
Step-by-step walkthrough
- Scalar code adds one pair at a time.
- A SIMD register holds four values.
- One vector add instruction adds all four pairs together.
- Four results appear in the time of one.
- Compilers and libraries use AVX or NEON for images, audio and math.
Where it is used
Image and video processing, audio effects, linear algebra, machine-learning inference, compression, cryptography and string searching use SIMD, either through compiler auto-vectorization or intrinsics.
Common pitfall
Branches inside loops, irregular memory access and loop-carried dependencies prevent vectorization. Misaligned data and mixed element sizes reduce gains. Wider vector units may lower clock speeds on some CPUs. Check the compiler vectorization report and structure data as arrays of fields instead of arrays of structs.
Where it fits in the course
SIMD and Vector Processing is topic 39 of 51 in Computer Architecture & Logic, rated Advanced. It follows Cache Coherence. The next topic is GPU Architecture.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Computer Architecture & Logic quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Computer Architecture & Logic quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is SIMD and Vector Processing?
Where do people use SIMD and Vector Processing?
What is the most common mistake with SIMD and Vector Processing?
What should I learn before this topic?
How can I practice it?
Is SIMD and Vector Processing hard to learn?
How long does it take to learn SIMD and Vector Processing?
Which topics are related to SIMD and Vector Processing?
What should I study after SIMD and Vector Processing?
Related topics
- Cache Coherence (Computer Architecture & Logic)
- GPU Architecture (Computer Architecture & Logic)
- Multicore Processors (Computer Architecture & Logic)
- DMA (Computer Architecture & Logic)
- Raster vs Vector Graphics (Graphics, Vision & Media)
- Support Vector Machines (AI & Machine Learning)
- Batch vs Stream Processing (Distributed Systems & Cloud)