rvp for rv32/rv64 - #2246
Conversation
|
For some reason, the CI was stuck as building step |
f935bb4 to
91cc12d
Compare
|
Update : 03/26/2026
|
91cc12d to
7dffa63
Compare
|
update: 03/26/2026
|
7dffa63 to
684b609
Compare
|
Several change in this version
|
684b609 to
f90d599
Compare
|
@chihminchao you might want to flatten the PR to a single commit to speed up CI iteration time, since the CI runs on every single commit. (In fact, it might be timing out because of the number of commits. I didn't check.) |
Ok, I will rebase and merge some of them to reduce CI running time. I am not aware that CI tries to build commit-by-commit. So rigorous. |
|
Yeah, the intent is to make |
f90d599 to
81f40fa
Compare
|
Update at 04/17/2026
|
81f40fa to
97b427c
Compare
|
Update : 2026/04/20 |
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
add the following categories * packed add/sub/pli instructions * packed cross instructions * packed absolute instructions * packed accumulation instructions * packed sign-extend and saturating instructions * packed shift instructions * packed compare instructions * packed pack instructions * packed basic arithmetic and data-move * packed multiply instructions * packed accumulate instructions * packed multiply-add instructions * RD-only element-wise register-pair
Add the following instructions to rv32 * packed add/sub register-pair instructions * packed cross register-pair instructions * packed absolute register-pair instructions * packed accumulation register-pair instructions * packed sign-extend and saturating * packed shift register-pair instructions * packed compare register-pair instructions * packed pack register-pair instructions * packed zip register-pair instructions * packed narrowing shift and clip register-pair * packed multiply register-pair instructions * packed accumulate register-pair instructions * packed multiply-add register-pair instructions
97b427c to
e9ff1db
Compare
Add the following categories * RD-only element-wise instructions (_w suffix * packed add/sub instructions (_w suffix only) * packed cross instructions (_wx suffix only) * packed accumulation instructions (_ws suffix * packed sign-extend and saturating instructions * packed shift instructions (_w/_ws suffix and * packed compare instructions (_w suffix only) * packed pack instructions (_h/_w suffix only) * rev_rv32/rev/rev16
e9ff1db to
c6bac21
Compare
Add the following categories * packed zip and unzip instructions * packed basic arithmetic and data-move * packed multiply instructions (_w suffix only) * packed accumulate instructions (_w suffix * packed multiply-add instructions (_w/_h suffix * packed sati/usati/srari for rv64 Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
The complete set of instructions added for RV32 are: PSSHL.HS SSHL PSSHL.DHS PSSHL.DWS PSSHLR.HS SSHLR PSSHLR.DHS PSSHLR.DWS And for RV64: PSSHL.HS PSSHL.WS SHL PNCLIPP.B PNCLIPP.H PNCLIPP.W PSSHLR.HS PSSHLR.WS SHLR PNCLIPUP.B PNCLIPUP.H PNCLIPUP.W reference: https://www.jhauser.us/RISCV/ext-P/RVP-instrEncodings-020.pdf https://www.jhauser.us/RISCV/ext-P/RVP-baseInstrs-Sail-020.txt Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Per the P-extension spec, any instruction that performs saturation must set the vxsat CSR to 1 when the result is clamped. 70 instructions were missing this write, addressed here in two ways: 1. Convert P_SAT, P_USAT, and P_USAT_FULL macros from pure expression macros to GCC statement expressions that detect when saturation occurs and write P.VU.vxsat. This automatically fixes ~42 instructions that use these macros (nclip/nclipi/nclipr/nclipri families, psati, psslai, pssh1sadd, pusati, sati, usati, ssh1sadd, sslai, and their packed/double-wide variants). 2. Add explicit vxsat writes to 22 instructions with inline saturation logic that bypasses the macros: - mulq/mulqr/pmulq/pmulqr: set vxsat on INT_MIN * INT_MIN overflow - psas/pssa cross variants: set vxsat from sat_add/sat_sub sat flag - pssha/psshar DW variants: set vxsat from ov overflow flag - pssha/psshar/ssha/sshar: set vxsat in sshamt >= BIT overflow path - pusati_dh/pusati_dw: set vxsat on unsigned range clamping Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
c6bac21 to
900b2e6
Compare
|
@aswaterman Finally, it passes CI and also needs riscv/riscv-opcodes#414 for opcode fix |
…_INT128 Replace bare __int128 / unsigned __int128 in psshar_dhs.h and psshar_dws.h with the int128_t / uint128_t typedefs from fesvr/byteorder.h, and guard the entire riscv_insn_ext_p list in riscv.mk.in with $(if $(HAVE_INT128),...) matching the existing pattern for the V extension Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
900b2e6 to
f2aa295
Compare
|
update: 2026/04/29
|
The PR merges the works, #2210 and #2211 and the main author is @jason01180118. The changes from me are