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

Add support for the Zvkg extension #241

Open
wants to merge 9 commits into
base: vector-dev
Choose a base branch
from

Conversation

charmitro
Copy link

Implements the Zvkg (Vector GCM/GMAC) extension, as of version Draft: 20230303

The following instructions are included:

  • vghsh.vv
  • vgmul.vv

All instructions were tested with VLEN & ELEN being manually adjusted; results were compared with QEMU results of each instruction.

Current revision is rebased with the latest changes of vector-dev branch.

XinlaiWan and others added 3 commits March 22, 2023 09:01
…iscv#191)

* V extension general framework and configuration setting instructions

* Update model/riscv_insts_vext_utils.sail

fix a typo

Co-authored-by: Nicolas Brunie <[email protected]>
Signed-off-by: BrighterW <[email protected]>

* Update model/riscv_insts_vext_vset.sail

* Revisions after Nov 22 meeting

* Update effect matching for functions in riscv_vlen.sail

* Fix code formatting issues

* Update model/riscv_insts_vext_utils.sail

Co-authored-by: Jessica Clarke <[email protected]>
Signed-off-by: Xinlai Wan <[email protected]>

* Fix coding style issues

* Update vset instructions

Signed-off-by: BrighterW <[email protected]>
Signed-off-by: Xinlai Wan <[email protected]>
Co-authored-by: Nicolas Brunie <[email protected]>
Co-authored-by: Jessica Clarke <[email protected]>
* Add vector load / store instructions

* Modify the implementation of SEW, LMUL, VLEN and avoid real numbers in the code

* Update vstart setting in vector load / store instructions

* Remove unnecessary assert statements in vector instructions

* Fix bugs in vleff instructions and revise coding styles

* Add guards for vector encdec clauses, Avoid redundant memory access after vector load/store failure
* Add vector arithmetic & mask instructions

* Update vector EEW and EMUL checking function

* Add vector instruction illegal check functions

* Adjust code formatting for vector instruction illegal check functions

Merge approved by team at tech-golden-model meeting on 2023-03-14.
@charmitro
Copy link
Author

Updated the PR:

  • Correction on iterating based on the specification
  • Correctly Load & Store from/to vector registers

This update is adjusting the implementation to match the Spike implenentation and as a follow-up, ACT Signatures matching.

* Add vector floating-point instructions

* Update vector floating-point conversion instructions

* Update copyright headers for vector extension code

---------

Co-authored-by: xwan <[email protected]>
@charmitro charmitro force-pushed the cmitrodimas/zvkg branch from 754fa04 to 99a80a9 Compare May 4, 2023 13:42
@charmitro
Copy link
Author

Rebased from vector-dev branch.

model/riscv_insts_zvkg.sail Outdated Show resolved Hide resolved
model/riscv_insts_zvkg.sail Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Jun 6, 2023

Unit Test Results

712 tests  ±0   712 ✔️ ±0   0s ⏱️ ±0s
    6 suites ±0       0 💤 ±0 
    1 files   ±0       0 ±0 

Results for commit 220da54. ± Comparison against base commit 5872908.

♻️ This comment has been updated with latest results.

XinlaiWan and others added 3 commits June 12, 2023 14:28
* Add vector mask and reduction instructions

* Fix register overlap check in vector mask instructions

---------

Co-authored-by: xwan <[email protected]>
Charalampos Mitrodimas added 2 commits July 11, 2023 09:30
VGHSH.VV: Add-Multiply over GHASH Galois-Field
  This instruction treats all inputs and outputs as 128-bit
  polynomials and performs operations over GF[2]. The next
  partial hash(Y[i+1]) is produced by adding the current partial
  hash(Y[i]) to the cipher text block and then multiplying this
  sum by the Hash Subkey(H).

  Since the bits in the bytes are reversed, this instruction
  internally performs a bit swap within bytes to put the bits
  in the standard ordering.

VGMUL.VV: Vector Multiply over GHASH Galois-Field
  Same as vghsh.vv, this instruction treats all inputs and
  outputs as 128-bit polynomials and performs operations
  over GF[2].
  The multiplication is a caryless multiply of two 128-bit
  polynomials modulo GHASH's irreducible polynomial.

  Since the bits in the bytes are reversed, this instruction
  internally performs a bit swap within bytes to put the bits
  in the standard ordering.

Signed-off-by: Charalampos Mitrodimas <[email protected]>
Signed-off-by: Charalampos Mitrodimas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension Adds support for a RISC-V extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants