Skip to content

fixed point multiplication on wasm32 #9660

@archaistvolts

Description

@archaistvolts

This issue tracks support for fixed point multiplication on WebAssembly.

Currently, trying to build on wasm produces the following error:

// saturation.zig
test "mulWithSaturation" {
    var a: i8 = 1;
    var b: i8 = 2;
    var c = @mulWithSaturation(a, b);
    try std.testing.expect(c == 3);
}
$ zig test saturation.zig -target wasm32-wasi
LLVM ERROR: Unable to expand fixed point multiplication.
Aborted

long term: we'll have a shim that we use on backends that don't support it with machine instructions, and use it for webassembly if the llvm backend does not support it

Related #1284

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-wasm32-bit and 64-bit WebAssemblybackend-llvmThe LLVM backend outputs an LLVM IR Module.bugObserved behavior contradicts documented or intended behaviorupstreamAn issue with a third party project that Zig uses.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions