title: stp aarch64 instruction must be used with "non-contiguous pair of registers"
body: <p>The aarch64 architecture doesn't have instructions for multiple store and load, i.e. there are no equivalents of stm and ldm from armv7 arch.  Instead you must use the stp and ldp instructions for store and loading pairs of registers.</p>
  
  <p>Accroding to the ARM reference manual:</p>
  
  <p><a href="http://www.element14.com/community/servlet/JiveServlet/previewBody/41836-102-1-229511/ARM.Reference_Manual.pdf" rel="nofollow">http://www.element14.com/community/servlet/JiveServlet/previewBody/41836-102-1-229511/ARM.Reference_Manual.pdf</a></p>
  
  <blockquote>
    <p>There are no multiple register LDM, STM, PUSH and POP instructions, but load-store of a non-> contiguous pair of registers is available.  </p>
  </blockquote>
  
  <p>My question is, what does non-contiguous mean or refer to here?  My instant reaction was that it means you can't use consecutively numbered registers with these commands, e.g.</p>
  
  <pre><code>stp x0, x1, [sp, #-16]!
  </code></pre>
  
  <p>is illegal.  However I don't believe this is the case.  I've seen example code doing exactly this and furthermore I've managed to get (Apple's) Clang to generate similar code, e.g.</p>
  
  <pre><code>stp x1, x0, [fp, #-16]!
  </code></pre>
  
  <p>I can't for the life of me think what contiguous then means.  I thought it could be something to do with using overlapping registers, e.g.</p>
  
  <pre><code>stp x0, x0, [sp, #-16]!
  stp w0, x0, [sp, #-12]!
  </code></pre>
  
  <p>However I've seen example code doing this sort of things as well (not to say that code was correct!).  Also I would have explicitly used the terminology overlapping rather than contiguous if this were the case.</p>
  
  <p>Any ideas?</p>