Skip to content

Wasm: preserve native remainder for constant divisors - #136987

Open
adamperlin wants to merge 2 commits into
dotnet:mainfrom
adamperlin:adamperlin-wasm-native-remainder
Open

adamperlin wants to merge 2 commits into
dotnet:mainfrom
adamperlin:adamperlin-wasm-native-remainder

Conversation

@adamperlin

@adamperlin adamperlin commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Preserve native Wasm remainder instead of expanding constant signed remainder to SUB/MUL/DIV. Other targets and power-of-two optimizations are unchanged.

Add integer boundary tests and WASM disassembly checks, with a comment explaining the current manual SuperFileCheck requirement.

Validated with a Checked Wasm JIT build, remainder tests, and manual SuperFileCheck checks. SuperPMI asmdiffs covered 29,068 contexts: 43 size improvements, no size regressions, and 570 bytes saved. Remainder tests are passing using a browser-wasm core root.

Resolves #135982

Note

Prepared with GitHub Copilot.

@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Nov 4, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
10 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@adamperlin
adamperlin marked this pull request as draft November 5, 2026 00:24
@jkotas jkotas added the arch-wasm WebAssembly architecture label Nov 5, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@adamperlin
adamperlin marked this pull request as ready for review November 5, 2026 01:06
@adamperlin

Copy link
Copy Markdown
Contributor Author

I believe the failure is a newly exposed bug, I'm going to prepare a separate fix before merging this.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Wasm][CoreCLR] Preserve native remainder instead of expanding constant MOD to SUB/MUL/DIV

5 participants