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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c-writer.cc: represent float consts as integer literals #2389

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

Conversation

keithw
Copy link
Member

@keithw keithw commented Feb 10, 2024

Fixes #2388 by representing float constants as reinterpretations of an integer. This seems a bit safer than using a decimal %.9g or %.17g literal, and allows us to remove some special-case handling of NaNs, infinity, and negative zero. It does bloat the output a bit (we could shorten f64_reinterpret_i64 to something like f64i which would help a little).

wasm2c (on MSVC) now passes the new proposed testcases (https://github.com/WebAssembly/wabt/actions/runs/7864206734/job/21455684596 vs. https://github.com/WebAssembly/wabt/actions/runs/7864260678/job/21455793263).

@SoniEx2
Copy link
Contributor

SoniEx2 commented May 3, 2024

it would be nice to get this merged...

@SoniEx2
Copy link
Contributor

SoniEx2 commented Sep 16, 2024

presumably this can be closed now

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.

[wasm2c] MSVC miscompiles for certain fp constants
3 participants