Stream: git-wasmtime

Topic: wasmtime / PR #10670 Avoid using a `TruncF64` libcall in ...


view this post on Zulip Wasmtime GitHub notifications bot (Apr 24 2025 at 18:59):

sunfishcode opened PR #10670 from sunfishcode:sunfishcode/trunc-libcall to bytecodealliance:main:

When !clif_instruction_traps_enabled(), the float-to-int conversion would sometimes emit a Cranelift trunc instruction directly, without checking has_round(), which led to Cranelift emitting a libcall. Fix it by calling the trunc_f32 and trunc_f64 routines which do check has_round().

This fixes a fuzzbug from #10657.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Apr 24 2025 at 18:59):

sunfishcode requested dicej for a review on PR #10670.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 24 2025 at 18:59):

sunfishcode requested wasmtime-core-reviewers for a review on PR #10670.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 24 2025 at 19:01):

sunfishcode commented on PR #10670:

What's a good place to add a testcase for this? It needs a Wasm input, a custom target configuration, and it needs to check the generated Cranelift code or machine code.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 24 2025 at 19:35):

cfallin commented on PR #10670:

What's a good place to add a testcase for this?

We have the disas tests now; a good example with specific target settings might be this one (for the x86-64 BMI2 extensions). We have the env-var-based "blessing" infra here to autogenerate the expectation, too (WASMTIME_TEST_BLESS=1).

view this post on Zulip Wasmtime GitHub notifications bot (Apr 24 2025 at 19:35):

cfallin edited a comment on PR #10670:

What's a good place to add a testcase for this?

We have the disas tests now; a good example with specific target settings might be this one (for the x86-64 BMI2 extensions). We have the env-var-based "blessing" infra here to autogenerate the expectation, too (WASMTIME_TEST_BLESS=1 cargo test --test disas).

view this post on Zulip Wasmtime GitHub notifications bot (Apr 24 2025 at 19:36):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 24 2025 at 20:05):

sunfishcode updated PR #10670.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 24 2025 at 20:44):

sunfishcode merged PR #10670.


Last updated: Dec 06 2025 at 07:03 UTC