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

Winch: v128 min, max, extmul and extadd #10205

Merged

Conversation

MarinPostma
Copy link
Contributor

@MarinPostma MarinPostma commented Feb 7, 2025

This PR implements another batch of SIMD instruction for winch x64 backend:

  • i8x16.max_u
  • i16x8.max_u
  • i32x4.max_u
  • i8x16.max_s
  • i16x8.max_s
  • i32x4.max_s
  • i8x16.min_u
  • i16x8.min_u
  • i32x4.min_u
  • i8x16.min_s
  • i16x8.min_s
  • i32x4.min_s
  • i16x8.extmul_low_i8x16_s
  • i16x8.extmul_high_i8x16_s
  • i16x8.extmul_low_i8x16_u
  • i16x8.extmul_high_i8x16_u
  • i32x4.extmul_low_i16x8_s
  • i32x4.extmul_high_i16x8_s
  • i32x4.extmul_low_i16x8_u
  • i32x4.extmul_high_i16x8_u
  • i64x2.extmul_low_i32x4_s
  • i64x2.extmul_high_i32x4_s
  • i64x2.extmul_low_i32x4_u
  • i64x2.extmul_high_i32x4_u
  • i16x8.extadd_pairwise_i8x16_s
  • i16x8.extadd_pairwise_i8x16_u
  • i32x4.extadd_pairwise_i16x8_s
  • i32x4.extadd_pairwise_i16x8_u

The add-extend and mul-extend operation are implemented in terms of already existing primitive. This is because almost every single one of those wasm instruction resulted in a special sequence of x64 instruction. While the current implemention emits far from optimal code, it has the advantage of being straighforward. We can always specialize the implementations later.

#8093

@MarinPostma MarinPostma requested review from a team as code owners February 7, 2025 14:54
@MarinPostma MarinPostma requested review from abrown and fitzgen and removed request for a team February 7, 2025 14:54
@MarinPostma MarinPostma force-pushed the packed-integer-arithmetic-pt3 branch 3 times, most recently from cc120ef to d8e3ef7 Compare February 7, 2025 14:59
@github-actions github-actions bot added the winch Winch issues or pull requests label Feb 7, 2025
Copy link

github-actions bot commented Feb 7, 2025

Subscribe to Label Action

cc @saulecabrera

This issue or pull request has been labeled: "winch"

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

  • saulecabrera: winch

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

Learn more.

@saulecabrera
Copy link
Member

I can grab this one.

@saulecabrera saulecabrera requested review from saulecabrera and removed request for abrown and fitzgen February 10, 2025 13:09
Copy link
Member

@saulecabrera saulecabrera left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@saulecabrera
Copy link
Member

FYI, there are a couple of conflicts.

@MarinPostma MarinPostma force-pushed the packed-integer-arithmetic-pt3 branch from d8e3ef7 to 5a5fbbe Compare February 11, 2025 18:48
@MarinPostma MarinPostma force-pushed the packed-integer-arithmetic-pt3 branch 2 times, most recently from 448c221 to bd2fe3e Compare February 11, 2025 20:40
@MarinPostma MarinPostma force-pushed the packed-integer-arithmetic-pt3 branch from bd2fe3e to 1bf3b5a Compare February 11, 2025 21:00
@MarinPostma
Copy link
Contributor Author

rebased @saulecabrera

@saulecabrera saulecabrera added this pull request to the merge queue Feb 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 11, 2025
@saulecabrera
Copy link
Member

@MarinPostma MarinPostma force-pushed the packed-integer-arithmetic-pt3 branch from 354172f to 596bf30 Compare February 13, 2025 09:16
@MarinPostma
Copy link
Contributor Author

it looks good now, but I was unable to find the CI failure the previous time...

@saulecabrera saulecabrera added this pull request to the merge queue Feb 13, 2025
Merged via the queue into bytecodealliance:main with commit 305c3f9 Feb 13, 2025
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
winch Winch issues or pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants