GitHub

sidebar_position: 3

SpacemiT AI Matrix Extension Instruction Set

Zvvm_spacemit Profile

Version: 0.6 Status: Public Release Last Updated: 2026.04.13

Table of Contents

Chapter 1 Overview

1.1 Design Features

Matrix multiplication is a fundamental workload in machine learning and AI applications. Traditional matrix acceleration designs often introduce a dedicated matrix register file to improve data throughput. However, this approach also increases architectural state, context-switch overhead, and software stack complexity.

The Zvvm / IME matrix extension adopts a different design philosophy. Instead of introducing new register files, it reuses the 32 vector registers defined in the RISC-V V extension. One-dimensional vector layouts are reinterpreted as two-dimensional matrix tiles, enabling higher computational density without expanding architectural state.

Based on this concept, SpacemiT has developed the SpacemiT AI Matrix Extension Instruction Set, which has already been implemented across two generations of compute chips.

This instruction set maintains good compatibility across RISC-V processors with different VLEN configurations while achieving high compute utilization. It is built on top of the RISC-V Vector programming model, reusing the vector register file and control semantics. At the same time, it introduces matrix computation capabilities with minimal disruption to the existing RVV software ecosystem.

Key design features include:

  • Reuses the existing vector register file to represent 2D matrix tiles
  • Provides matrix multiplication capability without introducing a dedicated matrix register file
  • Native support for common AI data types such as Int4, Int8, FP16, and BF16
  • Includes specialized matrix multiplication instructions for convolution, sparse computation, and block quantization
  • Provides data layout transformation instructions for rearranging vector register contents
  • Evolves in alignment with community extensions such as IME, Zvvm, and Zvzip, sharing similar design principles

1.2 Instruction Set Capabilities

The SpacemiT AI Matrix Extension instruction set can be categorized into seven classes:

  1. Integer matrix multiplication instructions
  2. Floating-point matrix multiplication instructions
  3. Integer sliding-window matrix multiplication for convolution
  4. Floating-point sliding-window matrix multiplication for convolution
  5. Integer matrix multiplication for block quantization
  6. 4:2 structured sparse integer matrix multiplication
  7. Data layout transformation instructions

Including variations for operand signedness and convolution-specific variants, the instruction set defines a total of 46 custom instructions for AI workloads.

1.3 Recommended Reading Order

For readers new to the SpacemiT Matrix Extension, the following reading order is recommended:

  1. Chapter 2 — Understand register constraints, supported LMUL range, and global control fields
  2. Chapter 4 — Get an overview of sub-extensions and instruction categories
  3. Chapters 5–7 — Study instruction semantics by category
  4. Chapter 8 — Review instruction encodings and map them to the semantics

1.4 Unified Matrix Semantics Notation

A typical operation in the SpacemiT AI Matrix Extension is:

Read the original on github.com ↗