Skip to content

Commit

Permalink
Merge pull request #3465 from sydhds/singlepass_fix_sse42_backend_sse…
Browse files Browse the repository at this point in the history
…_round

Remove assert in sse_round_fn and handle case where src2 is in memory
  • Loading branch information
syrusakbary authored Jan 19, 2023
2 parents d329044 + 8481a84 commit 580baeb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/compiler-singlepass/src/emitter_x64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -909,11 +909,14 @@ macro_rules! sse_round_fn {
|emitter: &mut AssemblerX64, precision: Precision, src1: XMM, src2: XMMOrMemory, dst: XMM| {
match src2 {
XMMOrMemory::XMM(x) => {
assert_eq!(src1, x);
move_src_to_dst(emitter, precision, src1, dst);
dynasm!(emitter ; $ins Rx((dst as u8)), Rx((dst as u8)), $mode)
if x != dst {
move_src_to_dst(emitter, precision, src1, dst);
}
dynasm!(emitter ; $ins Rx((x as u8)), Rx((dst as u8)), $mode)
}
XMMOrMemory::Memory(..) => unreachable!(),
XMMOrMemory::Memory(base, disp) => {
dynasm!(emitter ; $ins Rx((dst as u8)), [Rq((base as u8)) + disp], $mode)
},
}
}
}
Expand Down

0 comments on commit 580baeb

Please sign in to comment.