Stream: git-wasmtime

Topic: wasmtime / issue #5501 Cranelift: Wrong result for `iabs....


view this post on Zulip Wasmtime GitHub notifications bot (Dec 30 2022 at 18:17):

afonso360 labeled issue #5501:

:wave: Hey,

.clif Test Case

test interpret
test run
target riscv64

function %a(i16, i64) -> i16 system_v {
block0(v0: i16, v1: i64):
    v2 = ushr v0, v1
    v3 = iabs v2
    return v3
}

; run: %a(-24064, -16) == 24064

Steps to Reproduce

Expected Results

The test to pass

Actual Results

 ERROR cranelift_filetests::concurrent > FAIL: run
FAIL ./lmao.clif: run

Caused by:
    Failed test: run: %a(-24064, -16) == 24064, actual: -24064
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main
Operating system: Linux
Architecture: riscv64

Additional Information

Disassembly:

Disassembly of 52 bytes:
   0:   13 17 05 03             slli    a4, a0, 0x30
   4:   13 57 07 03             srli    a4, a4, 0x30
   8:   13 f8 f5 00             andi    a6, a1, 0xf
   c:   3b 5e 07 01             srlw    t3, a4, a6
  10:   93 16 0e 03             slli    a3, t3, 0x30
  14:   93 d6 06 43             srai    a3, a3, 0x30
  18:   93 47 fe ff             not     a5, t3
  1c:   93 88 17 00             addi    a7, a5, 1
  20:   63 46 0e 00             bltz    t3, 0xc
  24:   13 65 0e 00             ori     a0, t3, 0
  28:   6f 00 80 00             j       8
  2c:   13 e5 08 00             ori     a0, a7, 0
  30:   67 80 00 00             ret

view this post on Zulip Wasmtime GitHub notifications bot (Dec 30 2022 at 18:17):

afonso360 opened issue #5501:

:wave: Hey,

.clif Test Case

test interpret
test run
target riscv64

function %a(i16, i64) -> i16 system_v {
block0(v0: i16, v1: i64):
    v2 = ushr v0, v1
    v3 = iabs v2
    return v3
}

; run: %a(-24064, -16) == 24064

Steps to Reproduce

Expected Results

The test to pass

Actual Results

 ERROR cranelift_filetests::concurrent > FAIL: run
FAIL ./lmao.clif: run

Caused by:
    Failed test: run: %a(-24064, -16) == 24064, actual: -24064
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main
Operating system: Linux
Architecture: riscv64

Additional Information

Disassembly:

Disassembly of 52 bytes:
   0:   13 17 05 03             slli    a4, a0, 0x30
   4:   13 57 07 03             srli    a4, a4, 0x30
   8:   13 f8 f5 00             andi    a6, a1, 0xf
   c:   3b 5e 07 01             srlw    t3, a4, a6
  10:   93 16 0e 03             slli    a3, t3, 0x30
  14:   93 d6 06 43             srai    a3, a3, 0x30
  18:   93 47 fe ff             not     a5, t3
  1c:   93 88 17 00             addi    a7, a5, 1
  20:   63 46 0e 00             bltz    t3, 0xc
  24:   13 65 0e 00             ori     a0, t3, 0
  28:   6f 00 80 00             j       8
  2c:   13 e5 08 00             ori     a0, a7, 0
  30:   67 80 00 00             ret

view this post on Zulip Wasmtime GitHub notifications bot (Dec 30 2022 at 18:17):

afonso360 labeled issue #5501:

:wave: Hey,

.clif Test Case

test interpret
test run
target riscv64

function %a(i16, i64) -> i16 system_v {
block0(v0: i16, v1: i64):
    v2 = ushr v0, v1
    v3 = iabs v2
    return v3
}

; run: %a(-24064, -16) == 24064

Steps to Reproduce

Expected Results

The test to pass

Actual Results

 ERROR cranelift_filetests::concurrent > FAIL: run
FAIL ./lmao.clif: run

Caused by:
    Failed test: run: %a(-24064, -16) == 24064, actual: -24064
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main
Operating system: Linux
Architecture: riscv64

Additional Information

Disassembly:

Disassembly of 52 bytes:
   0:   13 17 05 03             slli    a4, a0, 0x30
   4:   13 57 07 03             srli    a4, a4, 0x30
   8:   13 f8 f5 00             andi    a6, a1, 0xf
   c:   3b 5e 07 01             srlw    t3, a4, a6
  10:   93 16 0e 03             slli    a3, t3, 0x30
  14:   93 d6 06 43             srai    a3, a3, 0x30
  18:   93 47 fe ff             not     a5, t3
  1c:   93 88 17 00             addi    a7, a5, 1
  20:   63 46 0e 00             bltz    t3, 0xc
  24:   13 65 0e 00             ori     a0, t3, 0
  28:   6f 00 80 00             j       8
  2c:   13 e5 08 00             ori     a0, a7, 0
  30:   67 80 00 00             ret

view this post on Zulip Wasmtime GitHub notifications bot (Jan 04 2023 at 01:37):

elliottt closed issue #5501:

:wave: Hey,

.clif Test Case

test interpret
test run
target riscv64

function %a(i16, i64) -> i16 system_v {
block0(v0: i16, v1: i64):
    v2 = ushr v0, v1
    v3 = iabs v2
    return v3
}

; run: %a(-24064, -16) == 24064

Steps to Reproduce

Expected Results

The test to pass

Actual Results

 ERROR cranelift_filetests::concurrent > FAIL: run
FAIL ./lmao.clif: run

Caused by:
    Failed test: run: %a(-24064, -16) == 24064, actual: -24064
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main
Operating system: Linux
Architecture: riscv64

Additional Information

Disassembly:

Disassembly of 52 bytes:
   0:   13 17 05 03             slli    a4, a0, 0x30
   4:   13 57 07 03             srli    a4, a4, 0x30
   8:   13 f8 f5 00             andi    a6, a1, 0xf
   c:   3b 5e 07 01             srlw    t3, a4, a6
  10:   93 16 0e 03             slli    a3, t3, 0x30
  14:   93 d6 06 43             srai    a3, a3, 0x30
  18:   93 47 fe ff             not     a5, t3
  1c:   93 88 17 00             addi    a7, a5, 1
  20:   63 46 0e 00             bltz    t3, 0xc
  24:   13 65 0e 00             ori     a0, t3, 0
  28:   6f 00 80 00             j       8
  2c:   13 e5 08 00             ori     a0, a7, 0
  30:   67 80 00 00             ret

Last updated: Nov 22 2024 at 17:03 UTC