fn gen_clobber_save(
        call_conv: isa::CallConv,
        _: &settings::Flags,
        clobbers: &Set<Writable<RealReg>>,
        fixed_frame_storage_size: u32,
        _outgoing_args_size: u32,
    ) -> (u64, SmallVec<[Inst; 16]>) {
        let mut insts = SmallVec::new();
        let (clobbered_int, clobbered_vec) = get_regs_saved_in_prologue(call_conv, clobbers);

        let (int_save_bytes, vec_save_bytes) = saved_reg_stack_size(&clobbered_int, &clobbered_vec);
        let total_save_bytes = (vec_save_bytes + int_save_bytes) as i32;
        insts.extend(Self::gen_sp_reg_adjust(
            -(total_save_bytes + fixed_frame_storage_size as i32),
        ));

        for (i, reg_pair) in clobbered_int.chunks(2).enumerate() {
            let (r1, r2) = if reg_pair.len() == 2 {
                // .to_reg().to_reg(): Writable<RealReg> --> RealReg --> Reg
                (reg_pair[0].to_reg().to_reg(), reg_pair[1].to_reg().to_reg())
            } else {
                (reg_pair[0].to_reg().to_reg(), zero_reg())
            };

            debug_assert!(r1.get_class() == RegClass::I64);
            debug_assert!(r2.get_class() == RegClass::I64);

            // stp r1, r2, [sp, #(i * #16)]
            insts.push(Inst::StoreP64 {
                rt: r1,
                rt2: r2,
                mem: PairAMode::SignedOffset(
                    stack_reg(),
                    SImm7Scaled::maybe_from_i64((i * 16) as i64, types::I64).unwrap(),
                ),
            });
        }

        let vec_offset = int_save_bytes;
        for (i, reg) in clobbered_vec.iter().enumerate() {
            insts.push(Inst::FpuStore128 {
                rd: reg.to_reg().to_reg(),
                mem: AMode::Unscaled(
                    stack_reg(),
                    SImm9::maybe_from_i64((vec_offset + (i * 16)) as i64).unwrap(),
                ),
                srcloc: None,
            });
        }

        (total_save_bytes as u64, insts)
    }
// Returns stack bytes used as well as instructions. Does not adjust
// nominal SP offset; abi_impl generic code will do that.
Returns stack bytes used as well as instructions. Does not adjust
nominal SP offset; abi_impl generic code will do that.
Returns stack bytes used as well as instructions . Does not adjust nominal SP offset ; abi_impl generic code will do that .
fn gen_clobber_save(
        call_conv: isa::CallConv,
        _: &settings::Flags,
        clobbers: &Set<Writable<RealReg>>,
        fixed_frame_storage_size: u32,
        _outgoing_args_size: u32,
    ) -> (u64, SmallVec<[Inst; 16]>) {
        let mut insts = SmallVec::new();
        let (clobbered_int, clobbered_vec) = get_regs_saved_in_prologue(call_conv, clobbers);
        let (int_save_bytes, vec_save_bytes) = saved_reg_stack_size(&clobbered_int, &clobbered_vec);
        let total_save_bytes = (vec_save_bytes + int_save_bytes) as i32;
        insts.extend(Self::gen_sp_reg_adjust(
            -(total_save_bytes + fixed_frame_storage_size as i32),
        ));
        for (i, reg_pair) in clobbered_int.chunks(2).enumerate() {
            let (r1, r2) = if reg_pair.len() == 2 {
                // .to_reg().to_reg(): Writable<RealReg> --> RealReg --> Reg
                (reg_pair[0].to_reg().to_reg(), reg_pair[1].to_reg().to_reg())
            } else {
                (reg_pair[0].to_reg().to_reg(), zero_reg())
            };
            debug_assert!(r1.get_class() == RegClass::I64);
            debug_assert!(r2.get_class() == RegClass::I64);
            // stp r1, r2, [sp, #(i * #16)]
            insts.push(Inst::StoreP64 {
                rt: r1,
                rt2: r2,
                mem: PairAMode::SignedOffset(
                    stack_reg(),
                    SImm7Scaled::maybe_from_i64((i * 16) as i64, types::I64).unwrap(),
                ),
            });
        }
        let vec_offset = int_save_bytes;
        for (i, reg) in clobbered_vec.iter().enumerate() {
            insts.push(Inst::FpuStore128 {
                rd: reg.to_reg().to_reg(),
                mem: AMode::Unscaled(
                    stack_reg(),
                    SImm9::maybe_from_i64((vec_offset + (i * 16)) as i64).unwrap(),
                ),
                srcloc: None,
            });
        }
        (total_save_bytes as u64, insts)
    }
fn gen_clobber_save ( call_conv : isa :: CallConv , _ : & settings :: Flags , clobbers : & Set < Writable < RealReg > > , fixed_frame_storage_size : u32 , _outgoing_args_size : u32 , ) -> ( u64 , SmallVec < [ Inst ; 16 ] > ) { let mut insts = SmallVec :: new ( ) ; let ( clobbered_int , clobbered_vec ) = get_regs_saved_in_prologue ( call_conv , clobbers ) ; let ( int_save_bytes , vec_save_bytes ) = saved_reg_stack_size ( & clobbered_int , & clobbered_vec ) ; let total_save_bytes = ( vec_save_bytes + int_save_bytes ) as i32 ; insts . extend ( Self :: gen_sp_reg_adjust ( - ( total_save_bytes + fixed_frame_storage_size as i32 ) , ) ) ; for ( i , reg_pair ) in clobbered_int . chunks ( 2 ) . enumerate ( ) { let ( r1 , r2 ) = if reg_pair . len ( ) == 2 { // .to_reg().to_reg(): Writable<RealReg> --> RealReg --> Reg ( reg_pair [ 0 ] . to_reg ( ) . to_reg ( ) , reg_pair [ 1 ] . to_reg ( ) . to_reg ( ) ) } else { ( reg_pair [ 0 ] . to_reg ( ) . to_reg ( ) , zero_reg ( ) ) } ; debug_assert ! ( r1 get_class ( ) RegClass I64 ) ; debug_assert ! ( r2 get_class ( ) RegClass I64 ) ; // stp r1, r2, [sp, #(i * #16)] insts . push ( Inst :: StoreP64 { rt : r1 , rt2 : r2 , mem : PairAMode :: SignedOffset ( stack_reg ( ) , SImm7Scaled :: maybe_from_i64 ( ( i * 16 ) as i64 , types :: I64 ) . unwrap ( ) , ) , } ) ; } let vec_offset = int_save_bytes ; for ( i , reg ) in clobbered_vec . iter ( ) . enumerate ( ) { insts . push ( Inst :: FpuStore128 { rd : reg . to_reg ( ) . to_reg ( ) , mem : AMode :: Unscaled ( stack_reg ( ) , SImm9 :: maybe_from_i64 ( ( vec_offset + ( i * 16 ) ) as i64 ) . unwrap ( ) , ) , srcloc : None , } ) ; } ( total_save_bytes as u64 , insts ) }
Returns stack bytes used as well as instructions.
Returns stack bytes used as well as instructions .
call_conv
&settings::Flags
clobbers
&Set<Writable<RealReg>>
fixed_frame_storage_size
u32
_outgoing_args_size
u32
call_conv
&settings::Flags
clobbers
&Set<Writable<RealReg>>
fixed_frame_storage_size
u32
_outgoing_args_size
u32