123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869openArch_declopenArm_commonopenArm_declmoduletypeArm_input=sigvalcall_conv:(register,Arch_utils.empty,Arch_utils.empty,rflag,condt)calling_conventionendmoduleArm_core=structtypereg=registertyperegx=Arch_utils.emptytypexreg=Arch_utils.emptytypenonrecrflag=rflagtypecond=condttypeasm_op=Arm_instr_decl.arm_optypeextra_op=Arm_extra.arm_extra_opletatoI=X86_arch_full.atoIarm_declletasm_e=Arm_extra.arm_extraatoIletaparams=Arm_params.arm_paramsatoIletknown_implicits=["NF","_nf_";"ZF","_zf_";"CF","_cf_";"VF","_vf_"]letalloc_stack_need_extrasz=not(Arm_params_core.is_arith_small(Conv.cz_of_zsz))letis_ct_asm_op(o:asm_op)=matchowith|ARM_op((SDIV|UDIV),_)->false|_->true(* All of the extra ops compile into CT instructions (no DIV). *)letis_ct_asm_extra(_o:extra_op)=trueendmoduleArm(Lowering_params:Arm_input):Arch_full.Core_archwithtypereg=registerandtyperegx=Arch_utils.emptyandtypexreg=Arch_utils.emptyandtyperflag=rflagandtypecond=condtandtypeasm_op=Arm_instr_decl.arm_opandtypeextra_op=Arm_extra.arm_extra_op=structincludeArm_coreincludeLowering_params(* TODO_ARM: r9 is a platform register. (cf. arch_decl)
Here we assume it's just a variable register. *)letnot_saved_stack=(Arm_params.arm_liparamsatoI).lip_not_saved_stackletpp_asm=Pp_arm_m4.print_progletcallstyle=Arch_full.ByReg{call=SomeLR;return=false}(* Armv7-M guarantees that stack pointer values are at least 4-byte
aligned: writes to SP force bits [1:0] to zero (Arm v7-M Architecture
Reference Manual, B1.5.7), so a frame moving SP by a non-multiple of 4
would be silently rounded by the hardware. *)letsp_min_align=Wsize.U32letmax_store_size=Wsize.U32letinternal_call_conv=Arm_decl.arm_internal_call_convend