前言:
本笔记是基于对RISC-V DSP扩展指令集文档总结的,《P-ext-proposal.pdf》文档的关键内容如下:
主要介绍了RISC-V的P扩展指令集及其相关细节。
首先,对P扩展指令进行了概述,并列出了其与其他扩展重复的指令。
接着,详细描述了P扩展的子集,包括Zbpbo扩展和Zpn扩展(适用于RV32和RV64)的指令。
此外,还提供了仅适用于RV64的详细指令描述。
文档还介绍了新的用户控制和状态寄存器,并提供了指令编码表。最后,列出了因RVB重叠而被移除的指令。
这份文档为RISC-V的P扩展指令集提供了全面而详细的信息,包括指令的描述、编码、以及与其他扩展的关系。这对于理解、开发和优化基于RISC-V架构的系统非常有价值。同时,文档也提醒了开发者在使用P扩展时需要注意的兼容性和优化问题。
【RISC-V 指令集】RISC-V DSP 扩展指令集介绍(一)-CSDN博客
3.2. 部分SIMD数据处理指令
3.2.1. 16位组包指令
Table 12. 16-bit Packing Instructions
序号 | 指令 | 说明 |
1 | PKBB16 rd, rs1, rs2 | Pack two 16-bit data from Bottoms |
2 | PKBT16 rd, rs1, rs2 | Pack two 16-bit data Bottom & Top |
3 | PKTB16 rd, rs1, rs2 | Pack two 16-bit data Top & Bottom |
4 | PKTT16 rd, rs1, rs2 | Pack two 16-bit data from Tops |
3.2.2. 最高有效字“32x32”乘法和加法指令
Table 13. Signed MSW 32x32 Multiply and Add Instructions
序号 | 指令 | 说明 |
1 | SMMUL rd, rs1, rs2 | MSW “32 x 32” Signed Multiplication (MSW 32 = 32x32) |
2 | SMMUL.u rd, rs1, rs2 | MSW “32 x 32” Signed Multiplication with Rounding (MSW 32 = 32x32) |
3 | KMMAC rd, rs1, rs2 | MSW “32 x 32” Signed Multiplication and Saturating Addition (MSW 32 = 32 + 32x32) |
4 | KMMAC.u rd, rs1, rs2 | MSW “32 x 32” Signed Multiplication and Saturating Addition with Rounding (MSW 32 = 32 + 32x32) |
5 | KMMSB rd, rs1, rs2 | MSW “32 x 32” Signed Multiplication and Saturating Subtraction (MSW 32 = 32 - 32x32) |
6 | KMMSB.u rd, rs1, rs2 | MSW “32 x 32” Signed Multiplication and Saturating Subtraction with Rounding (MSW 32 = 32 - 32x32) |
7 | KWMMUL rd, rs1, rs2 | MSW “32 x 32” Signed Multiplication & Double (MSW 32 = 32x32 << 1) |
8 | KWMMUL.u rd, rs1, rs2 | MSW “32 x 32” Signed Multiplication & Double with Rounding (MSW 32 = 32x32 << 1) |
3.2.3. 最高有效字“32x16”乘法和加法指令
Table 14. Signed MSW 32x16 Multiply and Add Instructions
序号 | 指令 | 说明 |
1 | SMMWB rd, rs1, rs2 | MSW “32 x Bottom 16” Signed Multiplication (MSW 32 = 32x16) |
2 | SMMWB.u rd, rs1, rs2 | MSW “32 x Bottom 16” Signed Multiplication with Rounding (MSW 32 = 32x16) |
3 | SMMWT rd, rs1, rs2 | MSW “32 x Top 16” Signed Multiplication (MSW 32 = 32x16) |
4 | SMMWT.u rd, rs1, rs2 | MSW “32 x Top 16” Signed Multiplication with Rounding (MSW 32 = 32x16) |
5 | KMMAWB rd, rs1, rs2 | MSW “32 x Bottom 16” Signed Multiplication and Saturating Addition (MSW 32 = 32 + 32x16) |
6 | KMMAWB.u rd, rs1, rs2 | MSW “32 x Bottom 16” Signed Multiplication and Saturating Addition with Rounding (MSW 32 = 32 + 32x16) |
7 | KMMAWT rd, rs1, rs2 | MSW “32 x Top 16” Signed Multiplication and Saturating Addition (MSW 32 = 32 + 32x16) |
8 | KMMAWT.u rd, rs1, rs2 | MSW “32 x Top 16” Signed Multiplication and Saturating Addition with Rounding (MSW 32 = 32 + 32x16) |
9 | KMMWB2 rd, rs1, rs2 | MSW “32 x Bottom 16” Saturating Signed Multiplication and double (MSW 3 |