Stream: git-wasmtime

Topic: wasmtime / issue #5523 Cranelift: Wrong result for `rotl....


view this post on Zulip Wasmtime GitHub notifications bot (Jan 05 2023 at 11:26):

afonso360 labeled issue #5523:

:wave: Hey,

.clif Test Case

test interpret
test run
target riscv64

function %a(i16, i128) -> i128 system_v {
block0(v0: i16, v1: i128):
    v2 = rotl v1, v0
    return v2
}

; run: %a(64, 1095219937288) == 20203241887575960770402119057408

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(64, 1095219937288) == 20203241887575960770402119057408, actual: 20203241887575960771497338994696
1 tests
Error: 1 failure

Versions and Environment

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

Extra Info

<details>
<summary>Disassembly:</summary>

Disassembly of 116 bytes:
   0:   13 e7 05 00             ori     a4, a1, 0
   4:   93 75 f5 07             andi    a1, a0, 0x7f
   8:   93 06 00 08             addi    a3, zero, 0x80
   c:   b3 87 b6 40             sub     a5, a3, a1
  10:   13 68 07 00             ori     a6, a4, 0
  14:   b3 18 b8 00             sll     a7, a6, a1
  18:   b3 5e f6 00             srl     t4, a2, a5
  1c:   63 86 05 00             beqz    a1, 0xc
  20:   13 e3 0e 00             ori     t1, t4, 0
  24:   6f 00 80 00             j       8
  28:   13 63 00 00             ori     t1, zero, 0
  2c:   b3 e6 68 00             or      a3, a7, t1
  30:   33 16 b6 00             sll     a2, a2, a1
  34:   33 57 f8 00             srl     a4, a6, a5
  38:   63 86 05 00             beqz    a1, 0xc
  3c:   13 68 07 00             ori     a6, a4, 0
  40:   6f 00 80 00             j       8
  44:   13 68 00 00             ori     a6, zero, 0
  48:   33 6e 06 01             or      t3, a2, a6
  4c:   93 02 00 04             addi    t0, zero, 0x40
  50:   63 f6 55 00             bgeu    a1, t0, 0xc
  54:   13 e5 06 00             ori     a0, a3, 0
  58:   6f 00 80 00             j       8
  5c:   13 65 0e 00             ori     a0, t3, 0
  60:   63 f6 55 00             bgeu    a1, t0, 0xc
  64:   93 65 0e 00             ori     a1, t3, 0
  68:   6f 00 80 00             j       8
  6c:   93 e5 06 00             ori     a1, a3, 0
  70:   67 80 00 00             ret

</details>

view this post on Zulip Wasmtime GitHub notifications bot (Jan 05 2023 at 11:26):

afonso360 labeled issue #5523:

:wave: Hey,

.clif Test Case

test interpret
test run
target riscv64

function %a(i16, i128) -> i128 system_v {
block0(v0: i16, v1: i128):
    v2 = rotl v1, v0
    return v2
}

; run: %a(64, 1095219937288) == 20203241887575960770402119057408

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(64, 1095219937288) == 20203241887575960770402119057408, actual: 20203241887575960771497338994696
1 tests
Error: 1 failure

Versions and Environment

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

Extra Info

<details>
<summary>Disassembly:</summary>

Disassembly of 116 bytes:
   0:   13 e7 05 00             ori     a4, a1, 0
   4:   93 75 f5 07             andi    a1, a0, 0x7f
   8:   93 06 00 08             addi    a3, zero, 0x80
   c:   b3 87 b6 40             sub     a5, a3, a1
  10:   13 68 07 00             ori     a6, a4, 0
  14:   b3 18 b8 00             sll     a7, a6, a1
  18:   b3 5e f6 00             srl     t4, a2, a5
  1c:   63 86 05 00             beqz    a1, 0xc
  20:   13 e3 0e 00             ori     t1, t4, 0
  24:   6f 00 80 00             j       8
  28:   13 63 00 00             ori     t1, zero, 0
  2c:   b3 e6 68 00             or      a3, a7, t1
  30:   33 16 b6 00             sll     a2, a2, a1
  34:   33 57 f8 00             srl     a4, a6, a5
  38:   63 86 05 00             beqz    a1, 0xc
  3c:   13 68 07 00             ori     a6, a4, 0
  40:   6f 00 80 00             j       8
  44:   13 68 00 00             ori     a6, zero, 0
  48:   33 6e 06 01             or      t3, a2, a6
  4c:   93 02 00 04             addi    t0, zero, 0x40
  50:   63 f6 55 00             bgeu    a1, t0, 0xc
  54:   13 e5 06 00             ori     a0, a3, 0
  58:   6f 00 80 00             j       8
  5c:   13 65 0e 00             ori     a0, t3, 0
  60:   63 f6 55 00             bgeu    a1, t0, 0xc
  64:   93 65 0e 00             ori     a1, t3, 0
  68:   6f 00 80 00             j       8
  6c:   93 e5 06 00             ori     a1, a3, 0
  70:   67 80 00 00             ret

