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).
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 shortenf64_reinterpret_i64
to something likef64i
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).