We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using M1 + singlepass compiler causes stucking in loop for that code for example:
(module (func $popcnt (export "popcnt") (param i32) (result i32) local.get 0 i32.popcnt ) )
If param == 1, then function popcnt call execution lasts forever.
popcnt
Use wasmer in Cargo.toml like this:
wasmer = { version = "2.3.0", default-features = false, features = ["default-singlepass", "default-universal", "wat", "sys"] }
$ rustc -V rustc 1.65.0-nightly (17cbdfd07 2022-09-13) $ uname -a ... MacBook-Pro.local 21.6.0 Darwin Kernel Version 21.6.0 ... RELEASE_ARM64_T6000 arm64
cargo test
This happen because this assembler execution on M1 result conflicts with Aarch64 documentation:
mov w1, 32 mov w2, 1 lsl w3, w2, w1
There will be 1 in w3, but due documentation must be 0. (The same for 64 registers)
1
w3
0
You can reproduce this:
$ as -o arm.o arm.s && ld -o arm arm.o -lSystem -syslibroot `xcrun -sdk macosx --show-sdk-path` -e _start -arch arm64
$ ./arm ; echo $? 1
The text was updated successfully, but these errors were encountered:
Merge #3211
47c3491
3211: fix popcnt for aarch64 r=ptitSeb a=grishasobol # Description Fix problem with infinite `popcnt` WASM instruction execution on M1 processor. See details in corresponded issue: #3210 # Review 1) Make fix for `i32.popcnt`. Use additional execution branch if `src` register equal to `1`: ``` if src == 0 => goto exit_label if src == 1 => goto src_is_one_label loop_label: ... // popcnt loop body goto exit_label src_is_one_label: mov dest, 1 exit_label: ``` Co-authored-by: Gregory Sobol <[email protected]>
This should be fixed by #3211
Sorry, something went wrong.
4ad7020
@grishasobol can you confirm the ticket can be closed?
ptitSeb
No branches or pull requests
Describe the bug
Using M1 + singlepass compiler causes stucking in loop for that code for example:
If param == 1, then function
popcnt
call execution lasts forever.Environment
Use wasmer in Cargo.toml like this:
Steps to reproduce
cargo test
on machine with M1 processor (see Environment above).Additional context
This happen because this assembler execution on M1 result conflicts with Aarch64 documentation:
There will be
1
inw3
, but due documentation must be0
. (The same for 64 registers)You can reproduce this:
The text was updated successfully, but these errors were encountered: