Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SIMD and Vectorization

Status Draft outlineSection The Machine

Single-instruction, multiple-data execution applies one operation across several lanes, provided data layout and control flow expose enough independent work.

Planned model

Compare scalar and lane-based processing. Animate loads, masks, horizontal reductions, tail handling, and the effect of aligned contiguous data.

Questions

  • Which loops can the compiler auto-vectorize?
  • How do branches become masks?
  • When do gathering, shuffling, and horizontal reduction erase the gain?

Exercise

Reshape a scalar filter-and-sum loop so its data dependencies and remainder handling are explicit.