Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃洡 Non-trapping float-to-int conversions #11

binji opened this Issue Oct 16, 2018 · 0 comments


None yet
2 participants
Copy link

binji commented Oct 16, 2018

This is a tracking issue for a post-MVP feature
It will be updated as the issue progresses.

Topic Non-trapping float-to-int conversions
Champion Dan Gohman @sunfishcode
Status in progress
Phase Implementation phase
Linked issues WebAssembly/design#986, WebAssembly/design#1089
Linked repositories


The primary motivations are:

  • LLVM鈥檚 float-to-int conversion has an undefined result, rather than undefined behavior, and it seems LLVM does speculate it under certain conditions.
  • For the SIMD proposal, it鈥檚 more SIMD-hardware-like if no SIMD operations trap. This proposal would establish a convention for saturating operations which SIMD could share, to avoid introducing trapping.

This proposal is not motivated by performance data.

It's plausible that LLVM could be changed, to have something like an "nsw" flag for the "fptosi" instruction, especially with some of the recent proposals to modify the poison concept in LLVM. However, no one is currently working on this.

@WebAssembly WebAssembly locked and limited conversation to collaborators Oct 16, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can鈥檛 perform that action at this time.