Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification on VMSEQ Instruction Behavior (riscv vector spec1.0) #1808

Open
latifbhatti opened this issue Sep 15, 2024 · 1 comment
Open

Comments

@latifbhatti
Copy link

I am working with the vmseq.vv instruction and would like to confirm if my understanding is correct. Here's the scenario:

Vectors:
v10 = (10, 20, 32, 12)
v15 = (10, 36, 11, 12)
v30 = (62, 99, 68, 61)

Applying the instruction:
vmseq.vv v30, v10, v15

According to the vmseq instruction, the comparison produces a mask (1001) indicating that the first and last elements of v10 and v15 are equal. Based on this mask, the updated values of v30 should be:

v30 = (10, 99, 68, 12)

Could you please confirm if this result is correct?

@aswaterman
Copy link
Collaborator

The four LSBs of v30 will be set to 1001. The remaining bits are treated as tail-agnostic. So assuming those numbers are hexadecimal representations of byte elements, you might end up with something like

(69, 99, 68, 61) (i.e. only the first nibble of the first element was modified)

or

(f9, ff, ff, ff) (i.e. the tail-agnostic policy set all of the remaining bits to 1).

Spike uses the first policy.

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

No branches or pull requests

2 participants