Fast vector masking algorithm for conditional data selection in SIMD architectures
Abstract
Techniques are disclosed for generating fast vector masking SIMD code corresponding to source code having a conditional statement, where the SIMD code replaces the conditional statements with vector SIMD operations. One technique includes performing conditional masking using vector operations, bit masking operations, and bitwise logical operations. The need for conditional statements in SIMD code is thereby removed, allowing SIMD hardware to avoid having to use branch prediction. This reduces the number of pipeline stalls and results in increased utilization of the SIMD computational units.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 4 · Forward citations: 10.
Claims (1 — 1 Independent, 0 Dependent)
- Claim 1Independent Claim
A computer-implemented method to avoid pipeline stalls associated with conditional statements in scalar source code by converting the conditional statements into at least bitwise vector operations, the method comprising: receiving the scalar source code containing a conditional statement, wherein each branch of the conditional statement specifies: (i) a scalar data structure and (ii) a scalar operation operating on the scalar data structure; generating vector masking source code from the received scalar source code by operation of one or more computer processors and to avoid pipeline stalls as
Technical Overview & Description
Full multi-page specification text is archived at the issuing office. Read complete official specification ↗