<?xml version="1.0" encoding="UTF-8"?>

<compiler_spec>
  <!-- Copied from ARM.cspec and modified... See: https://docs.microsoft.com/en-us/cpp/build/overview-of-arm-abi-conventions?view=vs-2019 -->
  <data_organization>
     <absolute_max_alignment value="0" />
     <machine_alignment value="2" />
     <default_alignment value="1" />
     <default_pointer_alignment value="4" />
     <pointer_size value="4" />
     <wchar_size value="2" />
     <short_size value="2" />
     <integer_size value="4" />
     <long_size value="4" />
     <long_long_size value="8" />
     <float_size value="4" />
     <double_size value="8" />
     <long_double_size value="8" />
     <size_alignment_map>
          <entry size="1" alignment="1" />
          <entry size="2" alignment="2" />
          <entry size="4" alignment="4" />
          <entry size="8" alignment="8" />
     </size_alignment_map>
     <bitfield_packing>
     	  <use_MS_convention value="true"/>
     </bitfield_packing>
  </data_organization>

  <global>
    <range space="ram"/>
  </global>

  <stackpointer register="sp" space="ram"/>
  
  <funcptr align="2"/>     <!-- Function pointers are word aligned and leastsig bit may encode otherstuff -->
  <default_proto>
    <prototype name="__stdcall" extrapop="0" stackshift="0">
      <input>
        <!-- we cannot accurately model the allocation scheme when parameters are larger than 4 bytes -->
        <pentry minsize="1" maxsize="4" metatype="float">
          <register name="s0"/>
        </pentry>
        <pentry minsize="1" maxsize="4" metatype="float">
          <register name="s1"/>
        </pentry>
        <pentry minsize="1" maxsize="4" metatype="float">
          <register name="s2"/>
        </pentry>
        <pentry minsize="1" maxsize="4" metatype="float">
          <register name="s3"/>
        </pentry>
        <pentry minsize="1" maxsize="4" metatype="float">
          <register name="s4"/>
        </pentry>
        <pentry minsize="1" maxsize="4" metatype="float">
          <register name="s5"/>
        </pentry>
        <pentry minsize="1" maxsize="4" metatype="float">
          <register name="s6"/>
        </pentry>
        <pentry minsize="1" maxsize="4" metatype="float">
          <register name="s7"/>
        </pentry>
        <pentry minsize="1" maxsize="4" extension="inttype">
          <register name="r0"/>
        </pentry>
        <pentry minsize="1" maxsize="4" extension="inttype">
          <register name="r1"/>
        </pentry>
        <pentry minsize="1" maxsize="4" extension="inttype">
          <register name="r2"/>
        </pentry>
        <pentry minsize="1" maxsize="4" extension="inttype">
          <register name="r3"/>
        </pentry>
        <pentry minsize="1" maxsize="500" align="4">
          <addr offset="0" space="stack"/>
        </pentry>
      </input>
      <output>
        <pentry minsize="1" maxsize="16" metatype="float">
          <register name="q0"/>
        </pentry>
        <pentry minsize="1" maxsize="4" extension="inttype">
          <register name="r0"/>
        </pentry>
        <pentry minsize="5" maxsize="8">
          <addr space="join" piece1="r1" piece2="r0"/>
        </pentry>
      </output>
      <unaffected>
        <register name="r4"/>
        <register name="r5"/>
        <register name="r6"/>
        <register name="r7"/>
        <register name="r8"/>
        <register name="r9"/>
        <register name="r10"/>
        <register name="r11"/>
        <register name="q4"/>
        <register name="q5"/>
        <register name="q6"/>
        <register name="q7"/>
        <register name="sp"/>
        <register name="lr"/>
        <register name="pc"/>
      </unaffected>
      <killedbycall>
          <register name="r0"/>
          <register name="r1"/>
          <register name="r2"/>
          <register name="r3"/>
          <register name="r12"/>
          <register name="q0"/>
          <register name="q1"/>
          <register name="q2"/>
          <register name="q3"/>
          <register name="q8"/>
          <register name="q9"/>
          <register name="q10"/>
          <register name="q11"/>
          <register name="q12"/>
          <register name="q13"/>
          <register name="q14"/>
          <register name="q15"/>
      </killedbycall>
    </prototype>
  </default_proto>
  
</compiler_spec>
