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 1.0 Support VALU #167

Merged

Conversation

aarongchan
Copy link
Collaborator

@aarongchan aarongchan commented May 6, 2024

PR Goals:
Implement basic vector support for VALU operations, UOp generation for LMUL > 1, and vset support. The goal in this stage to design all necessary components to support a vadd.vv instruction with varying LMUL and SEW values set.

Documentation:
#89 (comment)

@aarongchan aarongchan requested a review from klingaard May 6, 2024 06:21
@aarongchan aarongchan self-assigned this May 6, 2024
@aarongchan aarongchan added the enhancement New feature or request label May 6, 2024
@aarongchan aarongchan marked this pull request as ready for review May 31, 2024 04:10
core/CPUTopology.cpp Outdated Show resolved Hide resolved
core/Decode.cpp Outdated Show resolved Hide resolved
core/Decode.cpp Outdated Show resolved Hide resolved
core/Decode.cpp Outdated Show resolved Hide resolved
core/Decode.cpp Outdated Show resolved Hide resolved
core/CoreTypes.hpp Outdated Show resolved Hide resolved
if (num_passes_needed_ == 0)
{
const uint32_t num_passes =
std::ceil((ex_inst->getVL() / ex_inst->getSEW()) / valu_adder_num_);
Copy link
Collaborator

@kathlenemagnus kathlenemagnus Jun 19, 2024

Choose a reason for hiding this comment

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

I think you mean VLEN here instead of VL. VL (vector length) is the number of elements that an instruction can process whereas VLEN is the size of the vector registers. So for example, if VLEN is 128 and SEW is 8 than a single vector uop contains 16 elements. For LMUL 1, the VL would be 16 but increasing the LMUL will multiply the VL. This code looks like it works, but the method names could be more clear.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed to VLEN in 73ca9f4. Added a conditional that will use VL if it is less the VLEN/SEW.

core/Fetch.cpp Outdated Show resolved Hide resolved
core/Inst.hpp Outdated Show resolved Hide resolved
@kathlenemagnus
Copy link
Collaborator

This is a lot of really great work @aarongchan!

@aarongchan
Copy link
Collaborator Author

@kathlenemagnus-mips I think you need to approve on your other account for me to be able to merge.

@aarongchan aarongchan merged commit 5658121 into riscv-software-src:master Jul 1, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants