chipshort / wasm-float-transpiler

(WIP) Softfloats for WebAssembly
5 stars 0 forks source link

Finish implementing float operations #4

Open chipshort opened 1 year ago

chipshort commented 1 year ago

It should be possible to implement all of them for rustc_apfloat. sqrt might have to be implemented manually in terms of the other operations (mul, div, etc.), but the algorithms for that are pretty easy and short. Might want to do some benchmarking on code size and performance for those algorithms, but probably not that important for now.

For softfp, not all instructions will be supported. Make sure to comment the ones that are not available out, because then the transpiler will throw a compile-time error when encountering such an instruction instead of a runtime error like the todo macro.

Since softfp does not fully support everything, we might want to make rustc_apfloat the default feature instead.