</details>

view this post on Zulip Wasmtime GitHub notifications bot (Jan 05 2023 at 11:26):

afonso360 opened issue #5523:

:wave: Hey,

.clif Test Case

test interpret
test run
target riscv64

function %a(i16, i128) -> i128 system_v {
block0(v0: i16, v1: i128):
    v2 = rotl v1, v0
    return v2
}

; run: %a(64, 1095219937288) == 20203241887575960770402119057408

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(64, 1095219937288) == 20203241887575960770402119057408, actual: 20203241887575960771497338994696
1 tests
Error: 1 failure

Versions and Environment

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

Extra Info

<details>
<summary>Disassembly:</summary>

Disassembly of 116 bytes:
   0:   13 e7 05 00             ori     a4, a1, 0
   4:   93 75 f5 07             andi    a1, a0, 0x7f
   8:   93 06 00 08             addi    a3, zero, 0x80
   c:   b3 87 b6 40             sub     a5, a3, a1
  10:   13 68 07 00             ori     a6, a4, 0
  14:   b3 18 b8 00             sll     a7, a6, a1
  18:   b3 5e f6 00             srl     t4, a2, a5
  1c:   63 86 05 00             beqz    a1, 0xc
  20:   13 e3 0e 00             ori     t1, t4, 0
  24:   6f 00 80 00             j       8
  28:   13 63 00 00             ori     t1, zero, 0
  2c:   b3 e6 68 00             or      a3, a7, t1
  30:   33 16 b6 00             sll     a2, a2, a1
  34:   33 57 f8 00             srl     a4, a6, a5
  38:   63 86 05 00             beqz    a1, 0xc
  3c:   13 68 07 00             ori     a6, a4, 0
  40:   6f 00 80 00             j       8
  44:   13 68 00 00             ori     a6, zero, 0
  48:   33 6e 06 01             or      t3, a2, a6
  4c:   93 02 00 04             addi    t0, zero, 0x40
  50:   63 f6 55 00             bgeu    a1, t0, 0xc
  54:   13 e5 06 00             ori     a0, a3, 0
  58:   6f 00 80 00             j       8
  5c:   13 65 0e 00             ori     a0, t3, 0
  60:   63 f6 55 00             bgeu    a1, t0, 0xc
  64:   93 65 0e 00             ori     a1, t3, 0
  68:   6f 00 80 00             j       8
  6c:   93 e5 06 00             ori     a1, a3, 0
  70:   67 80 00 00             ret

</details>

view this post on Zulip Wasmtime GitHub notifications bot (Jan 05 2023 at 11:34):

afonso360 edited issue #5523:

:wave: Hey,

.clif Test Case

test interpret
test run
target riscv64

function %a(i16, i128) -> i128 system_v {
block0(v0: i16, v1: i128):
    v2 = rotl v1, v0
    return v2
}

; run: %a(64, 1095219937288) == 20203241887575960770402119057408

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(64, 1095219937288) == 20203241887575960770402119057408, actual: 20203241887575960771497338994696
1 tests
Error: 1 failure

Versions and Environment

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

Extra Info

<details>
<summary>Disassembly:</summary>

Disassembly of 116 bytes:
   0:   13 e7 05 00             ori     a4, a1, 0
   4:   93 75 f5 07             andi    a1, a0, 0x7f
   8:   93 06 00 08             addi    a3, zero, 0x80
   c:   b3 87 b6 40             sub     a5, a3, a1
  10:   13 68 07 00             ori     a6, a4, 0
  14:   b3 18 b8 00             sll     a7, a6, a1
  18:   b3 5e f6 00             srl     t4, a2, a5
  1c:   63 86 05 00             beqz    a1, 0xc
  20:   13 e3 0e 00             ori     t1, t4, 0
  24:   6f 00 80 00             j       8
  28:   13 63 00 00             ori     t1, zero, 0
  2c:   b3 e6 68 00             or      a3, a7, t1
  30:   33 16 b6 00             sll     a2, a2, a1
  34:   33 57 f8 00             srl     a4, a6, a5
  38:   63 86 05 00             beqz    a1, 0xc
  3c:   13 68 07 00             ori     a6, a4, 0
  40:   6f 00 80 00             j       8
  44:   13 68 00 00             ori     a6, zero, 0
  48:   33 6e 06 01             or      t3, a2, a6
  4c:   93 02 00 04             addi    t0, zero, 0x40
  50:   63 f6 55 00             bgeu    a1, t0, 0xc
  54:   13 e5 06 00             ori     a0, a3, 0
  58:   6f 00 80 00             j       8
  5c:   13 65 0e 00             ori     a0, t3, 0
  60:   63 f6 55 00             bgeu    a1, t0, 0xc
  64:   93 65 0e 00             ori     a1, t3, 0
  68:   6f 00 80 00             j       8
  6c:   93 e5 06 00             ori     a1, a3, 0
  70:   67 80 00 00             ret

</details>

