From d80737d54867b6daf35c0411bed90d181c6a1850 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Fri, 23 Oct 2020 12:03:49 -0500 Subject: [PATCH] impl mov reg, imm(rsp) --- .../codegen/src/isa/x64/inst/unwind/systemv.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cranelift/codegen/src/isa/x64/inst/unwind/systemv.rs b/cranelift/codegen/src/isa/x64/inst/unwind/systemv.rs index bd6d7a02da14..8f940753d1ec 100644 --- a/cranelift/codegen/src/isa/x64/inst/unwind/systemv.rs +++ b/cranelift/codegen/src/isa/x64/inst/unwind/systemv.rs @@ -132,12 +132,17 @@ pub(crate) fn create_unwind_info( codes.push(UnwindCode::StackAlloc { offset, size: imm }); } Inst::MovRM { - src: _, - dst: SyntheticAmode::Real(Amode::ImmReg { simm32: _, base }), + src, + dst: SyntheticAmode::Real(Amode::ImmReg { simm32, base }), .. } if *base == regs::rsp() => { - // `mov reg, imm(rsp)` -- similar to push - // builder.store_reg_at(offset, *simm32, *src) + // `mov reg, imm(rsp)` + let imm = *simm32; + codes.push(UnwindCode::SaveRegister { + offset, + reg: *src, + stack_offset: imm, + }); } Inst::AluRmiR { is_64: true,