Skip to content

Feat/zvbb bitmanip#465

Open
micprog wants to merge 3 commits into
mainfrom
feat/zvbb-bitmanip
Open

Feat/zvbb bitmanip#465
micprog wants to merge 3 commits into
mainfrom
feat/zvbb-bitmanip

Conversation

@micprog

@micprog micprog commented Jun 8, 2026

Copy link
Copy Markdown
Member

Add initial scaffold for RISC-V Vector Crypto instructions, add zvkb and zvbb extension support.

micprog and others added 3 commits June 8, 2026 17:16
Introduce the configuration mechanism for the RISC-V vector crypto
extensions ahead of the actual instruction implementations. This adds
the crypto_support_e enumeration to ara_pkg and threads a CryptoSupport
parameter (defaulting to CryptoSupportNone) through the full module
hierarchy: ara_soc -> ara_system -> ara -> {ara_dispatcher, lane ->
vector_fus_stage -> valu -> simd_alu}.

No instructions are implemented yet; subsequent commits enable specific
extensions by adding enum values, helper predicates, and datapath logic
gated on this parameter.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add the Zvkb (Vector Cryptography Bit-manipulation) extension, gated
behind the CryptoSupportBitmanip configuration. Implements the following
instructions in the SIMD ALU, with dispatch for .vv, .vx, and .vi
encodings:
- vandn.vv/vx: bitwise AND-with-complement
- vrol.vv/vx, vror.vv/vx/vi: element-wise rotate left/right
- vbrev8.v: bit-reverse within each byte
- vrev8.v: byte-reverse within each element (endian swap)

Adds a Zvkb() predicate over crypto_support_e, the new ALU op enums, and
a riscv-tests suite (zvkb.c) covering all instructions across
e8/e16/e32/e64 with masked variants. Enables zvkb in the LLVM and spike
ISA strings.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add the Zvbb (Vector Basic Bit-manipulation) extension on top of Zvkb,
gated behind the CryptoSupportBasicBit configuration. Since Zvbb implies
Zvkb, the Zvkb() predicate is widened to also match Zvbb. Adds:
- vbrev.v: full bit-reverse within each element
- vclz.v / vctz.v: count leading / trailing zeros
- vcpop.v: population count per element
- vwsll.vv/vx/vi: widening shift-left-logical, with per-operand LMUL
  alignment checks

Adds the supporting SIMD ALU helper functions and a riscv-tests suite
(zvbb.c) covering all instructions with masking variants. Switches the
toolchain and spike ISA strings from zvkb to zvbb (which subsumes it).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@micprog micprog requested a review from hopang-0221 June 8, 2026 15:48
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.

1 participant