Skip to content

[Zvdot4a8i] Extension for vector dot product (4-element, 8-bit integer) Version 0.1#2576

Draft
nibrunieAtSi5 wants to merge 11 commits intoriscv:mainfrom
nibrunieAtSi5:zvdot
Draft

[Zvdot4a8i] Extension for vector dot product (4-element, 8-bit integer) Version 0.1#2576
nibrunieAtSi5 wants to merge 11 commits intoriscv:mainfrom
nibrunieAtSi5:zvdot

Conversation

@nibrunieAtSi5
Copy link
Copy Markdown
Contributor

@nibrunieAtSi5 nibrunieAtSi5 commented Jan 17, 2026

Specification of a new vector ISA extension for constant size (4D) vector dot product of integers (for now limited to 8-bit values).

This PR imports changes made by @kdockser and others in https://github.com/riscv/riscv-dot-product from the standalone repo to riscv-isa-manual. It also implements ARC's feedback.

Importing the work done by Ken Docker and others in service of https://riscv.atlassian.net/browse/RVS-1971
from https://github.com/riscv/riscv-dot-product into the official riscv-isa-manual repo.

Changelog:
* Concatenating all asciidoc file into a single chapter
* Modifying chapter/section/sub-section levels to match the RISC-V ISA manual hierarchy.
* Importing encoding png pictures and svg diagram (encodings will need to be inlined)
Copy link
Copy Markdown
Member

@aswaterman aswaterman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least superficially this looks good. I think it's time to push it to the next stage in the process.

==== vdota4.[vv,vx]

Synopsis::
Vector 8-bit Signed-Signed Dot Product
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this mention that 4 elements are accmulated together? That would be more important if more SEWs become supported.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this say SEW/4-bit to match the vdota4u synopsis?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I think we could actually get rid of the SEW/4 mentions in the Title and Synopsys (the appear) later and focus on the fact that those are 4-element Dot Product Accumulates

whereas each `SEW`-bit element of `vd` is interpreted as a single `SEW`-bit signed integer.
For each pair of elements taken consecutively from `vs1` and `vs2`,
the associated sub-element lists are multiplied componentwise,
widening (with sign-extension) to `SEW` bits.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this sentence be updated to say that vs1 is zero extended and vs2 is signed extended. Currently, the stence is identical to vdota4.

Copy link
Copy Markdown
Contributor Author

@nibrunieAtSi5 nibrunieAtSi5 Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we always perform sign extension on the products (since this is signed-unsigned, the products are signed and must be sign extended).
The difference with respect to vdot4a is actually on the signedness of the product operands, so if we need to make a change it would be on the previous sentence (or mention that the products are signed values).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Re-reading that sentence it is just talking about widening the products before adding them together. It's not stated that the products are SEW/2 bits wide.

Co-authored-by: Craig Topper <craig.topper@sifive.com>
Signed-off-by: Nicolas Brunie <82109999+nibrunieAtSi5@users.noreply.github.com>
@4vtomat
Copy link
Copy Markdown

4vtomat commented Jan 23, 2026

A question about naming, is there a specific reason tha we don't use zvdot32a8i as we have 32 bits accumulator? We have same scanerio in zvmm or xsfmm that number before a(accumulator) is accumulator size, e.g. xsfmm32a8i.

@aswaterman
Copy link
Copy Markdown
Member

aswaterman commented Jan 23, 2026

I would parse the name as "4-input dot product, with accumulation, of 8-bit integers". It's not that it's inconsistent with the matrix extensions; it's that the fixed-input dot-product instructions have a different naming scheme than the matrix extensions for legitimate reasons. I would argue that for a dot product with a fixed number of inputs, including that number in the name is more important.

(The accumulator being 32 bits is implied by the fact that this is a non-widening instruction, so the output elements are the same size as the input elements, i.e. 4x8.)

@topperc
Copy link
Copy Markdown
Contributor

topperc commented Jan 26, 2026

Is there a version number be we can use in toolchains? The 0.0.1 version in the existing spec for Zvqdotq has been giving us trouble in the toolchain riscv/riscv-dot-product#11

Signed-off-by: Nicolas Brunie <82109999+nibrunieAtSi5@users.noreply.github.com>
@nibrunieAtSi5 nibrunieAtSi5 changed the title [Zvdot4a8i] Extension for vector dot product (4D, 8-bit integer) [Zvdot4a8i] Extension for vector dot product (4D, 8-bit integer) Version 0.1 Jan 27, 2026
@nibrunieAtSi5
Copy link
Copy Markdown
Contributor Author

Is there a version number be we can use in toolchains? The 0.0.1 version in the existing spec for Zvqdotq has been giving us trouble in the toolchain riscv/riscv-dot-product#11

I have added an implicit version number 6b0d5ef

This bumps it up from the original 0.0.1 (@aswaterman that the renaming mandated such a change anyway)

It seems the 4D term was confusing so we are renaming the extension to

Zvodt4a8i Vector 4-element Dot Product of packed 8-bit Integers
4vtomat added a commit to 4vtomat/llvm-project that referenced this pull request Feb 3, 2026
@nibrunieAtSi5 nibrunieAtSi5 changed the title [Zvdot4a8i] Extension for vector dot product (4D, 8-bit integer) Version 0.1 [Zvdot4a8i] Extension for vector dot product (4-element, 8-bit integer) Version 0.1 Feb 13, 2026
4vtomat added a commit to llvm/llvm-project that referenced this pull request Feb 24, 2026
The renaming PR is here:
riscv/riscv-isa-manual#2576
Note that this also update the version number.
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Feb 24, 2026
The renaming PR is here:
riscv/riscv-isa-manual#2576
Note that this also update the version number.
Co-authored-by: Nicolas Brunie <82109999+nibrunieAtSi5@users.noreply.github.com>
Signed-off-by: Nicolas Brunie <82109999+nibrunieAtSi5@users.noreply.github.com>
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.

6 participants