akldc opened issue #11050:
.clifTest Casetest 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 failureSimilarly, for the
compilecommand/home/wasmtime/target/debug/clif-util compile --target=x86_64 test1.clifThis 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.clifHowever, 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?
akldc added the cranelift label to Issue #11050.
akldc added the bug label to Issue #11050.
alexcrichton commented on issue #11050:
test1.clif: The target ISA specified in the file is not compatible with the host ISAit looks like this is
target riscv64vstarget riscv64gcin 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 withtest riscv64b ut./clif-util run ...isn't working.After changing the input
foo.cliffile fromtarget riscv64 ...totarget 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
runandcompilesubcommands of clif-util. Therunsubcommand looks to read flags/options from the input*.cliffile, but thecompilesubcommand does not. That means that despite the test sayingset enable_multi_ret_implicit_sret=trueinside of it that's actually ignored as part of./clif-util compile .... Forclif-util compileyou'll need to pass--set enable_multi_ret_implicit_sret=true(and then also--set has_vfor riscv64 things using vectors)(this is probably bits and bobs that can be improved in
clif-util)
akldc commented on issue #11050:
@alexcrichton
Thanks for your reply. Hopefully,clif-utilcan be improved in the future so that thecompilecommand respects the settings in the.cliffile as well.
Last updated: Dec 06 2025 at 07:03 UTC