collab/polyglot-riscv-arm

what if the same machine code was valid riscv and arm asm

git clone https://git.julia.blue/collab/polyglot-riscv-arm

Jonathan Dönszelmannwebsite start885cc4e

main
10.6 KiB81 linesraw
1<?xml version="1.0" encoding="utf-8"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="insn.css"/><meta name="generator" content="iform.xsl"/><title>POP (multiple registers) -- AArch32</title></head><body><table style="margin: 0 auto;"><tr><td><div class="topbar"><a href="index.html">Base Instructions</a></div></td><td><div class="topbar"><a href="fpsimdindex.html">SIMD&amp;FP Instructions</a></div></td><td><div class="topbar"><a href="a32_encindex.html">A32 Instructions by Encoding</a></div></td><td><div class="topbar"><a href="t32_encindex.html">T32 Instructions by Encoding</a></div></td><td><div class="topbar"><a href="shared_pseudocode.html">Shared Pseudocode</a></div></td><td><div class="topbar"><a href="notice.html">Proprietary Notice</a></div></td></tr></table><hr/><h2 class="instruction-section">POP (multiple registers)</h2><p>Pop Multiple Registers from Stack loads multiple general-purpose registers from the stack, loading from consecutive memory locations starting at the address in SP, and updates SP to point just above the loaded data.</p><p>
4        This is an alias of
5        <a href="ldm.html">LDM, LDMIA, LDMFD</a>.
6        This means:
7      </p><ul><li>
8          The encodings in this description are named to match the encodings of
9          <a href="ldm.html">LDM, LDMIA, LDMFD</a>.
10        </li><li>The description of <a href="ldm.html">LDM, LDMIA, LDMFD</a> gives the operational pseudocode, any <span class="arm-defined-word">constrained unpredictable</span> behavior, and any operational information for this instruction.</li></ul>
11    <p class="desc">
12      It has encodings from the following instruction sets:
13       A32 (
14      <a href="#iclass_a1">A1</a>
15      )
16       and 
17       T32 (
18      <a href="#iclass_t2">T2</a>
19      )
20      .
21    </p>
22    <h3 class="classheading"><a id="iclass_a1"/>A1</h3><div class="regdiagram-32"><table class="regdiagram"><thead><tr><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr></thead><tbody><tr class="firstrow"><td colspan="4" class="lr">!= 1111</td><td class="l">1</td><td>0</td><td class="r">0</td><td class="lr">0</td><td class="lr">1</td><td class="lr">0</td><td class="lr">1</td><td class="lr">1</td><td class="l">1</td><td>1</td><td>0</td><td class="r">1</td><td colspan="16" class="lr">register_list</td></tr><tr class="secondrow"><td colspan="4" class="droppedname">cond</td><td colspan="3"/><td/><td/><td/><td class="droppedname">W</td><td/><td colspan="4" class="droppedname">Rn</td><td colspan="16"/></tr></tbody></table></div><div class="encoding"><h4 class="encoding">A1</h4><a id="POP_LDM_A1"/><p class="asm-code">POP{<a href="#sa_c" title="See {xref{ARMARM_Babbefhf}{Standard assembler syntax fields}}">&lt;c&gt;</a>}{<a href="#sa_q" title="See {xref{ARMARM_Babbefhf}{Standard assembler syntax fields}}">&lt;q&gt;</a>} <a href="#sa_registers_4" title="List of two or more registers to be loaded">&lt;registers&gt;</a></p><p class="equivto">
23      is equivalent to
24    </p>
25          <p class="asm-code"><a href="ldm.html#LDM_A1">LDM</a>{<a href="#sa_c" title="See {xref{ARMARM_Babbefhf}{Standard assembler syntax fields}}">&lt;c&gt;</a>}{<a href="#sa_q" title="See {xref{ARMARM_Babbefhf}{Standard assembler syntax fields}}">&lt;q&gt;</a>} SP!, <a href="#sa_registers_4" title="List of two or more registers to be loaded">&lt;registers&gt;</a></p>
26          <p class="equivto">
27          and is the preferred disassembly when
28          <span class="pseudocode">BitCount(register_list) &gt; 1</span>.
29        </p>
30        </div>
31    <h3 class="classheading"><a id="iclass_t2"/>T2</h3><div class="regdiagram-16x2"><table class="regdiagram"><thead><tr><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr></thead><tbody><tr class="firstrow"><td class="l">1</td><td>1</td><td>1</td><td>0</td><td>1</td><td>0</td><td class="r">0</td><td class="l">0</td><td class="r">1</td><td class="lr">0</td><td class="lr">1</td><td class="lr">1</td><td class="l">1</td><td>1</td><td>0</td><td class="r">1</td><td class="lr">P</td><td class="lr">M</td><td colspan="14" class="lr">register_list</td></tr><tr class="secondrow"><td colspan="7"/><td colspan="2"/><td/><td class="droppedname">W</td><td/><td colspan="4" class="droppedname">Rn</td><td/><td/><td colspan="14"/></tr></tbody></table></div><div class="encoding"><h4 class="encoding">T2</h4><a id="POP_LDM_T2"/><p class="asm-code">POP{<a href="#sa_c" title="See {xref{ARMARM_Babbefhf}{Standard assembler syntax fields}}">&lt;c&gt;</a>}.W <a href="#sa_registers_3" title="List of two or more registers to be loaded (field &quot;register_list&quot;)">&lt;registers&gt;</a>
32        //
33      
34        (All registers in R0-R7, PC)
35      </p><p class="asm-code">POP{<a href="#sa_c" title="See {xref{ARMARM_Babbefhf}{Standard assembler syntax fields}}">&lt;c&gt;</a>}{<a href="#sa_q" title="See {xref{ARMARM_Babbefhf}{Standard assembler syntax fields}}">&lt;q&gt;</a>} <a href="#sa_registers_3" title="List of two or more registers to be loaded (field &quot;register_list&quot;)">&lt;registers&gt;</a></p><p class="equivto">
36      is equivalent to
37    </p>
38          <p class="asm-code"><a href="ldm.html#LDM_T2">LDM</a>{<a href="#sa_c" title="See {xref{ARMARM_Babbefhf}{Standard assembler syntax fields}}">&lt;c&gt;</a>}{<a href="#sa_q" title="See {xref{ARMARM_Babbefhf}{Standard assembler syntax fields}}">&lt;q&gt;</a>} SP!, <a href="#sa_registers_3" title="List of two or more registers to be loaded (field &quot;register_list&quot;)">&lt;registers&gt;</a></p>
39          <p class="equivto">
40          and is the preferred disassembly when
41          <span class="pseudocode">BitCount(P:M:register_list) &gt; 1</span>.
42        </p>
43        </div>
44  <div class="encoding-notes"/><h3 class="explanations">Assembler Symbols</h3><div class="explanations"><table><col class="asyn-l"/><col class="asyn-r"/><tr><td>&lt;c&gt;</td><td><a id="sa_c"/>
45        
46          <p class="aml">See <a class="armarm-xref" title="Reference to Armv8 ARM section" data-linkend="Babbefhf">Standard assembler syntax fields</a>.</p>
47        
48      </td></tr></table><table><col class="asyn-l"/><col class="asyn-r"/><tr><td>&lt;q&gt;</td><td><a id="sa_q"/>
49        
50          <p class="aml">See <a class="armarm-xref" title="Reference to Armv8 ARM section" data-linkend="Babbefhf">Standard assembler syntax fields</a>.</p>
51        
52      </td></tr></table><table><col class="asyn-l"/><col class="asyn-r"/><tr><td>&lt;registers&gt;</td><td><a id="sa_registers_4"/>
53        
54          
55        
56        
57          <p class="aml">For encoding A1: is a list of two or more registers to be loaded, separated by commas and surrounded by { and }. The lowest-numbered register is loaded from the lowest memory address, through to the highest-numbered register from the highest memory address. See also <a class="armarm-xref" title="Reference to Armv8 ARM section" data-linkend="CHDDBEDG">Encoding of lists of general-purpose registers and the PC</a>.</p>
58          <p class="aml">If the SP is in the list, the value of the SP after such an instruction is <span class="arm-defined-word">unknown</span>.</p>
59          <p class="aml">The PC can be in the list. If it is, the instruction branches to the address loaded to the PC. This is an interworking branch, see <a class="armarm-xref" title="Reference to Armv8 ARM section" data-linkend="BEICJFEH">Pseudocode description of operations on the AArch32 general-purpose registers and the PC</a>.</p>
60          <p class="aml">Arm deprecates the use of this instruction with both the LR and the PC in the list.</p>
61        
62      </td></tr><tr><td/><td><a id="sa_registers_3"/>
63        
64          
65        
66        
67          <p class="aml">For encoding T2: is a list of two or more registers to be loaded, separated by commas and surrounded by { and }. The lowest-numbered register is loaded from the lowest memory address, through to the highest-numbered register from the highest memory address. See also <a class="armarm-xref" title="Reference to Armv8 ARM section" data-linkend="CHDDBEDG">Encoding of lists of general-purpose registers and the PC</a>.</p>
68          <p class="aml">The registers in the list must be in the range R0-R12, encoded in the "register_list" field, and can optionally contain one of  the LR or the PC. If the LR is in the list, the "M" field is set to 1, otherwise it defaults to 0. If the PC is in the list, the "P" field is set to 1, otherwise it defaults to 0.</p>
69          <p class="aml">The PC can be in the list. If it is, the instruction branches to the address loaded to the PC. This is an interworking branch, see <a class="armarm-xref" title="Reference to Armv8 ARM section" data-linkend="BEICJFEH">Pseudocode description of operations on the AArch32 general-purpose registers and the PC</a>. If the PC is in the list:</p>
70          <ul>
71            <li>The LR must not be in the list.</li>
72            <li>The instruction must be either outside any IT block, or the last instruction in an IT block.</li>
73          </ul>
74        
75      </td></tr></table></div><div class="syntax-notes"/><div class="alias_ps_section"><h3 class="pseudocode">Operation</h3><p>The description of <a href="ldm.html">LDM, LDMIA, LDMFD</a> gives the operational pseudocode for this instruction.</p></div><hr/><table style="margin: 0 auto;"><tr><td><div class="topbar"><a href="index.html">Base Instructions</a></div></td><td><div class="topbar"><a href="fpsimdindex.html">SIMD&amp;FP Instructions</a></div></td><td><div class="topbar"><a href="a32_encindex.html">A32 Instructions by Encoding</a></div></td><td><div class="topbar"><a href="t32_encindex.html">T32 Instructions by Encoding</a></div></td><td><div class="topbar"><a href="shared_pseudocode.html">Shared Pseudocode</a></div></td><td><div class="topbar"><a href="notice.html">Proprietary Notice</a></div></td></tr></table><p class="versions">
76      Internal version only: isa v01_31, pseudocode v2024-09_rel
77      ; Build timestamp: 2024-09-26T13:26
78    </p><p class="copyconf">
79      Copyright © 2010-2024 Arm Limited or its affiliates. All rights reserved.
80      This document is Non-Confidential.
81    </p></body></html>