Skip to content

Add Zcmp extension#1026

Open
SamuelRiedel wants to merge 4 commits intochipsalliance:masterfrom
SamuelRiedel:zcmp-extension
Open

Add Zcmp extension#1026
SamuelRiedel wants to merge 4 commits intochipsalliance:masterfrom
SamuelRiedel:zcmp-extension

Conversation

@SamuelRiedel
Copy link
Copy Markdown
Contributor

@SamuelRiedel SamuelRiedel commented Dec 18, 2025

This PR adds support for the Zcmp extension, which introduces cm.push/pop and double move (cm.mv) instructions.

Because the push/pop instructions modify multiple registers and have significant side effects, this PR implements a specialized test class to generate valid sequences in a dedicated instruction stream. This class builds blocks of push and pop instructions that operate within a given stack size. Multiple blocks are generated and linked in a random order, using popret/popretz instructions to jump between them.

Note: This PR depends on PRs #1024 and #1025 and should be rebased and merged after they land. New changes from this PR: review only new commits

Those tests are used in Ibex's verification: lowRISC/ibex#2324

@SamuelRiedel SamuelRiedel marked this pull request as ready for review December 18, 2025 12:05
@SamuelRiedel SamuelRiedel mentioned this pull request Dec 18, 2025
Those registers overwrite registers other than the `rd` register. This
can lead to infinite loops. This ensures that we don't use any loop
registers for all registers modified by those instructions.
Since the push/pop instructions have so many side effects, test them in
a dedicated instruction stream. This class builds blocks of push and pop
instructions, which operate withing a given stack size. Multiple such
blocks are generated and linked in a random order. To jump between these
blocks, we use the popret/popretz instructions.
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Apr 13, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

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