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

riscv64: Add .vx format opcodes #6367

Merged
merged 8 commits into from
May 16, 2023
Merged

Conversation

afonso360
Copy link
Contributor

👋 Hey,

This PR introduces .vx format opcodes, these splat an X or F register and perform the respective operation.

I've only added vadd, vsub and vrsub, but these are available for most opcodes.

Additionally with the addition of ineg we now pass the simd_*_arith.wast test suites 🎉 . I'm planning on enabling those when both this and the RegClass PR's are merged.

@afonso360 afonso360 requested a review from a team as a code owner May 10, 2023 12:40
@afonso360 afonso360 requested review from elliottt and removed request for a team May 10, 2023 12:40
@github-actions github-actions bot added the cranelift Issues related to the Cranelift code generator label May 10, 2023
@@ -840,7 +849,6 @@ pub fn reg_name(reg: Reg) -> String {
pub fn vec_reg_name(reg: Reg) -> String {
match reg.to_real_reg() {
Some(real) => {
assert_eq!(real.class(), RegClass::Float);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This assert triggers since we are now trying to format some integer registers and I didn't change the pretty printer. However this function gets removed in #6366, so I figured it's easier to wait for that to be merged and rebase this.

Copy link
Member

@elliottt elliottt left a comment

Choose a reason for hiding this comment

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

Just one quick question about the funct6 values for Vadd and Vsub, otherwise this looks great!

cranelift/codegen/src/isa/riscv64/inst/mod.rs Outdated Show resolved Hide resolved
Copy link
Member

@elliottt elliottt left a comment

Choose a reason for hiding this comment

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

Looks great, thank you Afonso!

@afonso360 afonso360 enabled auto-merge May 16, 2023 20:36
@afonso360 afonso360 added this pull request to the merge queue May 16, 2023
Merged via the queue into bytecodealliance:main with commit 3f03130 May 16, 2023
@afonso360 afonso360 deleted the riscv-vx branch May 16, 2023 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants