Stream: git-wasmtime

Topic: wasmtime / issue #3288 Cranelift: s390x produces wrong re...


view this post on Zulip Wasmtime GitHub notifications bot (Sep 02 2021 at 17:54):

afonso360 opened issue #3288:

Running the test case introduced by @dheaton-arm in #3283 on the s390x QEMU emulator shows wrong results, only for i16,i32 and i64 types. i8 passes these tests.

.clif Test Case

test run
target s390x

function %umulhi_i8(i8, i8) -> i8 {
block0(v0: i8, v1: i8):
    v2 = umulhi v0, v1
    return v2
}
; run: %umulhi_i8(2, 4) == 0
; run: %umulhi_i8(255, 255) == 254

function %umulhi_i16(i16, i16) -> i16 {
block0(v0: i16, v1: i16):
    v2 = umulhi v0, v1
    return v2
}
; run: %umulhi_i16(2, 4) == 0
; run: %umulhi_i16(65535, 65535) == 65534

function %umulhi_i32(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
    v2 = umulhi v0, v1
    return v2
}
; run: %umulhi_i32(500, 700) == 0
; run: %umulhi_i32(4294967295, 4294967295) == 4294967294

function %umulhi_i64(i64, i64) -> i64 {
block0(v0: i64, v1: i64):
    v2 = umulhi v0, v1
    return v2
}
; run: %umulhi_i64(4294967295, 4294967295) == 0
; run: %umulhi_i64(18446744073709551615, 18446744073709551615) == 18446744073709551614

Steps to Reproduce

clif-util test ./the-above.clif

Expected Results

The test to pass

Actual Results

Versions and Environment

Cranelift version or commit: main
Operating system: linux
Architecture: s390x QEMU

Extra Info

A file with this test was added in #3283.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 02 2021 at 17:54):

afonso360 labeled issue #3288:

Running the test case introduced by @dheaton-arm in #3283 on the s390x QEMU emulator shows wrong results, only for i16,i32 and i64 types. i8 passes these tests.

.clif Test Case

test run
target s390x

function %umulhi_i8(i8, i8) -> i8 {
block0(v0: i8, v1: i8):
    v2 = umulhi v0, v1
    return v2
}
; run: %umulhi_i8(2, 4) == 0
; run: %umulhi_i8(255, 255) == 254

function %umulhi_i16(i16, i16) -> i16 {
block0(v0: i16, v1: i16):
    v2 = umulhi v0, v1
    return v2
}
; run: %umulhi_i16(2, 4) == 0
; run: %umulhi_i16(65535, 65535) == 65534

function %umulhi_i32(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
    v2 = umulhi v0, v1
    return v2
}
; run: %umulhi_i32(500, 700) == 0
; run: %umulhi_i32(4294967295, 4294967295) == 4294967294

function %umulhi_i64(i64, i64) -> i64 {
block0(v0: i64, v1: i64):
    v2 = umulhi v0, v1
    return v2
}
; run: %umulhi_i64(4294967295, 4294967295) == 0
; run: %umulhi_i64(18446744073709551615, 18446744073709551615) == 18446744073709551614

Steps to Reproduce

clif-util test ./the-above.clif

Expected Results

The test to pass

Actual Results

Versions and Environment

Cranelift version or commit: main
Operating system: linux
Architecture: s390x QEMU

Extra Info

A file with this test was added in #3283.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 02 2021 at 17:54):

afonso360 labeled issue #3288:

Running the test case introduced by @dheaton-arm in #3283 on the s390x QEMU emulator shows wrong results, only for i16,i32 and i64 types. i8 passes these tests.

.clif Test Case

test run
target s390x

function %umulhi_i8(i8, i8) -> i8 {
block0(v0: i8, v1: i8):
    v2 = umulhi v0, v1
    return v2
}
; run: %umulhi_i8(2, 4) == 0
; run: %umulhi_i8(255, 255) == 254

function %umulhi_i16(i16, i16) -> i16 {
block0(v0: i16, v1: i16):
    v2 = umulhi v0, v1
    return v2
}
; run: %umulhi_i16(2, 4) == 0
; run: %umulhi_i16(65535, 65535) == 65534

function %umulhi_i32(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
    v2 = umulhi v0, v1
    return v2
}
; run: %umulhi_i32(500, 700) == 0
; run: %umulhi_i32(4294967295, 4294967295) == 4294967294

function %umulhi_i64(i64, i64) -> i64 {
block0(v0: i64, v1: i64):
    v2 = umulhi v0, v1
    return v2
}
; run: %umulhi_i64(4294967295, 4294967295) == 0
; run: %umulhi_i64(18446744073709551615, 18446744073709551615) == 18446744073709551614

Steps to Reproduce

clif-util test ./the-above.clif

Expected Results

The test to pass

Actual Results

Versions and Environment

Cranelift version or commit: main
Operating system: linux
Architecture: s390x QEMU

Extra Info

A file with this test was added in #3283.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 02 2021 at 17:55):

afonso360 edited issue #3288:

Running the test case introduced by @dheaton-arm in #3283 on the s390x QEMU emulator shows wrong results, only for i16,i32 and i64 types. i8 passes these tests.

.clif Test Case

test run
target s390x

function %umulhi_i8(i8, i8) -> i8 {
block0(v0: i8, v1: i8):
    v2 = umulhi v0, v1
    return v2
}
; run: %umulhi_i8(2, 4) == 0
; run: %umulhi_i8(255, 255) == 254

function %umulhi_i16(i16, i16) -> i16 {
block0(v0: i16, v1: i16):
    v2 = umulhi v0, v1
    return v2
}
; run: %umulhi_i16(2, 4) == 0
; run: %umulhi_i16(65535, 65535) == 65534

function %umulhi_i32(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
    v2 = umulhi v0, v1
    return v2
}
; run: %umulhi_i32(500, 700) == 0
; run: %umulhi_i32(4294967295, 4294967295) == 4294967294

function %umulhi_i64(i64, i64) -> i64 {
block0(v0: i64, v1: i64):
    v2 = umulhi v0, v1
    return v2
}
; run: %umulhi_i64(4294967295, 4294967295) == 0
; run: %umulhi_i64(18446744073709551615, 18446744073709551615) == 18446744073709551614

Steps to Reproduce

clif-util test ./the-above.clif

Expected Results

The test to pass

Actual Results

FAIL ./filetests/filetests/runtests/test.clif: run

Caused by:
    Failed test: run: %umulhi_i16(2, 4) == 0, actual: 2048
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main
Operating system: linux
Architecture: s390x QEMU

Extra Info

A file with this test was added in #3283.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 01 2021 at 20:56):

akirilov-arm commented on issue #3288:

cc @uweigand

view this post on Zulip Wasmtime GitHub notifications bot (Oct 04 2021 at 12:03):

uweigand commented on issue #3288:

Hmm. The above clif test case just passes for me, running on s390x natively. I guess I'll need to try under qemu to see if this might be a problem there ...

view this post on Zulip Wasmtime GitHub notifications bot (Oct 04 2021 at 17:07):

uweigand commented on issue #3288:

Just re-ran the test under qemu and it also passes for me. Where exactly did you see the failure (cranelift / qemu versions)?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 05 2021 at 08:33):

afonso360 commented on issue #3288:

The commit where I tested this was 16b6a404e419498e6204e6c4855b50105370c7b0, with qemu-s390x 4.2.1.

I tried to reproduce this with the current main, and it looks like it got fixed. (still fails if I go back to 16b6a404e419498e6204e6c4855b50105370c7b0).

I've opened #3418 to enable the umulhi testsuite to prevent regressions. Otherwise we can close this.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 05 2021 at 08:34):

afonso360 edited a comment on issue #3288:

The commit where I originally tested this was 16b6a404e419498e6204e6c4855b50105370c7b0, with qemu-s390x 4.2.1.

I tried to reproduce this with the current main, and it looks like it got fixed. (still fails if I go back to 16b6a404e419498e6204e6c4855b50105370c7b0).

I've opened #3418 to enable the umulhi testsuite to prevent regressions. Otherwise we can close this.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 05 2021 at 08:50):

uweigand commented on issue #3288:

The commit where I originally tested this was 16b6a40, with qemu-s390x 4.2.1.

I tried to reproduce this with the current main, and it looks like it got fixed. (still fails if I go back to 16b6a40).

Ah, right, that likely got fixed by this: https://github.com/bytecodealliance/wasmtime/pull/3329

I've opened #3418 to enable the umulhi testsuite to prevent regressions. Otherwise we can close this.

Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Oct 06 2021 at 19:59):

akirilov-arm closed issue #3288:

Running the test case introduced by @dheaton-arm in #3283 on the s390x QEMU emulator shows wrong results, only for i16,i32 and i64 types. i8 passes these tests.

.clif Test Case

test run
target s390x

function %umulhi_i8(i8, i8) -> i8 {
block0(v0: i8, v1: i8):
    v2 = umulhi v0, v1
    return v2
}
; run: %umulhi_i8(2, 4) == 0
; run: %umulhi_i8(255, 255) == 254

function %umulhi_i16(i16, i16) -> i16 {
block0(v0: i16, v1: i16):
    v2 = umulhi v0, v1
    return v2
}
; run: %umulhi_i16(2, 4) == 0
; run: %umulhi_i16(65535, 65535) == 65534

function %umulhi_i32(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
    v2 = umulhi v0, v1
    return v2
}
; run: %umulhi_i32(500, 700) == 0
; run: %umulhi_i32(4294967295, 4294967295) == 4294967294

function %umulhi_i64(i64, i64) -> i64 {
block0(v0: i64, v1: i64):
    v2 = umulhi v0, v1
    return v2
}
; run: %umulhi_i64(4294967295, 4294967295) == 0
; run: %umulhi_i64(18446744073709551615, 18446744073709551615) == 18446744073709551614

Steps to Reproduce

clif-util test ./the-above.clif

Expected Results

The test to pass

Actual Results

FAIL ./filetests/filetests/runtests/test.clif: run

Caused by:
    Failed test: run: %umulhi_i16(2, 4) == 0, actual: 2048
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main
Operating system: linux
Architecture: s390x QEMU

Extra Info

A file with this test was added in #3283.


Last updated: Oct 23 2024 at 20:03 UTC