Skip to content

Commit

Permalink
[SINGLEPASS] Added a special case on SSE4.2 backend when dst == src1 …
Browse files Browse the repository at this point in the history
…(for #3461)
  • Loading branch information
ptitSeb committed Jan 5, 2023
1 parent 0e81d2f commit 1d96053
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 1d96053

Please sign in to comment.