Skip to content

Question about f64 WASM ops with single precision FPU. #418

@AfflatusX

Description

@AfflatusX

Hi everyone -

I'm looking for some suggestion/ideas around following use case:

We have a board that has single precision FPU support - so we enabled hard vfp compiler flag. However, using AssemblyScript, the compiled WASM instructions has a lot of f64 ops. When we encounter those, following error will be thrown: error: AOT module load failed: resolve symbol __aeabi_dsub failed. Which is expected since hard vfp would not compile ARM fplib into the app.

What's the best way to work around this issue? Right now I unblocked this by replacing f64 instructions in the .wat file with f32 ones. But that would break built in lib functions which uses f64 explicitly - for example, f32.toString() no longer works as expected.

We could also avoid using built in libs involve float point altogether - but that makes devX bad and we had to create bindings in C everywhere.

Any suggestions would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions