Skip to content

Conversation

@jason01180118
Copy link

See the previous PR #637

Hello, we’re the team from Programming Langauge Lab, NTHU (National Tsing-Hua University), Taiwan.

This PR implements all instructions in the latest P-Extension specification (link)

Branches are split for RV32 and RV64, since some instructions may conflict between architectures.

@arromanoff
Copy link
Collaborator

v0.9.12 is quite old. AFAIK P extension is not ratified and still under development (I've seen a very recent v0.11 update here). I am not really against this change but I am concerned about maintenance. Is P extension relatively stable now? I'm afraid I am lost on the subject of P extension standardization. Please correct me if I am wrong here

@chihminchao
Copy link
Contributor

Based on the reference link, the PR should use latest 0.18 spec located in jhauser's personal folder. I guess the 0.9.12 is a plus of final draft version, 0.9.11

@ChiaHuiSu
Copy link

ChiaHuiSu commented Jan 20, 2026

Hello all, the version number 0.9.12 is from Rich Fuler's talk(at 5:43) in RISC-V Summit 2025, North America, and it's the same as the latest 0.18 spec lacated jhauser's personal folder.

@arromanoff
Copy link
Collaborator

The versioning situation seems very confusing to me (0.12 / 0.9.12 / 0.92 / 0.18) but it actually looks like all of them are basically the same. I am still a little concerned about merging such often-changing extension. @aswaterman what are your thoughts on this? Is this the version of zpa you were talking about here?

@chihminchao
Copy link
Contributor

@jason01180118 There are some instructions having the same name but different encoding for rv32 and rv64. How is it handled in these PRs ?

ex: SATI/SRARI/USATI

@jason01180118
Copy link
Author

Since spike does not permit instructions with the same name but different encodings within a single target, we split the RV32 and RV64 implementations into separate branches.
For example, the encoding of SATI differs between RV64 and RV32:

RV64 (#2211 ): MATCH_SATI = 0xe400401b, MASK_SATI = 0xfc00707f

RV32 (#2210 ): MATCH_SATI = 0xe200401b, MASK_SATI = 0xfe00707f

@chihminchao
Copy link
Contributor

It is just my thinking to use different name sto tell them if the encoding doesn't be changed.
ex
sati_rv32, sati_rv64

@chihminchao
Copy link
Contributor

@jason01180118 There are some compilation warnings related to macro expansion

../riscv/p_ext_macros.h:335:25: warning: second operand of conditional expression has no effect [-Wunused-value]
  335 |       P_USAT(BIT, p_res); \
      |                         ^
../riscv/p_ext_macros.h:494:3: note: in expansion of macro ‘P_REDUCTION_ULOOP_END’
  494 |   P_REDUCTION_ULOOP_END(BIT, IS_SAT)
      |   ^~~~~~~~~~~~~~~~~~~~~
../riscv/insns/pabdsumau_b.h:1:1: note: in expansion of macro ‘P_REDUCTION_ULOOP’
    1 | P_REDUCTION_ULOOP(64, 8, true, false, {
      | ^~~~~~~~~~~~~~~~~
../riscv/p_ext_macros.h:335:19: warning: second operand of conditional expression has no effect [-Wunused-value]
  335 |       P_USAT(BIT, p_res); \
      |                   ^
../riscv/p_ext_macros.h:513:20: note: in definition of macro ‘P_USAT’
  513 |   ((BIT) == 64) ? (R) : \
      |                    ^
../riscv/p_ext_macros.h:494:3: note: in expan

It happens with gcc 11, 12 , and 13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants