RISCV - 4 ISA 扩展名命名约定
- 1 Case Sensitivity
- 2 Base Integer ISA
- 3 Instruction-Set Extension Names
- 4 Version Numbers
- 5 Underscores
- 6 Additional Standard Extension Names
- 7 Supervisor-level Instruction-Set Extensions
- 8 Hypervisor-level Instruction-Set Extensions
- 9 Machine-level Instruction-Set Extensions
- 10 Non-Standard Extension Names
- 11 Subset Naming Convention
RISCV - 1 RV32/64G指令集清单
RISCV - 2 “Zicsr“, CSR Instructions
RISCV -3 RV32I/RV64I基本整型指令集
该文源于RISCV的《The RISC-V Instruction Set
Manual: Volume I》,文档的链接为:https://github.com/riscv/riscv-isa-manual/releases/tag/riscv-isa-release-1239329-2023-05-23
This chapter describes the RISC-V ISA extension naming scheme that is used to concisely describe the set of instructions present in a hardware implementation, or the set of instructions used by an application binary interface (ABI).
本章介绍 RISC-V ISA 扩展命名方案,该方案用于简明地描述硬件实现中存在的指令集或应用程序二进制接口 (ABI) 使用的指令集。
The RISC-V ISA is designed to support a wide variety of implementations with various experimental instruction-set extensions. We have found that an organized naming scheme simplifies software tools and documentation.
RISC-V ISA 旨在支持具有各种实验性指令集扩展的各种实现。我们发现有组织的命名方案可以简化软件工具和文档。
1 Case Sensitivity
The ISA naming strings are case insensitive.
ISA 命名字符串不区分大小写。
2 Base Integer ISA
RISC-V ISA strings begin with either RV32I, RV32E, RV64I, or RV128I indicating the supported address space size in bits for the base integer ISA.
RISC-V ISA 字符串以 RV32I、RV32E、RV64I 或 RV128I 开头,指示基本整型 ISA 支持的地址空间大小(以位为单位)。
3 Instruction-Set Extension Names
Standard ISA extensions are given a name consisting of a single letter. For example, the first four standard extensions to the integer bases are: “M” for integer multiplication and division, “A” for atomic memory instructions, “F” for single-precision floating-point instructions, and “D” for double-precision floating-point instructions. Any RISC-V instruction-set variant can be succinctly described by concatenating the base integer prefix with the names of the included extensions, e.g., “RV64IMAFD”.
标准 ISA 扩展的名称由单个字母组成。例如,整数基数的前四个标准扩展是:“M”表示整数乘法和除法,“A”表示原子内存指令,“F”表示单精度浮点指令,“D”表示双精度浮点指令。任何 RISC-V 指令集变体都可以通过将基本整数前缀与所包含扩展的名称连接起来来简洁地描述,例如“RV64IMAFD”。
We have also defined an abbreviation “G” to represent the “IMAFDZicsr Zifencei” base and extensions, as this is intended to represent our standard general-purpose ISA.
我们还定义了缩写“G”来代表“IMAFDZicsr Zifencei”基础和扩展,因为这旨在代表我们的标准通用 ISA。
Standard extensions to the RISC-V ISA are given other reserved letters, e.g., “Q” for quad-precision floating-point, or “C” for the 16-bit compressed instruction format.
RISC-V ISA 的标准扩展被赋予了其他保留字母,例如,“Q”表示四精度浮点,或“C”表示 16 位压缩指令格式。
Some ISA extensions depend on the presence of other extensions, e.g., “D” depends on “F” and “F” depends on “Zicsr”. These dependences may be implicit in the ISA name: for example, RV32IF is equivalent to RV32IFZicsr, and RV32ID is equivalent to RV32IFD and RV32IFDZicsr.
一些 ISA 扩展依赖于其他扩展的存在,例如,“D”依赖于“F”,“F”依赖于“Zicsr”。这些依赖性可能隐含在 ISA 名称中:例如,RV32IF 相当于 RV32IFZicsr,RV32ID 相当于 RV32IFD 和 RV32IFDZicsr。
4 Version Numbers
Recognizing that instruction sets may expand or alter over time, we encode extension version numbers following the extension name. Version numbers are divided into major and minor version numbers, separated by a “p”. If the minor version is “0”, then “p0” can be omitted from the version string. Changes in major version numbers imply a loss of backwards compatibility, whereas changes in only the minor version number must be backwards-compatible. For example, the original 64-bit standard ISA defined in release 1.0 of this manual can be written in full as “RV64I1p0M1p0A1p0F1p0D1p0”, more concisely as “RV64I1M1A1F1D1”.
认识到指令集可能会随着时间的推移而扩展或改变,我们在扩展名称后面对扩展版本号进行编码。版本号分为主版本号和次版本号,以“p”分隔。如果次要版本为“0”,则可以从版本字符串中省略“p0”。主版本号的更改意味着向后兼容性的丧失,而仅次版本号的更改必须向后兼容。例如,本手册1.0版本中定义的原始64位标准ISA可以完整写为“RV64I1p0M1p0A1p0F1p0D1p0”,更简洁地写为“RV64I1M1A1F1D1”。
We introduced the version numbering scheme with the second release. Hence, we define the default version of a standard extension to be the version present at that time, e.g., “RV32I” is equivalent to “RV32I2”.
我们在第二个版本中引入了版本编号方案。因此,我们将标准扩展的默认版本定义为当时存在的版本,例如“RV32I”相当于“RV32I2”。
5 Underscores
Underscores “ ” may be used to separate ISA extensions to improve readability and to provide disambiguation, e.g., “RV32I2 M2 A2”.
下划线“ ”可用于分隔 ISA 扩展,以提高可读性并提供消歧功能,例如“RV32I2_M2_A2”。
Because the “P” extension for Packed SIMD can be confused for the decimal point in a version number, it must be preceded by an underscore if it follows a number. For example, “rv32i2p2” means version 2.2 of RV32I, whereas “rv32i2 p2” means version 2.0 of RV32I with version 2.0 of the P extension.
由于包装SIMD的“ P”扩展名可能会在版本号中的小数点混淆,因此,如果遵循一个数字,则必须先于下划线。例如,“ RV32I2P2”是指rv32i的2.2版,而“ RV32I2_P2”是指RV32I的2.0版,其版本为P Extension 2.0版。
![](/qrcode.jpg)
6 Additional Standard Extension Names
Standard extensions can also be named using a single “Z” followed by an alphabetical name and an optional version number. For example, “Zifencei” names the instruction-fetch fence extension described in Chapter 3; “Zifencei2” and “Zifencei2p0” name version 2.0 of same.
标准扩展也可以使用单个“Z”后跟字母名称和可选版本号来命名。例如,“Zifencei”命名了第 3 章中描述的取指令栅栏扩展; “Zifencei2”和“Zifencei2p0”名称相同的2.0版本。
The first letter following the “Z” conventionally indicates the most closely related alphabetical extension category, IMAFDQLCBJTPVN. For the “Zam” extension for misaligned atomics, for example, the letter “a” indicates the extension is related to the “A” standard extension. If multiple “Z” extensions are named, they should be ordered first by category, then alphabetically within a category—for example, “Zicsr Zifencei Zam”.
“Z”后面的第一个字母通常表示最密切相关的字母扩展类别 IMAFDQLCBJTPVN。例如,对于未对齐原子的“Zam”扩展,字母“a”表示该扩展与“A”标准扩展相关。如果命名了多个“Z”扩展名,则应首先按类别对它们进行排序,然后在类别内按字母顺序排列,例如“Zicsr_Zifencei_Zam”。
Extensions with the “Z” prefix must be separated from other multi-letter extensions by an underscore, e.g., “RV32IMACZicsr_Zifencei”.
带有“Z”前缀的扩展名必须用下划线与其他多字母扩展名分开,例如“RV32IMACZicsr_Zifencei”。
7 Supervisor-level Instruction-Set Extensions
Standard supervisor-level instruction-set extensions are defined in Volume II, but are named using “S” as a prefix, followed by an alphabetical name and an optional version number. Supervisor-level extensions must be separated from other multi-letter extensions by an underscore.
标准管理者级指令集扩展在卷 II 中定义,但使用“S”作为前缀命名,后跟字母名称和可选版本号。主管级扩展必须用下划线与其他多字母扩展分开。
Standard supervisor-level extensions should be listed after standard unprivileged extensions. If multiple supervisor-level extensions are listed, they should be ordered alphabetically.
标准管理者级扩展应列在标准非特权扩展之后。如果列出多个管理者级分机,则应按字母顺序排列。
8 Hypervisor-level Instruction-Set Extensions
Standard hypervisor-level instruction-set extensions are named like supervisor-level extensions, but beginning with the letter “H” instead of the letter “S”.
标准管理程序级指令集扩展的命名与管理程序级扩展类似,但以字母“H”而不是字母“S”开头。
Standard hypervisor-level extensions should be listed after standard lesser-privileged extensions. If multiple hypervisor-level extensions are listed, they should be ordered alphabetically.
标准虚拟机管理程序级扩展应列在标准较低特权扩展之后。如果列出了多个虚拟机管理程序级别的扩展,则应按字母顺序对它们进行排序。
9 Machine-level Instruction-Set Extensions
Standard machine-level instruction-set extensions are prefixed with the three letters “Zxm”.
标准机器级指令集扩展以三个字母“Zxm”为前缀。
Standard machine-level extensions should be listed after standard lesser-privileged extensions. If multiple machine-level extensions are listed, they should be ordered alphabetically.
标准机器级扩展应列在标准较低特权扩展之后。如果列出了多个机器级扩展,则应按字母顺序排列它们。
10 Non-Standard Extension Names
Non-standard extensions are named using a single “X” followed by an alphabetical name and an optional version number. For example, “Xhwacha” names the Hwacha vector-fetch ISA extension; “Xhwacha2” and “Xhwacha2p0” name version 2.0 of same.
非标准扩展使用单个“X”命名,后跟字母名称和可选版本号。例如,“Xhwacha”命名为 Hwacha 矢量提取 ISA 扩展; “Xhwacha2”和“Xhwacha2p0”名称相同的2.0版本。
Non-standard extensions must be listed after all standard extensions. They must be separated from other multi-letter extensions by an underscore. For example, an ISA with non-standard extensions Argle and Bargle may be named “RV64IZifencei Xargle Xbargle”.
非标准扩展必须列在所有标准扩展之后。它们必须通过下划线与其他多字母扩展名分隔。例如,具有非标准扩展名 Argle 和 Bargle 的 ISA 可能被命名为“RV64IZifencei_Xargle_Xbargle”。
If multiple non-standard extensions are listed, they should be ordered alphabetically
如果列出多个非标准扩展名,则应按字母顺序排列
11 Subset Naming Convention
Table 27.1 summarizes the standardized extension names.
表 27.1 总结了标准化扩展名称。
Table 27.1: Standard ISA extension names. The table also defines the canonical order in which extension names must appear in the name string, with top-to-bottom in table indicating first-to-last in the name string, e.g., RV32IMACV is legal, whereas RV32IMAVC is not.
表 27.1:标准 ISA 扩展名称。该表还定义了扩展名称必须出现在名称字符串中的规范顺序,表中从上到下表示名称字符串中从第一个到最后一个,例如,RV32IMACV 是合法的,而 RV32IMAVC 则不是。