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

Clarification on .vx semantics #8

Open
preames opened this issue Dec 10, 2024 · 0 comments
Open

Clarification on .vx semantics #8

preames opened this issue Dec 10, 2024 · 0 comments

Comments

@preames
Copy link

preames commented Dec 10, 2024

The wording in the instruction reference for the .vx variants could stand to be clarified.

The instruction reference page says "The vector-scalar (.vx) variant reuses a single 32-bit element, read from integer register rs1, instead of a vector (vs1) of such elements.". I had originally read this to mean that the scalar was broadcast to all input lanes, and then incorporated into the quad-wise summation.

After reading other parts in more depth, it's clear this is not the intended semantic. In particular, Figure 1 seems to indicate each byte in the 32b scalar input is repeated in an alternating fashion. This also seems to match the pseudo code given for the operation.

A possible suggestion on rewording would be something along the lines of the following:
"The vector-scalar (.vx) variant reuses a single 32-bit element, read from integer register rs1. As with the .vv variant, the 32-bit element is interpreted as a list of four 8-bit signed integer sub-elements. The 32-bit element is implicitly broadcast to each SEW lane of the input."

Or, if you don't want to try to message the English text, you could say:
"The vector-scalar (.vx) variant reuses a single 32-bit element, read from integer register rs1 in the manner shown in Figure 1, instead of a vector (vs1) of such elements "

Beyond the clarification in wording, can I inquire as to why this data format was chosen? It seems like the common case would be applying the same offset to all (input, SEW=8) lanes, and this data format will require packing of 4 identical copies of the byte value into the scalar register.

@preames preames changed the title Clarification on vx semantics Clarification on .vx semantics Dec 10, 2024
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