Skip to content

Commit

Permalink
Merge pull request wasmerio#3462 from wasmerio/singlepass_fix_sse42_b…
Browse files Browse the repository at this point in the history
…ackend

[SINGLEPASS] Added a special case on SSE4.2 backend when dst == src1
  • Loading branch information
syrusakbary authored Jan 5, 2023
2 parents 0e81d2f + 1d96053 commit 256a97e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/compiler-singlepass/src/emitter_x64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -739,9 +739,12 @@ macro_rules! sse_fn {
|emitter: &mut AssemblerX64, precision: Precision, src1: XMM, src2: XMMOrMemory, dst: XMM| {
match src2 {
XMMOrMemory::XMM(x) => {
assert_ne!(x, dst);
move_src_to_dst(emitter, precision, src1, dst);
dynasm!(emitter ; $ins Rx((dst as u8)), Rx((x as u8)))
if x == dst {
dynasm!(emitter ; $ins Rx((dst as u8)), Rx((src1 as u8)))
} else {
move_src_to_dst(emitter, precision, src1, dst);
dynasm!(emitter ; $ins Rx((dst as u8)), Rx((x as u8)))
}
}
XMMOrMemory::Memory(base, disp) => {
move_src_to_dst(emitter, precision, src1, dst);
Expand Down

0 comments on commit 256a97e

Please sign in to comment.