riscv-vector

riscv-vector is a skill for Claude Code, Codex from mohitmishra786/low-level-dev-skills. It costs 136 tokens per session (2,804 once invoked), scanned A, original, MIT.

A guide to the RISC-V Vector extension, which lets RISC-V processors handle many data values with one instruction. It covers code that adapts to different hardware vector-register sizes.

In plain words
What is it for?
Use it to write vector intrinsics or assembly, choose element and register settings, inspect automatic vectorization, test with QEMU, and target the RVA23 processor profile.
Why use it?
Vector code can fail on processors with different vector lengths or use instructions the target does not support. This guide helps check compiler output and test such code even without RISC-V hardware.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to write vector intrinsics or assembly, choose element and register settings, inspect automatic vectorization, test with QEMU, and target the RVA23 processor profile.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mohitmishra786/low-level-dev-skills/riscv-vector
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mohitmishra786/low-level-dev-skills --skill riscv-vector
Clone the repo
git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for riscv-vector

README.md
[![agentmods](https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/riscv-vector/github.svg)](https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/riscv-vector)
Your own site
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/riscv-vector"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/riscv-vector/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for riscv-vector

Your own site · 80×15
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/riscv-vector"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/riscv-vector.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 136 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,804 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00136 $0.02804
Opus 5.5 $0.00054 $0.01122
Sonnet 5.5 $0.00027 $0.00561
Haiku 4.5 $0.00014 $0.00280

Measured 9d ago against content hash ed3a0d9e0b2f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

riscv-vector scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/low-level-programming/riscv-vector/SKILL.md · 201 lines

How it starts

The opening of the file, as written. The whole thing — 201 lines — stays where its author put it; the contents beside it link to each section on GitHub.

RISC-V Vector Extension (RVV 1.0)

Purpose

Guide agents through RVV 1.0 (checked with GCC 14.2, Clang 23.1 and QEMU 10): the vector-length-agnostic model, intrinsics and assembly, autovectorization, testing under QEMU, and the RVA23 profile.

Triggers

  • "How do I write SIMD code for RISC-V?"
  • "What do vsetvli, SEW and LMUL mean?"
  • "How do I test RVV code without RISC-V hardware?"
  • "Did the compiler vectorize my loop for RISC-V?"
  • "What is RVA23 and how do I target it?"
  • "Why does my RISC-V binary die with an illegal instruction?"

Workflow

1. The vector-length-agnostic model

RVV registers are VLEN bits wide, and VLEN is a property of the hardware (128 bits and up), not of the ISA. Code asks the hardware each iteration how many elements it may process:

Term Meaning
VLEN Bits per vector register (implementation-defined, power of two ≥ 128 for RVA23)
SEW Selected element width: e8, e16, e32, e64
LMUL Register grouping: m1, m2, m4, m8 (or fractional mf2...); m8 uses 8 registers as one
VLMAX VLEN / SEW * LMUL elements
vl Elements processed by the current instructions, set by vsetvli (≤ VLMAX)
ta, ma Tail/mask agnostic: inactive elements may be overwritten (faster)

The same binary runs on any VLEN: a loop strip-mines with vl = vsetvl(remaining) and needs no scalar tail. That is the main difference from fixed-width SSE/AVX/NEON code.

2. Intrinsics

/* saxpy.c — RVV 1.0 intrinsics: y = a*x + y, vector-length agnostic */
#include <riscv_vector.h>
#include <stddef.h>
#include <stdio.h>

void saxpy_rvv(size_t n, float a, const float *x, float *y)
{
    for (size_t vl; n > 0; n -= vl, x += vl, y += vl) {
        vl = __riscv_vsetvl_e32m8(n);                     /* elements this iteration */
        vfloat32m8_t vx = __riscv_vle32_v_f32m8(x, vl);   /* unit-stride load */
        vfloat32m8_t vy = __riscv_vle32_v_f32m8(y, vl);
        vy = __riscv_vfmacc_vf_f32m8(vy, a, vx, vl);      /* vy += a * vx */
        __riscv_vse32_v_f32m8(y, vy, vl);                 /* store */
    }
}

int main(void)
{
    enum { N = 1003 };                                    /* not a multiple of VLEN */
    static float x[N], y[N];
    for (int i = 0; i < N; i++) { x[i] = (float)i; y[i] = 1.0f; }
    saxpy_rvv(N, 2.0f, x, y);
    int bad = 0;
    for (int i = 0; i < N; i++) bad += y[i] != 2.0f * i + 1.0f;
    printf("VLENB=%zu bytes, e32m8 VLMAX=%zu, errors=%d\n",
           __riscv_vlenb(), __riscv_vsetvlmax_e32m8(), bad);
    return bad != 0;
}

Read the full file on GitHub · 201 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 201 lines · 136 tokens per session scan A ed3a0d9e0b2f

Subscribe to this mod's changes

riscv-vector is a skill published in the GitHub repository mohitmishra786/low-level-dev-skills (304 stars, last pushed 10d ago), licensed MIT. It adds 136 tokens to every session and 2,804 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-21.

Related

riscv-vector compared with skills from other repositories

riscv-vector next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
riscv-vectormohitmishra786/low-level-dev-skillsSkill30410d agoMITA136Claude Code, Codex
doca-argpNVIDIA/skillsSkill4.2k2d agoApache-2.0A277Claude Code
holoscan-module-lifecycleNVIDIA/skillsSkill4.2k2d agoApache-2.0A47Claude Code, Codex
moat-cuda-to-rocmamd/skillsSkill520yesterdayMITA190Claude Code
embedded-stm32Mindrally/skillsSkill3221mo agoApache-2.0A87Claude Code
embedded-firmware-devAmethystLuna/embedded-workbenchSkill362d agoMITA59Claude Code
c-cpp-devXCode-NLP/KodaSkillsSkill275d agoMITA93Claude Code, Codex