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

Vector integer add-with-carry/subtract-with-borrow instructions missing mask as a source #14

Open
kathlenemagnus opened this issue Jul 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@kathlenemagnus
Copy link
Collaborator

The vadc and vsbc vector instructions are not being decoded correctly. These instructions always enable masking and opcodes where masking is disabled are not supported. To support this in Mavis, the vm field is marked as a fixed field, but Mavis assumes that to mean that masking is disabled.

To test a fix, the opcode 0x403100D7 should print this disassembly (mask register v0 included):

vadc.vvm v1,v2,v3,v0.t
@kathlenemagnus kathlenemagnus added the bug Something isn't working label Jul 24, 2024
@kathlenemagnus
Copy link
Collaborator Author

@h0lyalg0rithm here is a Mavis issue you can look it. If you look in https://github.com/sparcians/mavis/blob/main/json/isa_rv64v.json you can see how this instruction is defined:

  {
    "mnemonic": "vadc.vvm",
    "tags" : ["v"],
    "form": "V",
    "stencil": "0x40000057",
    "fixed": [ "vm" ],
    "type": [ "vector" ],
    "v-oper": "all"
  },

The stencil defines which bits in an opcode are always set for a particular instruction like the opcode and funct fields. My understanding of the "fixed" fields list is that these are fields that are also always the same. So for this instruction, the VM field is always set to 0. An opcode with the VM bit set to 1 would not be decoded as this instruction. Normally, the VM field is accessible as a "special field", but when it is marked as fixed it is no longer consider a special field of the instruction and its value cannot be accessed.

I don't totally understand how the fixed and special fields work, so please share anything you learn!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant