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

Make Pulley pass simd_f32x4_arith.wast #9897

Merged
merged 3 commits into from
Jan 6, 2025

Conversation

tyoeer
Copy link
Contributor

@tyoeer tyoeer commented Dec 23, 2024

Helping towards issue #9783.

This PR makes Pulley pass spec_testsuite/simd_f32x4_arith.wast, by adding f32x4 instructions for subtraction, negation, multiplication, and division (division already got added by another PR).

Random notes:

  • Added instructions placement and doc comments in pulley/src/lib.rs are based on what is done with vtrunc32x4.
  • Added instructions implementation is based on vmuli32x4.
  • How instructions are generally grouped together/ordered appears to vary, e.g. ftrunc32, vtrunc32x4, and vtrunc64x2 are together, but ftrunc64 isn't near there.
  • It also appears inconsistent if a SIMD float instruction has an f at the end, e.g. vtrunc32x4 vs. vabsf32x4.

@tyoeer tyoeer requested review from a team as code owners December 23, 2024 20:23
@tyoeer tyoeer requested review from fitzgen and removed request for a team December 23, 2024 20:23
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator pulley Issues related to the Pulley interpreter labels Dec 23, 2024
Copy link

Subscribe to Label Action

cc @fitzgen

This issue or pull request has been labeled: "cranelift", "pulley"

Thus the following users have been cc'd because of the following labels:

  • fitzgen: pulley

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

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

Thanks!

Comment on lines 814 to 815
/// `low128(dst) = low128(src1) - low128(src2)`
vsub32x4 = Vsub32x4 { operands: BinaryOperands<VReg> };
Copy link
Member

Choose a reason for hiding this comment

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

Mind using f32x4 in the opcodes (e.g. vsubf32x4) to clearly indicate that it's for floats and not integers?

Copy link
Contributor Author

@tyoeer tyoeer Jan 2, 2025

Choose a reason for hiding this comment

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

Should be done

@alexcrichton
Copy link
Member

@tyoeer I think this might need a rebase?

tyoeer added 3 commits January 6, 2025 17:02
Adds float SIMD instructions on 4 lanes (f32x4) for subtraction, multiplication, and negation.
`vtrunc32x4` and `vmuli32x4` were used as basis on how to organize things.
To be exact: `spec_testsuite/simd_f32x4_arith.wast` has been removed from the should fail list for Pulley.
Specifically:
- "vsub32x4" -> "vsubf32x4"
- "vmul32x4" -> "vmulf32x4"
@alexcrichton alexcrichton added this pull request to the merge queue Jan 6, 2025
@tyoeer
Copy link
Contributor Author

tyoeer commented Jan 6, 2025

@tyoeer I think this might need a rebase?

It has been rebased. Another PR has also already added vdivf32x4, so that one was removed from this PR during merging.
https://docs.wasmtime.dev/contributing-development-process.html#focused-commits-or-squashing mentions that it's preferred to not rebase when making changes, which is why I waited until I was specifically asked to.

@alexcrichton
Copy link
Member

Oh no worries! This falls into the "various technical reasons" category where this couldn't be merged due to a merge conflict. I'll go update those docs though to mention that, thanks for dropping the link!

alexcrichton added a commit to alexcrichton/wasmtime that referenced this pull request Jan 6, 2025
Indicate that a rebase is required if there's a merge conflict or CI
issues for example. Inspired by discussion on bytecodealliance#9897
Merged via the queue into bytecodealliance:main with commit 5092fe2 Jan 6, 2025
37 checks passed
github-merge-queue bot pushed a commit that referenced this pull request Jan 6, 2025
Indicate that a rebase is required if there's a merge conflict or CI
issues for example. Inspired by discussion on #9897
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 pulley Issues related to the Pulley interpreter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants