Skip to content

riscv64: Add .vx format opcodes#6367

Merged
afonso360 merged 8 commits into
bytecodealliance:mainfrom
afonso360:riscv-vx
May 16, 2023
Merged

riscv64: Add .vx format opcodes#6367
afonso360 merged 8 commits into
bytecodealliance:mainfrom
afonso360:riscv-vx

Conversation

@afonso360

Copy link
Copy Markdown
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
pub fn vec_reg_name(reg: Reg) -> String {
match reg.to_real_reg() {
Some(real) => {
assert_eq!(real.class(), RegClass::Float);

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.

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.

@elliottt elliottt left a comment

Copy link
Copy Markdown
Member

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!

Comment thread cranelift/codegen/src/isa/riscv64/inst/mod.rs Outdated
Comment thread cranelift/codegen/src/isa/riscv64/inst/vector.rs

@elliottt elliottt left a comment

Copy link
Copy Markdown
Member

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