simd-intrinsics

Diagnose non-vectorized loops and implement x86 SSE/AVX and ARM NEON intrinsics.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/awfixers-stuff/opencode-config --skill simd-intrinsics-awfixers-stuff
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: simd-intrinsics
Source: https://github.com/awfixers-stuff/opencode-config/tree/main/skills/simd-intrinsics
Command: npx skills add https://github.com/awfixers-stuff/opencode-config --skill simd-intrinsics-awfixers-stuff

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Provides practical guidance to diagnose why loops are not being auto-vectorized and to implement efficient SIMD intrinsics for x86 (SSE/AVX) and ARM (NEON), so developers can reliably extract vector performance from hot code paths.

Core Features & Use Cases

  • Vectorization diagnosis: How to read compiler vectorization remarks and common reasons a loop was not vectorized, with actionable fixes such as adding restrict, removing data-dependent exits, and hinting trip counts.
  • Runtime CPU feature detection and dispatch: Patterns for using compiler builtins, CPUID, and attribute-based or.ifunc dispatch to select SSE/AVX/NEON paths at runtime.
  • Intrinsics recipes: Example implementations and idioms for SSE2, AVX2, and NEON including aligned vs unaligned loads, FMA usage, horizontal reductions, and integer operations, plus alignment and allocation advice.
  • Decision guidance: When to rely on compiler auto-vectorization versus writing intrinsics, and how to verify correctness and measure performance impact with profiling.
  • Use case: Speed up an image processing or numeric kernel by diagnosing why the compiler missed vectorization, then apply targeted intrinsics or small code changes to achieve a stable speedup.

Quick Start

Use the simd-intrinsics skill to analyze compiler vectorization remarks for a hot loop, suggest specific code or flag changes to enable auto-vectorization, and produce matching SSE/AVX or NEON intrinsic snippets.

Frequently Asked Questions about simd-intrinsics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does the compiler fail to auto-vectorize my loop and how can I fix it?▼

Auto-vectorization often fails due to data-dependent loop exits or missing restrict hints. You can fix it by reading compiler vectorization remarks, adding alignment hints, and removing early exits to allow stable SIMD vectorization.

How do I implement AVX2 and NEON intrinsics for a numeric processing kernel?▼

You can implement AVX2 and NEON intrinsics by applying specific recipes for aligned loads, FMA usage, and horizontal reductions. This provides direct vector instructions to execute math operations on multiple data points simultaneously.

What is the best way to detect CPU features and dispatch SIMD instructions at runtime?▼

Runtime CPU feature detection uses builtins, CPUID, and attribute-based or .ifunc dispatch to select appropriate SSE, AVX, or NEON code paths dynamically, ensuring safe execution across varied hardware architectures.

When should I write SIMD intrinsics manually instead of relying on compiler auto-vectorization?▼

You should write SIMD intrinsics manually when compiler auto-vectorization fails to optimize complex hot code paths. Use profiling to verify correctness and measure performance impact before replacing auto-vectorized loops with explicit intrinsics.

How do I read compiler vectorization remarks to diagnose unvectorized code?▼

Compiler vectorization remarks detail why a loop was skipped for SIMD optimization. Reading these remarks helps identify missing restrict qualifiers or data dependencies, enabling targeted code changes to trigger auto-vectorization.