mirror of
https://github.com/fluencelabs/wasmer
synced 2025-03-16 00:00:49 +00:00
Fix emit_lea.
This commit is contained in:
parent
05557fc9ad
commit
d8b313e3fd
@ -325,10 +325,18 @@ impl Emitter for Assembler {
|
||||
fn emit_lea(&mut self, sz: Size, src: Location, dst: Location) {
|
||||
match (sz, src, dst) {
|
||||
(Size::S32, Location::Memory(src, disp), Location::GPR(dst)) => {
|
||||
dynasm!(self ; add W(map_gpr(dst).x()), W(map_gpr(src).x()), disp as u32);
|
||||
if disp >= 0 {
|
||||
dynasm!(self ; add W(map_gpr(dst).x()), W(map_gpr(src).x()), disp as u32);
|
||||
} else {
|
||||
dynasm!(self ; sub W(map_gpr(dst).x()), W(map_gpr(src).x()), (-disp) as u32);
|
||||
}
|
||||
}
|
||||
(Size::S64, Location::Memory(src, disp), Location::GPR(dst)) => {
|
||||
dynasm!(self ; add X(map_gpr(dst).x()), X(map_gpr(src).x()), disp as u32);
|
||||
if disp >= 0 {
|
||||
dynasm!(self ; add X(map_gpr(dst).x()), X(map_gpr(src).x()), disp as u32);
|
||||
} else {
|
||||
dynasm!(self ; sub X(map_gpr(dst).x()), X(map_gpr(src).x()), (-disp) as u32);
|
||||
}
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user