Stream: git-wasmtime

Topic: wasmtime / issue #11050 Cranelift: run and compile comman...


view this post on Zulip Wasmtime GitHub notifications bot (Jun 16 2025 at 14:08):

akldc opened issue #11050:

.clif Test Case

test run
set opt_level=speed
set preserve_frame_pointers=true
set enable_multi_ret_implicit_sret=true

target riscv64 has_zcd has_zbkb has_zbc has_zbs has_zicond has_zvl32b has_zvl64b has_zvl128b has_zvl1024b has_zvl2048b has_zvl4096b has_zvl8192b has_zvl16384b has_zvl32768b
target x86_64 sse42 has_avx

function %main() -> i32x4 fast {
    ss0 = explicit_slot 32
    ss1 = explicit_slot 32
    const0 = 0x40ad3fb47cb16076c8cb1fdd8189d40f

block0():
    v1 = vconst.i32x4 const0
    v2 = bxor v1, v1
    v3 = icmp.i32x4 ne v1, v2
    return v3
}

; print: %main()

Steps to Reproduce

On x86 ./clif-util run -v test1.clif —— It runs correctly.

But when executed via qemu-riscv64, it reports an error.

test1.clif: The target ISA specified in the file is not compatible with the host ISA
1 file
Error: 1 failure

Similarly, for the compile command

/home/wasmtime/target/debug/clif-util compile --target=x86_64 test1.clif

This command runs as expected.

qemu-riscv64 -L /usr/riscv64-linux-gnu -E LD_LIBRARY_PATH=/usr/riscv64-linux-gnu/lib /home/wasmtime/target/riscv64gc-unknown-linux-gnu/release/clif-util compile --target=riscv64  test1.clif

However, on riscv64, returning a vector value consistently results in an error:

Error: Unsupported feature: Too many return values to fit in registers. Use a StructReturn argument instead. (#9510)

So, is this due to a mistake in how I'm using it, or is it a problem with the implementation?

view this post on Zulip Wasmtime GitHub notifications bot (Jun 16 2025 at 14:08):

akldc added the cranelift label to Issue #11050.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 16 2025 at 14:08):

akldc added the bug label to Issue #11050.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 16 2025 at 15:09):

alexcrichton commented on issue #11050:

test1.clif: The target ISA specified in the file is not compatible with the host ISA

it looks like this is target riscv64 vs target riscv64gc in the CLIF input. I believe this is due to the fact that the check when testing is different than when running which is why all tests work with test riscv64 b ut ./clif-util run ... isn't working.

After changing the input foo.clif file from target riscv64 ... to target riscv64gc ... I was able to get things working

Error: Unsupported feature: Too many return values to fit in registers. Use a StructReturn argument instead. (#9510)

I believe what you're seeing here is a difference between the run and compile subcommands of clif-util. The run subcommand looks to read flags/options from the input *.clif file, but the compile subcommand does not. That means that despite the test saying set enable_multi_ret_implicit_sret=true inside of it that's actually ignored as part of ./clif-util compile .... For clif-util compile you'll need to pass --set enable_multi_ret_implicit_sret=true (and then also --set has_v for riscv64 things using vectors)

(this is probably bits and bobs that can be improved in clif-util)

view this post on Zulip Wasmtime GitHub notifications bot (Jun 17 2025 at 06:56):

akldc commented on issue #11050:

@alexcrichton
Thanks for your reply. Hopefully, clif-util can be improved in the future so that the compile command respects the settings in the .clif file as well.


Last updated: Dec 06 2025 at 07:03 UTC