Skip to content

Commit

Permalink
Fix popcnt.
Browse files Browse the repository at this point in the history
  • Loading branch information
losfair committed Nov 16, 2019
1 parent 1db6425 commit 08beb99
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions lib/singlepass-backend/src/translator_aarch64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1248,9 +1248,12 @@ impl Emitter for Assembler {
self
; mov v_tmp1.S[0], w_tmp1
; cnt v_tmp1.B16, v_tmp1.B16
; mov W(map_gpr(dst).x()), v_tmp1.S[0]
; add W(map_gpr(dst).x()), W(map_gpr(dst).x()), W(map_gpr(dst).x()), lsr 16
; and W(map_gpr(dst).x()), W(map_gpr(dst).x()), 31
; mov w_tmp1, v_tmp1.S[0]
; mov W(map_gpr(dst).x()), w_tmp1
; add W(map_gpr(dst).x()), W(map_gpr(dst).x()), w_tmp1, lsr 8
; add W(map_gpr(dst).x()), W(map_gpr(dst).x()), w_tmp1, lsr 16
; add W(map_gpr(dst).x()), W(map_gpr(dst).x()), w_tmp1, lsr 24
; and W(map_gpr(dst).x()), W(map_gpr(dst).x()), 255
);
}
_ => unreachable!(),
Expand Down Expand Up @@ -1283,10 +1286,14 @@ impl Emitter for Assembler {
; cnt v_tmp1.B16, v_tmp1.B16
; mov x_tmp1, v_tmp1.D[0]
; mov X(map_gpr(dst).x()), x_tmp1
; add X(map_gpr(dst).x()), X(map_gpr(dst).x()), x_tmp1, lsr 8
; add X(map_gpr(dst).x()), X(map_gpr(dst).x()), x_tmp1, lsr 16
; add X(map_gpr(dst).x()), X(map_gpr(dst).x()), x_tmp1, lsr 24
; add X(map_gpr(dst).x()), X(map_gpr(dst).x()), x_tmp1, lsr 32
; add X(map_gpr(dst).x()), X(map_gpr(dst).x()), x_tmp1, lsr 40
; add X(map_gpr(dst).x()), X(map_gpr(dst).x()), x_tmp1, lsr 48
; and X(map_gpr(dst).x()), X(map_gpr(dst).x()), 63
; add X(map_gpr(dst).x()), X(map_gpr(dst).x()), x_tmp1, lsr 56
; and X(map_gpr(dst).x()), X(map_gpr(dst).x()), 255
);
}
_ => unreachable!(),
Expand Down
2 changes: 1 addition & 1 deletion src/bin/wasmer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ fn execute_wasm(options: &Run) -> Result<(), String> {
Some(fun) => fun,
_ => "main",
};
instance
let result = instance
.dyn_func(&invoke_fn)
.map_err(|e| format!("{:?}", e))?
.call(&args)
Expand Down

0 comments on commit 08beb99

Please sign in to comment.