Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Share the Rust APFloat port with the Rust compiler. #136

Closed
eddyb opened this issue Aug 4, 2017 · 2 comments
Closed

Share the Rust APFloat port with the Rust compiler. #136

eddyb opened this issue Aug 4, 2017 · 2 comments

Comments

@eddyb
Copy link

eddyb commented Aug 4, 2017

See rust-lang/rust#43554 for more details. We of course have to publish that crate on crates.io first.

Would be glad to hear what specific needs Cretonne has from software floating-point.

@stoklund
Copy link
Contributor

stoklund commented Aug 4, 2017

This is a cool project, and if we need software floating point at compile time, we should probably use this.

When compiling WebAssembly, the code generator is unlikely to discover opportunities for floating point constant folding that weren't already taken care of by LLVM when it generated the WASM. This makes FP constant folding a low priority at least until we start compiling WebAssembly that hasn't been properly optimized.

When JIT-compiling, we also need to make sure that we are bit-exact with the other tiers. Since WebAssembly floating point permits some non-determinism around NaN's, we should probably avoid constant-folding any FP expressions yielding NaN results.

Given this restriction, and given that we only need f32 and f64, it is possible that we can use the host's hardware FP for constant folding. That would be preferable in terms of compiler code size, performance, and dependency management.

@sunfishcode
Copy link
Member

Closing -- If Cretonne needs software floating-point code in the future, we should definitely look into sharing the APFloat code!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants