Skip to content

Commit

Permalink
[fix]: Fixed some errors in the register being used in sse instructio…
Browse files Browse the repository at this point in the history
…ns. Changed the roundss/sd function
  • Loading branch information
batconjurer committed Feb 6, 2022
1 parent 4ee83b3 commit 98b70d9
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions lib/compiler-singlepass/src/emitter_x64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ macro_rules! sse_fn {
|emitter: &mut AssemblerX64, precision: Precision, src1: XMM, src2: XMMOrMemory, dst: XMM| {
match src2 {
XMMOrMemory::XMM(x) => {
move_src_to_dst(emitter, precision, src1, dst);
move_src_to_dst(emitter, precision, src1, dst)
dynasm!(emitter ; $ins Rx((dst as u8)), Rx((x as u8)))
}
XMMOrMemory::Memory(base, disp) => {
Expand All @@ -595,7 +595,7 @@ macro_rules! sse_fn {
}
XMMOrMemory::Memory(base, disp) => {
move_src_to_dst(emitter, precision, src1, dst);
dynasm!(emitter ; $ins Rx((src1 as u8)), [Rq((base as u8)) + disp], $mode)
dynasm!(emitter ; $ins Rx((dst as u8)), [Rq((base as u8)) + disp], $mode)
}
}
}
Expand Down Expand Up @@ -657,7 +657,7 @@ macro_rules! sse_i2f_64_fn {
},
GPROrMemory::Memory(base, disp) => {
move_src_to_dst(emitter, precision, src1, dst);
dynasm!(emitter ; $ins Rx((src1 as u8)), QWORD [Rq((base as u8)) + disp])
dynasm!(emitter ; $ins Rx((dst as u8)), QWORD [Rq((base as u8)) + disp])
}
}
}
Expand Down Expand Up @@ -719,7 +719,7 @@ macro_rules! sse_i2f_32_fn {
},
GPROrMemory::Memory(base, disp) => {
move_src_to_dst(emitter, precision, src1, dst);
dynasm!(emitter ; $ins Rx((src1 as u8)), DWORD [Rq((base as u8)) + disp])
dynasm!(emitter ; $ins Rx((dst as u8)), DWORD [Rq((base as u8)) + disp])
}
}
}
Expand All @@ -742,13 +742,11 @@ 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((src1 as u8)), Rx((x as u8)), $mode)
}
XMMOrMemory::Memory(base, disp) => {
move_src_to_dst(emitter, precision, src1, dst);
dynasm!(emitter ; $ins Rx((src1 as u8)), [Rq((base as u8)) + disp], $mode)
dynasm!(emitter ; $ins Rx((dst as u8)), Rx((dst as u8)), $mode)
}
XMMOrMemory::Memory(base, disp) => unreachable!(),
}
}
}
Expand Down

0 comments on commit 98b70d9

Please sign in to comment.