Skip to content

Conversation

@adamperlin
Copy link
Contributor

@adamperlin adamperlin commented Jan 5, 2026

This PR addresses some review feedback in #122301 and fills in more codegen for casts on Wasm.
Notably:

  • Casts to and from all int types (byte, short) are now supported with proper sign extension
    • Some generic casting code, in particular GenIntCastDesc was moved out of ifdefs and adapted for Wasm to support this. We don't yet support containment of casts in loads (i.e., the GenIntCastDesc::LOAD_* type casts).
  • float->int casts are implemented using the saturating non-trapping conversion instructions
    • This required changing the type of our Wasm opcodes to be 2 bytes instead of 1

@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 Jan 5, 2026
@am11 am11 added the arch-wasm WebAssembly architecture label Jan 5, 2026
@dotnet-policy-service
Copy link
Contributor

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

@adamperlin adamperlin force-pushed the adamperlin/ryujit-wasm-cast branch from 521f043 to c88d66b Compare January 14, 2026 17:35
@adamperlin adamperlin force-pushed the adamperlin/ryujit-wasm-cast branch from d86e911 to cc76584 Compare January 15, 2026 19:52
@adamperlin
Copy link
Contributor Author

@dotnet/jit-contrib Initial feedback should be implemented now so this is ready for another review pass!

Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
@AndyAyersMS
Copy link
Member

@adamperlin can you resolve the merge conflicts when you get a chance?

Seems like this is close?

@adamperlin
Copy link
Contributor Author

@adamperlin can you resolve the merge conflicts when you get a chance?

Seems like this is close?

@AndyAyersMS yes! I've now resolved the merge conflicts and addressed the last bit of feedback. Please feel free to take another look!

Copy link
Member

@AndyAyersMS AndyAyersMS left a comment

Choose a reason for hiding this comment

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

Indentation is still a bit wonky in instrswasm.h but we can fix that the next time we modify that file.

@adamperlin adamperlin merged commit ef2aefa into dotnet:main Jan 24, 2026
126 of 128 checks passed
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.

5 participants