view this post on Zulip Wasmtime GitHub notifications bot (Jan 05 2023 at 21:47):

fitzgen commented on issue #5523:

cc @yuyang-ok

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

elliottt labeled issue #5523:

:wave: Hey,

.clif Test Case

test interpret
test run
target riscv64

function %a(i16, i128) -> i128 system_v {
block0(v0: i16, v1: i128):
    v2 = rotl v1, v0
    return v2
}

; run: %a(64, 1095219937288) == 20203241887575960770402119057408

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(64, 1095219937288) == 20203241887575960770402119057408, actual: 20203241887575960771497338994696
1 tests
Error: 1 failure

Versions and Environment

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

Extra Info

<details>
<summary>Disassembly:</summary>

Disassembly of 116 bytes:
   0:   13 e7 05 00             ori     a4, a1, 0
   4:   93 75 f5 07             andi    a1, a0, 0x7f
   8:   93 06 00 08             addi    a3, zero, 0x80
   c:   b3 87 b6 40             sub     a5, a3, a1
  10:   13 68 07 00             ori     a6, a4, 0
  14:   b3 18 b8 00             sll     a7, a6, a1
  18:   b3 5e f6 00             srl     t4, a2, a5
  1c:   63 86 05 00             beqz    a1, 0xc
  20:   13 e3 0e 00             ori     t1, t4, 0
  24:   6f 00 80 00             j       8
  28:   13 63 00 00             ori     t1, zero, 0
  2c:   b3 e6 68 00             or      a3, a7, t1
  30:   33 16 b6 00             sll     a2, a2, a1
  34:   33 57 f8 00             srl     a4, a6, a5
  38:   63 86 05 00             beqz    a1, 0xc
  3c:   13 68 07 00             ori     a6, a4, 0
  40:   6f 00 80 00             j       8
  44:   13 68 00 00             ori     a6, zero, 0
  48:   33 6e 06 01             or      t3, a2, a6
  4c:   93 02 00 04             addi    t0, zero, 0x40
  50:   63 f6 55 00             bgeu    a1, t0, 0xc
  54:   13 e5 06 00             ori     a0, a3, 0
  58:   6f 00 80 00             j       8
  5c:   13 65 0e 00             ori     a0, t3, 0
  60:   63 f6 55 00             bgeu    a1, t0, 0xc
  64:   93 65 0e 00             ori     a1, t3, 0
  68:   6f 00 80 00             j       8
  6c:   93 e5 06 00             ori     a1, a3, 0
  70:   67 80 00 00             ret

</details>

view this post on Zulip Wasmtime GitHub notifications bot (Feb 05 2023 at 21:05):

afonso360 closed issue #5523:

:wave: Hey,

.clif Test Case

test interpret
test run
target riscv64

function %a(i16, i128) -> i128 system_v {
block0(v0: i16, v1: i128):
    v2 = rotl v1, v0
    return v2
}

; run: %a(64, 1095219937288) == 20203241887575960770402119057408

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(64, 1095219937288) == 20203241887575960770402119057408, actual: 20203241887575960771497338994696
1 tests
Error: 1 failure

Versions and Environment

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

Extra Info

<details>
<summary>Disassembly:</summary>

Disassembly of 116 bytes:
   0:   13 e7 05 00             ori     a4, a1, 0
   4:   93 75 f5 07             andi    a1, a0, 0x7f
   8:   93 06 00 08             addi    a3, zero, 0x80
   c:   b3 87 b6 40             sub     a5, a3, a1
  10:   13 68 07 00             ori     a6, a4, 0
  14:   b3 18 b8 00             sll     a7, a6, a1
  18:   b3 5e f6 00             srl     t4, a2, a5
  1c:   63 86 05 00             beqz    a1, 0xc
  20:   13 e3 0e 00             ori     t1, t4, 0
  24:   6f 00 80 00             j       8
  28:   13 63 00 00             ori     t1, zero, 0
  2c:   b3 e6 68 00             or      a3, a7, t1
  30:   33 16 b6 00             sll     a2, a2, a1
  34:   33 57 f8 00             srl     a4, a6, a5
  38:   63 86 05 00             beqz    a1, 0xc
  3c:   13 68 07 00             ori     a6, a4, 0
  40:   6f 00 80 00             j       8
  44:   13 68 00 00             ori     a6, zero, 0
  48:   33 6e 06 01             or      t3, a2, a6
  4c:   93 02 00 04             addi    t0, zero, 0x40
  50:   63 f6 55 00             bgeu    a1, t0, 0xc
  54:   13 e5 06 00             ori     a0, a3, 0
  58:   6f 00 80 00             j       8
  5c:   13 65 0e 00             ori     a0, t3, 0
  60:   63 f6 55 00             bgeu    a1, t0, 0xc
  64:   93 65 0e 00             ori     a1, t3, 0
  68:   6f 00 80 00             j       8
  6c:   93 e5 06 00             ori     a1, a3, 0
  70:   67 80 00 00             ret

</details>


Last updated: Dec 23 2024 at 12:05 UTC