afonso360 opened issue #5917:
:wave: Hey,
Just to doublecheck this one, I ran it on AArch64 and S390X and both agree with the interpreter.
.clif
Test Casetest interpret test run target x86_64 target aarch64 target s390x function %a(i16x8, i16x8) -> i16x8 { block0(v1: i16x8, v3: i16x8): v19 = vselect v1, v1, v3 return v19 } ; run: %a(0x000000000000000000000000e62fffff, 0x00000000000000000000000000000000) == 0x000000000000000000000000e62fffff
Steps to Reproduce
clif-util test ./the-above.clif
Expected Results
The test to pass.
Actual Results
Running `/home/afonso/git/wasmtime/target/debug/clif-util test ./lmao.clif` ERROR cranelift_filetests::concurrent > FAIL: run FAIL ./lmao.clif: run Caused by: Failed test: run: %a(0x000000000000000000000000e62fffff, 0x00000000000000000000000000000000) == 0x000000000000000000000000e62fffff, actual: 0x000000000000000000000000e600ffff 1 tests Error: 1 failure
It passes on AArch64 and S390X.
Versions and Environment
Cranelift version or commit: main
Operating system: Linux
Architecture: x86_64
afonso360 labeled issue #5917:
:wave: Hey,
Just to doublecheck this one, I ran it on AArch64 and S390X and both agree with the interpreter.
.clif
Test Casetest interpret test run target x86_64 target aarch64 target s390x function %a(i16x8, i16x8) -> i16x8 { block0(v1: i16x8, v3: i16x8): v19 = vselect v1, v1, v3 return v19 } ; run: %a(0x000000000000000000000000e62fffff, 0x00000000000000000000000000000000) == 0x000000000000000000000000e62fffff
Steps to Reproduce
clif-util test ./the-above.clif
Expected Results
The test to pass.
Actual Results
Running `/home/afonso/git/wasmtime/target/debug/clif-util test ./lmao.clif` ERROR cranelift_filetests::concurrent > FAIL: run FAIL ./lmao.clif: run Caused by: Failed test: run: %a(0x000000000000000000000000e62fffff, 0x00000000000000000000000000000000) == 0x000000000000000000000000e62fffff, actual: 0x000000000000000000000000e600ffff 1 tests Error: 1 failure
It passes on AArch64 and S390X.
Versions and Environment
Cranelift version or commit: main
Operating system: Linux
Architecture: x86_64
afonso360 labeled issue #5917:
:wave: Hey,
Just to doublecheck this one, I ran it on AArch64 and S390X and both agree with the interpreter.
.clif
Test Casetest interpret test run target x86_64 target aarch64 target s390x function %a(i16x8, i16x8) -> i16x8 { block0(v1: i16x8, v3: i16x8): v19 = vselect v1, v1, v3 return v19 } ; run: %a(0x000000000000000000000000e62fffff, 0x00000000000000000000000000000000) == 0x000000000000000000000000e62fffff
Steps to Reproduce
clif-util test ./the-above.clif
Expected Results
The test to pass.
Actual Results
Running `/home/afonso/git/wasmtime/target/debug/clif-util test ./lmao.clif` ERROR cranelift_filetests::concurrent > FAIL: run FAIL ./lmao.clif: run Caused by: Failed test: run: %a(0x000000000000000000000000e62fffff, 0x00000000000000000000000000000000) == 0x000000000000000000000000e62fffff, actual: 0x000000000000000000000000e600ffff 1 tests Error: 1 failure
It passes on AArch64 and S390X.
Versions and Environment
Cranelift version or commit: main
Operating system: Linux
Architecture: x86_64
afonso360 labeled issue #5917:
:wave: Hey,
Just to doublecheck this one, I ran it on AArch64 and S390X and both agree with the interpreter.
.clif
Test Casetest interpret test run target x86_64 target aarch64 target s390x function %a(i16x8, i16x8) -> i16x8 { block0(v1: i16x8, v3: i16x8): v19 = vselect v1, v1, v3 return v19 } ; run: %a(0x000000000000000000000000e62fffff, 0x00000000000000000000000000000000) == 0x000000000000000000000000e62fffff
Steps to Reproduce
clif-util test ./the-above.clif
Expected Results
The test to pass.
Actual Results
Running `/home/afonso/git/wasmtime/target/debug/clif-util test ./lmao.clif` ERROR cranelift_filetests::concurrent > FAIL: run FAIL ./lmao.clif: run Caused by: Failed test: run: %a(0x000000000000000000000000e62fffff, 0x00000000000000000000000000000000) == 0x000000000000000000000000e62fffff, actual: 0x000000000000000000000000e600ffff 1 tests Error: 1 failure
It passes on AArch64 and S390X.
Versions and Environment
Cranelift version or commit: main
Operating system: Linux
Architecture: x86_64
jameysharp commented on issue #5917:
I'm guessing that x86 is only looking at the most significant bit in each lane, so
e2
is treated as "true" for the whole lane while2f
is treated as false. But I think we specified this instruction to select each bit independently, not each lane.
alexcrichton commented on issue #5917:
It looks like this isn't used in wasm lowering today (which is good given it's broken!) but it is used when NaN canonicalization is enabled.
That being said though I suspect we may wish to remove this instruction from Cranelift. The implementation of
vselect
matchesbitselect
on AArch64 and s390x, neither of which matches the documentation ofvselect
selecting based on "truthy" values. I think this means that the interpreter also differs from AArch64 and s390x.Given that the only current use of
vselect
is during NaN canonicalization, and that can usebitselect
, perhaps the instruction should be removed?
alexcrichton closed issue #5917:
:wave: Hey,
Just to doublecheck this one, I ran it on AArch64 and S390X and both agree with the interpreter.
.clif
Test Casetest interpret test run target x86_64 target aarch64 target s390x function %a(i16x8, i16x8) -> i16x8 { block0(v1: i16x8, v3: i16x8): v19 = vselect v1, v1, v3 return v19 } ; run: %a(0x000000000000000000000000e62fffff, 0x00000000000000000000000000000000) == 0x000000000000000000000000e62fffff
Steps to Reproduce
clif-util test ./the-above.clif
Expected Results
The test to pass.
Actual Results
Running `/home/afonso/git/wasmtime/target/debug/clif-util test ./lmao.clif` ERROR cranelift_filetests::concurrent > FAIL: run FAIL ./lmao.clif: run Caused by: Failed test: run: %a(0x000000000000000000000000e62fffff, 0x00000000000000000000000000000000) == 0x000000000000000000000000e62fffff, actual: 0x000000000000000000000000e600ffff 1 tests Error: 1 failure
It passes on AArch64 and S390X.
Versions and Environment
Cranelift version or commit: main
Operating system: Linux
Architecture: x86_64
Last updated: Nov 22 2024 at 16:03 UTC