Skip to content

Remove pseudo_op to rv64_i for slli,srli,srai#355

Open
Avimitin wants to merge 1 commit intoriscv:masterfrom
Avimitin:rv32_i_fix
Open

Remove pseudo_op to rv64_i for slli,srli,srai#355
Avimitin wants to merge 1 commit intoriscv:masterfrom
Avimitin:rv32_i_fix

Conversation

@Avimitin
Copy link
Copy Markdown

Instructions slli,srli,srai have different bit pattern in rv32_i versus rv64_i. It is better to re-define them, and alias those _rv32 suffix instruction to rv32_i self specification.

Instructions slli,srli,srai have different bit pattern in rv32_i versus
rv64_i. It is better to re-define them, and alias those `_rv32` suffix
instruction to rv32_i self specification.
@Avimitin
Copy link
Copy Markdown
Author

Hi, I'm having some second thoughts on my current implementation and would appreciate your guidance.

The pseudo_op definition states that they "are instructions which are aliases of regular instructions. Their encodings force certain restrictions over the regular instruction." This got me thinking about a different way to handle the aliases for rv32 and rv64. My idea is to use the same pseudo-alias for the rv64_i instructions while removing the separate instructions that have the _rv32 suffix.

I'm trying to decide between my current implementation and this new approach. Do you have a preference, or could you offer any advice on which direction would be more consistent with the project's design? Any insights would be greatly appreciated. Thanks!

@sequencer
Copy link
Copy Markdown
Contributor

Based on the README, the semantic of pseudo is:

These are instructions which are aliases of regular instructions. Their encodings force certain restrictions over the regular instruction.

It means: the pseduo instruction can be covered by the original instruction.
For example, jalr can cover the ret encoding space, by constrains rs1 and imm to 0.
Generally, the pseduo instruction alias can provide to the hardware decoder with additional information for micro-architecture: for example, ret is special to pop from the RAS in the BPU.

So does the ?_rv32 mean a pseduo? I think it is, based on the pseduo semantic.
However, in this case, the original and pseudo instructions cannot live together, although the 32-bits version of these instructions are covered by 64-bits.

I think the true issue is the existence of the instructions with _rv32 suffix, which is actually the "old name" like fmv.x.s.

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.

2 participants