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

i#3544 RV64: Preserve vtype and vl vector registers #7110

Merged
merged 15 commits into from
Dec 19, 2024

Conversation

mariospaok4
Copy link
Contributor

@mariospaok4 mariospaok4 commented Dec 9, 2024

This patch was authored at the Computer Architecture and VLSI Laboratory, Institute of Computer Science, Foundation of Research and Technology, Hellas.

It emits the necessary instructions that handle saving and restoring the vl and vtype during the context switches, when using the vector extension of the RISC-V ISA. This is required, in order to use the vector extension correctly.

Also corrected the order of append_restore_xflags and append_restore_simd_reg (in emit_utils_shared.c ) in order to have the restoration happen in the reverse order of the saving. This specific code is not currently used for RISC-V, but it might in the future.

Issue: #3544

mariospaok4 and others added 9 commits December 9, 2024 14:38
… vector extension.

This patch was authored at the Computer Architecture and VLSI Laboratory, Institute of Computer Sciense, Foundation of Reasearch and Technology, Hellas.
It emmits the necessary instructions that handle saving and restoring the vl and vtype during the context switches, when using the vector extension of the RISC-V ISA.
This is required, in order to use the use the vector extension correctly.
Accidentally tabs were used somewhere, replaced with spaces
@vflouris
Copy link
Contributor

Hi all this patch is absolutely essential for any meaningful rv64 vector code to work properly (otherwise it fails with illegal instruction). Can someone please review it?

@derekbruening
Copy link
Contributor

Looks like the triager @xdje42 missed this.

core/arch/arch.h Show resolved Hide resolved
core/arch/arch.h Show resolved Hide resolved
core/lib/mcxtx_api.h Outdated Show resolved Hide resolved
core/arch/riscv64/emit_utils.c Outdated Show resolved Hide resolved
core/arch/riscv64/emit_utils.c Outdated Show resolved Hide resolved
@derekbruening derekbruening requested a review from ksco December 16, 2024 19:20
Copy link
Contributor

@ksco ksco left a comment

Choose a reason for hiding this comment

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

A few more minor suggestions. After all other comments are addressed, this PR looks good to me.

(Sorry for the late review; I missed this one. Please feel free to @ me for possible future RV64-related PRs.)

core/arch/riscv64/mangle.c Outdated Show resolved Hide resolved
core/arch/riscv64/mangle.c Outdated Show resolved Hide resolved
@ksco
Copy link
Contributor

ksco commented Dec 17, 2024

mariospaok4 force-pushed the master branch from b47f3ce to a8227b9

Please don't force-push on shared branches (documented at https://dynamorio.org/page_code_reviews.html#autotoc_md118 and in other places)

@ksco
Copy link
Contributor

ksco commented Dec 17, 2024

When you are done, please re-request another round of review from previous reviewers at the top-right of the Web UI.

This patch was authored at the Computer Architecture and VLSI Laboratory, Institute of Computer Sciense, Foundation of Reasearch and Technology, Hellas.

It emits the necessary instructions that handle saving and restoring the vl and vtype during the context switches, when using the vector extension of the RISC-V ISA. This is required, in order to use the vector extension correctly.

Issue: #3544
@mariospaok4 mariospaok4 changed the title Add saving and restoring the vtype and vl vector registers for RISC-V vector extension. i#3544 RV64: Preserve vtype and vl vector registers Dec 17, 2024
Copy link
Contributor

@derekbruening derekbruening left a comment

Choose a reason for hiding this comment

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

Please reply to (typically "Done") and resolve all of the comments (unless there is something still there to discuss but make that clear in a reply) before re-requesting review (see https://dynamorio.org/page_code_reviews.html#autotoc_md118).

core/arch/emit_utils_shared.c Show resolved Hide resolved
core/arch/riscv64/emit_utils.c Outdated Show resolved Hide resolved
@ksco
Copy link
Contributor

ksco commented Dec 19, 2024

Okay, this is ready to merge, merging.

@ksco ksco merged commit 5f3be87 into DynamoRIO:master Dec 19, 2024
17 checks passed
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.

4 participants