What is a custom instruction?
A custom instruction is a machine instruction that is not part of the standard set of instructions of an instruction set architecture (ISA).
Typically it is specifically designed for the needs of a particular application or domain.
Implementing custom instructions usually requires modifications to the processor’s microarchitecture, as well as support from the software toolchain and programming languages to recognize and use these instructions. The availability and support for custom instructions depend on the specific processor architecture and the tools and development ecosystem associated with it.
The RISC-V instruction set architecture (ISA) is designed with extensibility in mind, allowing for the inclusion of custom instructions. One of the key features of RISC-V is its modular design, which enables the addition of custom instructions without modifying the base instruction set. The RISC-V ISA defines a base instruction set, referred to as the “RV32I” or “RV64I,” which provides a minimal set of instructions to ensure basic functionality. This base instruction set is intentionally kept small and simple to enable easy porting and implementation.
In addition to the base instruction set, RISC-V introduces a modular extension framework. This framework allows designers to add custom extensions to the base ISA, including custom instructions tailored to specific applications or domains. These custom extensions can range from specialized arithmetic operations to domain-specific instructions that accelerate certain tasks.
See our blog post on RISC-V customization, HW/SW co-optimization, and custom compute.