Skip to content

[wasm][jiterp] RelaxedSimd jiterpreter intrinsics #115444

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

lewing
Copy link
Member

@lewing lewing commented May 10, 2025

This is just a first step to allow the Jiterpreter to use the potentially faster relaxed_swizzle in the case where we know the swizzle indices are valid and can detect at runtime the opcode is supported. There is follow-up work planned to use the relaxed_swizzle in more cases, but this is a good first step to get the infrastructure in place

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label May 10, 2025
@lewing lewing requested a review from kg May 10, 2025 04:32
@lewing lewing added area-Codegen-Interpreter-mono area-Codegen-Intrinsics-mono and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels May 10, 2025
@lewing lewing changed the title [wasm][jterp] RelaxedSimd jiterpreter intrinsics [wasm][jiterp] RelaxedSimd jiterpreter intrinsics May 10, 2025
@kg
Copy link
Member

kg commented May 10, 2025

Lgtm

@lewing lewing marked this pull request as ready for review May 11, 2025 16:26
@Copilot Copilot AI review requested due to automatic review settings May 11, 2025 16:26
@lewing lewing requested a review from pavelsavara as a code owner May 11, 2025 16:26
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces support for relaxed_simd intrinsics in the Jiterpreter to enable potentially faster SIMD swizzle operations. The changes add new fields to helper types, update the import of relaxedSimd from the wasm‐feature‐detect package, and use the new relaxed swizzle opcode in the trace generator when the feature is available.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/mono/browser/runtime/types/internal.ts Added relaxedSimd and featureWasmRelaxedSimd to helper types
src/mono/browser/runtime/loader/globals.ts Updated the import to include relaxedSimd from wasm-feature-detect
src/mono/browser/runtime/jiterpreter-trace-generator.ts Conditionally emits i8x16_relaxed_swizzle if feature is enabled
Comments suppressed due to low confidence (1)

src/mono/browser/runtime/loader/globals.ts:7

  • [nitpick] Please verify that the version of the wasm-feature-detect package being used supports the relaxedSimd API to prevent potential runtime issues.
import { exceptions, simd, relaxedSimd } from "wasm-feature-detect";

@pavelsavara pavelsavara added arch-wasm WebAssembly architecture os-browser Browser variant of arch-wasm labels May 12, 2025
Copy link
Contributor

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants