Stream: git-wasmtime

Topic: wasmtime / issue #11023 Incorrect result of scalar_to_vec...


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

akldc opened issue #11023:

.clif Test Case

test optimize
    set opt_level=none
    set preserve_frame_pointers=true
    set enable_multi_ret_implicit_sret=true

function %main() ->  f64x2 fast {

block0:

    v1 = f64const 0x1.fef6c8765e219p-1
    v2 = nearest v1
    v3 = scalar_to_vector.f64x2 v2
    return  v3
}

; print: %main()

Result

[x86    ] %main() -> 0x00000000000000103ff0000000000000
[aarch64] %main() -> 0x00000000000000003ff0000000000000
[riscv64] %main() -> 0x00000000000000003ff0000000000000

When set opt_level=speed:

[x86    ] %main() -> 0x00000000000000003ff0000000000000
[aarch64] %main() -> 0x00000000000000003ff0000000000000
[riscv64] %main() -> 0x00000000000000003ff0000000000000

Or insert v1 before v3 in the return values.

[x86    ] %main() -> [0x1.fef6c8765e219p-1, 0x00000000000000003ff0000000000000]
[aarch64] %main() -> [0x1.fef6c8765e219p-1, 0x00000000000000003ff0000000000000]
[riscv64] %main() -> [0x1.fef6c8765e219p-1, 0x00000000000000003ff0000000000000]

Both changes ensure that v3 returns the correct value.
This issue seems somewhat similar to #10906

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

akldc added the bug label to Issue #11023.

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

akldc added the cranelift label to Issue #11023.

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

akldc closed issue #11023:

.clif Test Case

test optimize
    set opt_level=none
    set preserve_frame_pointers=true
    set enable_multi_ret_implicit_sret=true

function %main() ->  f64x2 fast {

block0:

    v1 = f64const 0x1.fef6c8765e219p-1
    v2 = nearest v1
    v3 = scalar_to_vector.f64x2 v2
    return  v3
}

; print: %main()

Result

[x86    ] %main() -> 0x00000000000000103ff0000000000000
[aarch64] %main() -> 0x00000000000000003ff0000000000000
[riscv64] %main() -> 0x00000000000000003ff0000000000000

When set opt_level=speed:

[x86    ] %main() -> 0x00000000000000003ff0000000000000
[aarch64] %main() -> 0x00000000000000003ff0000000000000
[riscv64] %main() -> 0x00000000000000003ff0000000000000

Or insert v1 before v3 in the return values.

[x86    ] %main() -> [0x1.fef6c8765e219p-1, 0x00000000000000003ff0000000000000]
[aarch64] %main() -> [0x1.fef6c8765e219p-1, 0x00000000000000003ff0000000000000]
[riscv64] %main() -> [0x1.fef6c8765e219p-1, 0x00000000000000003ff0000000000000]

Both changes ensure that v3 returns the correct value.
This issue seems somewhat similar to #10906


Last updated: Dec 06 2025 at 07:03 UTC