mirror of
https://github.com/pound-emu/ballistic.git
synced 2026-01-31 01:15:21 +01:00
202 lines
11 KiB
XML
202 lines
11 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<?xml-stylesheet type="text/xsl" encoding="UTF-8" href="iform.xsl" version="1.0"?>
|
|
<!DOCTYPE instructionsection PUBLIC "-//ARM//DTD instructionsection //EN" "iform-p.dtd">
|
|
<!-- Copyright (c) 2010-2022 Arm Limited or its affiliates. All rights reserved. -->
|
|
<!-- This document is Non-Confidential. This document may only be used and distributed in accordance with the terms of the agreement entered into by Arm and the party that Arm delivered this document to. -->
|
|
|
|
<instructionsection id="LDAR" title="LDAR -- A64" type="instruction">
|
|
<docvars>
|
|
<docvar key="address-form" value="base-register" />
|
|
<docvar key="instr-class" value="general" />
|
|
<docvar key="isa" value="A64" />
|
|
<docvar key="mnemonic" value="LDAR" />
|
|
</docvars>
|
|
<heading>LDAR</heading>
|
|
<desc>
|
|
<brief>
|
|
<para>Load-Acquire Register</para>
|
|
</brief>
|
|
<authored>
|
|
<para>Load-Acquire Register derives an address from a base register value, loads a 32-bit word or 64-bit doubleword from memory, and writes it to a register. The instruction also has memory ordering semantics as described in <xref linkend="BEIHCHEF">Load-Acquire, Store-Release</xref>. For information about memory accesses, see <xref linkend="CHDIIIBB">Load/Store addressing modes</xref>.</para>
|
|
<note>
|
|
<para>For this instruction, if the destination is WZR/XZR, it is impossible for software to observe the presence of the acquire semantic other than its effect on the arrival at endpoints.</para>
|
|
</note>
|
|
</authored>
|
|
</desc>
|
|
<operationalnotes>
|
|
<para>If PSTATE.DIT is 1, the timing of this instruction is insensitive to the value of the data being loaded or stored.</para>
|
|
</operationalnotes>
|
|
<alias_list howmany="0"></alias_list>
|
|
<classes>
|
|
<iclass name="No offset" oneof="1" id="iclass_base_register" no_encodings="2" isa="A64">
|
|
<docvars>
|
|
<docvar key="address-form" value="base-register" />
|
|
<docvar key="instr-class" value="general" />
|
|
<docvar key="isa" value="A64" />
|
|
<docvar key="mnemonic" value="LDAR" />
|
|
</docvars>
|
|
<iclassintro count="2"></iclassintro>
|
|
<regdiagram form="32" psname="aarch64/instrs/memory/ordered" tworows="1">
|
|
<box hibit="31" width="2" name="size" usename="1" settings="1" psbits="xx">
|
|
<c>1</c>
|
|
<c>x</c>
|
|
</box>
|
|
<box hibit="29" width="6" settings="6">
|
|
<c>0</c>
|
|
<c>0</c>
|
|
<c>1</c>
|
|
<c>0</c>
|
|
<c>0</c>
|
|
<c>0</c>
|
|
</box>
|
|
<box hibit="23" name="o2" settings="1">
|
|
<c>1</c>
|
|
</box>
|
|
<box hibit="22" name="L" usename="1" settings="1" psbits="x">
|
|
<c>1</c>
|
|
</box>
|
|
<box hibit="21" name="o1" settings="1">
|
|
<c>0</c>
|
|
</box>
|
|
<box hibit="20" width="5" name="Rs" usename="1" settings="5" psbits="xxxxx">
|
|
<c>(1)</c>
|
|
<c>(1)</c>
|
|
<c>(1)</c>
|
|
<c>(1)</c>
|
|
<c>(1)</c>
|
|
</box>
|
|
<box hibit="15" name="o0" usename="1" settings="1" psbits="x">
|
|
<c>1</c>
|
|
</box>
|
|
<box hibit="14" width="5" name="Rt2" usename="1" settings="5" psbits="xxxxx">
|
|
<c>(1)</c>
|
|
<c>(1)</c>
|
|
<c>(1)</c>
|
|
<c>(1)</c>
|
|
<c>(1)</c>
|
|
</box>
|
|
<box hibit="9" width="5" name="Rn" usename="1">
|
|
<c colspan="5"></c>
|
|
</box>
|
|
<box hibit="4" width="5" name="Rt" usename="1">
|
|
<c colspan="5"></c>
|
|
</box>
|
|
</regdiagram>
|
|
<encoding name="LDAR_LR32_ldstord" oneofinclass="2" oneof="2" label="32-bit" bitdiffs="size == 10">
|
|
<docvars>
|
|
<docvar key="address-form" value="base-register" />
|
|
<docvar key="address-form-reg-type" value="base-register-32-reg" />
|
|
<docvar key="atomic-ops" value="LDAR-32-reg" />
|
|
<docvar key="instr-class" value="general" />
|
|
<docvar key="isa" value="A64" />
|
|
<docvar key="mnemonic" value="LDAR" />
|
|
<docvar key="reg-type" value="32-reg" />
|
|
</docvars>
|
|
<box hibit="31" width="2" name="size">
|
|
<c></c>
|
|
<c>0</c>
|
|
</box>
|
|
<asmtemplate><text>LDAR </text><a link="sa_wt" hover="32-bit general-purpose register to be transferred (field "Rt")"><Wt></a><text>, [</text><a link="sa_xn_sp" hover="64-bit general-purpose base register or SP (field "Rn")"><Xn|SP></a><text>{,#0}</text><text>]</text></asmtemplate>
|
|
</encoding>
|
|
<encoding name="LDAR_LR64_ldstord" oneofinclass="2" oneof="2" label="64-bit" bitdiffs="size == 11">
|
|
<docvars>
|
|
<docvar key="address-form" value="base-register" />
|
|
<docvar key="address-form-reg-type" value="base-register-64-reg" />
|
|
<docvar key="atomic-ops" value="LDAR-64-reg" />
|
|
<docvar key="instr-class" value="general" />
|
|
<docvar key="isa" value="A64" />
|
|
<docvar key="mnemonic" value="LDAR" />
|
|
<docvar key="reg-type" value="64-reg" />
|
|
</docvars>
|
|
<box hibit="31" width="2" name="size">
|
|
<c></c>
|
|
<c>1</c>
|
|
</box>
|
|
<asmtemplate><text>LDAR </text><a link="sa_xt" hover="64-bit general-purpose register to be transferred (field "Rt")"><Xt></a><text>, [</text><a link="sa_xn_sp" hover="64-bit general-purpose base register or SP (field "Rn")"><Xn|SP></a><text>{,#0}</text><text>]</text></asmtemplate>
|
|
</encoding>
|
|
<ps_section howmany="1">
|
|
<ps name="aarch64/instrs/memory/ordered" mylink="aarch64.instrs.memory.ordered" enclabels="" sections="1" secttype="noheading">
|
|
<pstext mayhavelinks="1" section="Decode" rep_section="decode">integer n = <a link="impl-shared.UInt.1" file="shared_pseudocode.xml" hover="function: integer UInt(bits(N) x)">UInt</a>(Rn);
|
|
integer t = <a link="impl-shared.UInt.1" file="shared_pseudocode.xml" hover="function: integer UInt(bits(N) x)">UInt</a>(Rt);
|
|
integer t2 = <a link="impl-shared.UInt.1" file="shared_pseudocode.xml" hover="function: integer UInt(bits(N) x)">UInt</a>(Rt2); // ignored by load/store single register
|
|
integer s = <a link="impl-shared.UInt.1" file="shared_pseudocode.xml" hover="function: integer UInt(bits(N) x)">UInt</a>(Rs); // ignored by all loads and store-release
|
|
boolean wback = FALSE;
|
|
integer offset = 0;
|
|
boolean rt_unknown = FALSE;
|
|
|
|
limitedordered = o0 == '0';
|
|
|
|
<a link="MemOp" file="shared_pseudocode.xml" hover="enumeration MemOp {MemOp_LOAD, MemOp_STORE, MemOp_PREFETCH}">MemOp</a> memop = if L == '1' then <a link="MemOp_LOAD" file="shared_pseudocode.xml" hover="enumeration MemOp {MemOp_LOAD, MemOp_STORE, MemOp_PREFETCH}">MemOp_LOAD</a> else <a link="MemOp_STORE" file="shared_pseudocode.xml" hover="enumeration MemOp {MemOp_LOAD, MemOp_STORE, MemOp_PREFETCH}">MemOp_STORE</a>;
|
|
integer elsize = 8 << <a link="impl-shared.UInt.1" file="shared_pseudocode.xml" hover="function: integer UInt(bits(N) x)">UInt</a>(size);
|
|
integer regsize = if elsize == 64 then 64 else 32;
|
|
integer datasize = elsize;
|
|
boolean tagchecked = n != 31;</pstext>
|
|
</ps>
|
|
</ps_section>
|
|
</iclass>
|
|
</classes>
|
|
<explanations scope="all">
|
|
<explanation enclist="LDAR_LR32_ldstord" symboldefcount="1">
|
|
<symbol link="sa_wt"><Wt></symbol>
|
|
<account encodedin="Rt">
|
|
<intro>
|
|
<para>Is the 32-bit name of the general-purpose register to be transferred, encoded in the "Rt" field.</para>
|
|
</intro>
|
|
</account>
|
|
</explanation>
|
|
<explanation enclist="LDAR_LR64_ldstord" symboldefcount="1">
|
|
<symbol link="sa_xt"><Xt></symbol>
|
|
<account encodedin="Rt">
|
|
<intro>
|
|
<para>Is the 64-bit name of the general-purpose register to be transferred, encoded in the "Rt" field.</para>
|
|
</intro>
|
|
</account>
|
|
</explanation>
|
|
<explanation enclist="LDAR_LR32_ldstord, LDAR_LR64_ldstord" symboldefcount="1">
|
|
<symbol link="sa_xn_sp"><Xn|SP></symbol>
|
|
<account encodedin="Rn">
|
|
<intro>
|
|
<para>Is the 64-bit name of the general-purpose base register or stack pointer, encoded in the "Rn" field.</para>
|
|
</intro>
|
|
</account>
|
|
</explanation>
|
|
</explanations>
|
|
<ps_section howmany="1">
|
|
<ps name="aarch64/instrs/memory/ordered" mylink="execute" enclabels="" sections="1" secttype="Operation">
|
|
<pstext mayhavelinks="1" section="Execute" rep_section="execute">bits(64) address;
|
|
bits(datasize) data;
|
|
constant integer dbytes = datasize DIV 8;
|
|
|
|
<a link="AccessDescriptor" file="shared_pseudocode.xml" hover="type AccessDescriptor is ( AccessType acctype, bits(2) el, SecurityState ss, boolean acqsc, boolean acqpc, boolean relsc, boolean limitedordered, boolean exclusive, boolean atomicop, MemAtomicOp modop, boolean nontemporal, boolean read, boolean write, CacheOp cacheop, CacheOpScope opscope, CacheType cachetype, boolean pan, boolean transactional, boolean nonfault, boolean firstfault, boolean first, boolean contiguous, boolean streamingsve, boolean ls64, boolean mops, boolean rcw, boolean rcws, boolean toplevel, VARange varange, boolean a32lsmd, boolean tagchecked, boolean tagaccess, MPAMinfo mpam )">AccessDescriptor</a> accdesc;
|
|
if limitedordered then
|
|
accdesc = <a link="impl-shared.CreateAccDescLOR.2" file="shared_pseudocode.xml" hover="function: AccessDescriptor CreateAccDescLOR(MemOp memop, boolean tagchecked)">CreateAccDescLOR</a>(memop, tagchecked);
|
|
else
|
|
accdesc = <a link="impl-shared.CreateAccDescAcqRel.2" file="shared_pseudocode.xml" hover="function: AccessDescriptor CreateAccDescAcqRel(MemOp memop, boolean tagchecked)">CreateAccDescAcqRel</a>(memop, tagchecked);
|
|
|
|
if n == 31 then
|
|
<a link="impl-aarch64.CheckSPAlignment.0" file="shared_pseudocode.xml" hover="function: CheckSPAlignment()">CheckSPAlignment</a>();
|
|
address = <a link="impl-aarch64.SP.read.0" file="shared_pseudocode.xml" hover="accessor: bits(64) SP[]">SP</a>[];
|
|
else
|
|
address = <a link="impl-aarch64.X.read.2" file="shared_pseudocode.xml" hover="accessor: bits(width) X[integer n, integer width]">X</a>[n, 64];
|
|
|
|
case memop of
|
|
when <a link="MemOp_STORE" file="shared_pseudocode.xml" hover="enumeration MemOp {MemOp_LOAD, MemOp_STORE, MemOp_PREFETCH}">MemOp_STORE</a>
|
|
address = address + offset;
|
|
if rt_unknown then
|
|
data = bits(datasize) UNKNOWN;
|
|
else
|
|
data = <a link="impl-aarch64.X.read.2" file="shared_pseudocode.xml" hover="accessor: bits(width) X[integer n, integer width]">X</a>[t, datasize];
|
|
Mem[address, dbytes, accdesc] = data;
|
|
|
|
if wback then
|
|
if n == 31 then
|
|
<a link="impl-aarch64.SP.write.0" file="shared_pseudocode.xml" hover="accessor: SP[] = bits(64) value">SP</a>[] = address;
|
|
else
|
|
<a link="impl-aarch64.X.write.2" file="shared_pseudocode.xml" hover="accessor: X[integer n, integer width] = bits(width) value">X</a>[n, 64] = address;
|
|
when <a link="MemOp_LOAD" file="shared_pseudocode.xml" hover="enumeration MemOp {MemOp_LOAD, MemOp_STORE, MemOp_PREFETCH}">MemOp_LOAD</a>
|
|
data = <a link="impl-aarch64.Mem.read.3" file="shared_pseudocode.xml" hover="accessor: bits(size*8) Mem[bits(64) address, integer size, AccessDescriptor accdesc]">Mem</a>[address, dbytes, accdesc];
|
|
<a link="impl-aarch64.X.write.2" file="shared_pseudocode.xml" hover="accessor: X[integer n, integer width] = bits(width) value">X</a>[t, regsize] = <a link="impl-shared.ZeroExtend.2" file="shared_pseudocode.xml" hover="function: bits(N) ZeroExtend(bits(M) x, integer N)">ZeroExtend</a>(data, regsize);</pstext>
|
|
</ps>
|
|
</ps_section>
|
|
</instructionsection>
|