Skip to content

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

Merged
saulecabrera merged 4 commits intobytecodealliance:mainfrom
MarinPostma:packed-integer-arithmetic-pt3
Feb 13, 2025
Merged

Winch: v128 min, max, extmul and extadd#10205
saulecabrera merged 4 commits intobytecodealliance:mainfrom
MarinPostma:packed-integer-arithmetic-pt3

Conversation

@MarinPostma
Copy link
Copy Markdown
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
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 7, 2025

Subscribe to Label Action

cc @saulecabrera

Details 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

It seems that the list of tests that require AVX needs updating: https://github.com/bytecodealliance/wasmtime/actions/runs/13273954433/job/37059662498

@MarinPostma MarinPostma force-pushed the packed-integer-arithmetic-pt3 branch from 354172f to 596bf30 Compare February 13, 2025 09:16
@MarinPostma
Copy link
Copy Markdown
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
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