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

doubt with vector masking register instruction #1706

Open
deepaannnavi opened this issue Jun 24, 2024 · 0 comments
Open

doubt with vector masking register instruction #1706

deepaannnavi opened this issue Jun 24, 2024 · 0 comments

Comments

@deepaannnavi
Copy link

deepaannnavi commented Jun 24, 2024

This is the code i have return : trying to work with simple vadd, vsub and vrsub with masking register v0.
image

here is the input data
image

here is the disassembly file
image

here is the output:
image
can any one explain how this masking register works?
Like i have given the inputs as:
1st operand : 2
2nd operand : -1
masking register : 3

From my understanding if the masking register is 3(binary:11), last 2 element result will be calculated and all the other element result will be zero. if the masking register is 4 ( binary : 1111), last 4 element result will be calculated and all other element result will be zero.

The input i have given here is
operand 1 (v4) - 0x00000000000000000000000000000000000000000000000a000000000000000900000000000000080000000000000007000000000000000f0000000100000003
operand2 (v8) - 0x000000000000000a000000000000000900000000000000080000000000000007000000000000000600000000000000050000000000000004ffffffffffffffff
masking register(v0) -0x00000000000000000000000000000000000000000000000a000000000000000900000000000000080000000000000007000000000000000f0000000000000003

The expected output from my understanding:

Add_output (v16)- 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff00000001
sub_output (v28)- 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000003

But the output i get here is Add_output(v16)-0x00000000000000000000000000000000000000000000000a000000000000000900000000000000080000000000000007000000000000000fffffffff00000001
sub_output(v28)- 0x00000000000000000000000000000000000000000000000a000000000000000900000000000000080000000000000007000000000000000f0000000100000003
where the last 2 element having the correct output and remaining element are being copied from the v0 register(masking register)

can anyone tell me whether my understanding is correct or not.
if it is correct, kindly tell me what is the problem exactly that i get a output different(whether i should reinstall my spike ? or whether input format i am giving to the masking register is wrong?)

if my understanding is wrong, kindly explain me how it works.

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

1 participant