Skip to content

Conversation

@MaartenS11
Copy link
Member

@MaartenS11 MaartenS11 commented Feb 10, 2026

Closes #301.

https://github.com/WebAssembly/nontrapping-float-to-int-conversions/blob/main/proposals/nontrapping-float-to-int-conversion/Overview.md

The tinygo compiler would sometimes use these instructions making it very useful to have them.

Adds support for the following instructions:

  • i32.trunc_sat_f32_s
  • i32.trunc_sat_f32_u
  • i32.trunc_sat_f64_s
  • i32.trunc_sat_f64_u
  • i64.trunc_sat_f32_s
  • i64.trunc_sat_f32_u
  • i64.trunc_sat_f64_s
  • i64.trunc_sat_f64_u

TODO:

  • Add latch tests
  • Fix instructions so they match the spec

@MaartenS11 MaartenS11 force-pushed the feat/saturated-arithmetic branch from 40cb9b3 to 6cfc49e Compare February 10, 2026 18:31
The tinygo compiler would sometimes use these instructions making it very useful to have them.
@MaartenS11 MaartenS11 force-pushed the feat/saturated-arithmetic branch from 6cfc49e to 6eb53fe Compare February 10, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

📑 Non-trapping float-to-int conversions

1 participant