Files
archived-ballistic/spec/arm64_xml/ldr_lit_fpsimd.xml
Ronald Caesar 26a677f8b4 decoder: Add ARM specification docs
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-12-12 18:11:36 -04:00

183 lines
10 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="LDR_lit_fpsimd" title="LDR (literal, SIMD&amp;FP) -- A64" type="instruction">
<docvars>
<docvar key="address-form" value="literal" />
<docvar key="instr-class" value="fpsimd" />
<docvar key="isa" value="A64" />
<docvar key="mnemonic" value="LDR" />
<docvar key="offset-type" value="off19s" />
</docvars>
<heading>LDR (literal, SIMD&amp;FP)</heading>
<desc>
<brief>
<para>Load SIMD&amp;FP Register (PC-relative literal)</para>
</brief>
<authored>
<para>Load SIMD&amp;FP Register (PC-relative literal). This instruction loads a SIMD&amp;FP register from memory. The address that is used for the load is calculated from the PC value and an immediate offset.</para>
<para>Depending on the settings in the <xref linkend="AArch64.cpacr_el1">CPACR_EL1</xref>, <xref linkend="AArch64.cptr_el2">CPTR_EL2</xref>, and <xref linkend="AArch64.cptr_el3">CPTR_EL3</xref> registers, and the current Security state and Exception level, an attempt to execute the instruction might be trapped.</para>
</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="Literal" oneof="1" id="iclass_literal" no_encodings="3" isa="A64">
<docvars>
<docvar key="address-form" value="literal" />
<docvar key="instr-class" value="fpsimd" />
<docvar key="isa" value="A64" />
<docvar key="mnemonic" value="LDR" />
<docvar key="offset-type" value="off19s" />
</docvars>
<iclassintro count="3"></iclassintro>
<regdiagram form="32" psname="aarch64/instrs/memory/literal/simdfp">
<box hibit="31" width="2" name="opc" usename="1">
<c colspan="2"></c>
</box>
<box hibit="29" width="3" settings="3">
<c>0</c>
<c>1</c>
<c>1</c>
</box>
<box hibit="26" name="V" settings="1">
<c>1</c>
</box>
<box hibit="25" width="2" settings="2">
<c>0</c>
<c>0</c>
</box>
<box hibit="23" width="19" name="imm19" usename="1">
<c colspan="19"></c>
</box>
<box hibit="4" width="5" name="Rt" usename="1">
<c colspan="5"></c>
</box>
</regdiagram>
<encoding name="LDR_S_loadlit" oneofinclass="3" oneof="3" label="32-bit" bitdiffs="opc == 00">
<docvars>
<docvar key="address-form" value="literal" />
<docvar key="address-form-reg-type" value="literal-32-fsreg" />
<docvar key="atomic-ops" value="LDR-32-fsreg" />
<docvar key="instr-class" value="fpsimd" />
<docvar key="isa" value="A64" />
<docvar key="mnemonic" value="LDR" />
<docvar key="offset-type" value="off19s" />
<docvar key="reg-type" value="32-fsreg" />
</docvars>
<box hibit="31" width="2" name="opc">
<c>0</c>
<c>0</c>
</box>
<asmtemplate><text>LDR </text><a link="sa_st" hover="32-bit SIMD&amp;FP register to be loaded (field &quot;Rt&quot;)">&lt;St&gt;</a><text>, </text><a link="sa_label" hover="Label from which the data is to be loaded (field imm19)">&lt;label&gt;</a></asmtemplate>
</encoding>
<encoding name="LDR_D_loadlit" oneofinclass="3" oneof="3" label="64-bit" bitdiffs="opc == 01">
<docvars>
<docvar key="address-form" value="literal" />
<docvar key="address-form-reg-type" value="literal-64-fsreg" />
<docvar key="atomic-ops" value="LDR-64-fsreg" />
<docvar key="instr-class" value="fpsimd" />
<docvar key="isa" value="A64" />
<docvar key="mnemonic" value="LDR" />
<docvar key="offset-type" value="off19s" />
<docvar key="reg-type" value="64-fsreg" />
</docvars>
<box hibit="31" width="2" name="opc">
<c>0</c>
<c>1</c>
</box>
<asmtemplate><text>LDR </text><a link="sa_dt" hover="64-bit SIMD&amp;FP register to be loaded (field &quot;Rt&quot;)">&lt;Dt&gt;</a><text>, </text><a link="sa_label" hover="Label from which the data is to be loaded (field imm19)">&lt;label&gt;</a></asmtemplate>
</encoding>
<encoding name="LDR_Q_loadlit" oneofinclass="3" oneof="3" label="128-bit" bitdiffs="opc == 10">
<docvars>
<docvar key="address-form" value="literal" />
<docvar key="address-form-reg-type" value="literal-128-fsreg" />
<docvar key="atomic-ops" value="LDR-128-fsreg" />
<docvar key="instr-class" value="fpsimd" />
<docvar key="isa" value="A64" />
<docvar key="mnemonic" value="LDR" />
<docvar key="offset-type" value="off19s" />
<docvar key="reg-type" value="128-fsreg" />
</docvars>
<box hibit="31" width="2" name="opc">
<c>1</c>
<c>0</c>
</box>
<asmtemplate><text>LDR </text><a link="sa_qt" hover="128-bit SIMD&amp;FP register to be loaded (field &quot;Rt&quot;)">&lt;Qt&gt;</a><text>, </text><a link="sa_label" hover="Label from which the data is to be loaded (field imm19)">&lt;label&gt;</a></asmtemplate>
</encoding>
<ps_section howmany="1">
<ps name="aarch64/instrs/memory/literal/simdfp" mylink="aarch64.instrs.memory.literal.simdfp" enclabels="" sections="1" secttype="noheading">
<pstext mayhavelinks="1" section="Decode" rep_section="decode">integer t = <a link="impl-shared.UInt.1" file="shared_pseudocode.xml" hover="function: integer UInt(bits(N) x)">UInt</a>(Rt);
boolean nontemporal = FALSE;
integer size;
bits(64) offset;
case opc of
when '00'
size = 4;
when '01'
size = 8;
when '10'
size = 16;
when '11'
UNDEFINED;
offset = <a link="impl-shared.SignExtend.2" file="shared_pseudocode.xml" hover="function: bits(N) SignExtend(bits(M) x, integer N)">SignExtend</a>(imm19:'00', 64);
boolean tagchecked = FALSE;</pstext>
</ps>
</ps_section>
</iclass>
</classes>
<explanations scope="all">
<explanation enclist="LDR_D_loadlit" symboldefcount="1">
<symbol link="sa_dt">&lt;Dt&gt;</symbol>
<account encodedin="Rt">
<intro>
<para>Is the 64-bit name of the SIMD&amp;FP register to be loaded, encoded in the "Rt" field.</para>
</intro>
</account>
</explanation>
<explanation enclist="LDR_Q_loadlit" symboldefcount="1">
<symbol link="sa_qt">&lt;Qt&gt;</symbol>
<account encodedin="Rt">
<intro>
<para>Is the 128-bit name of the SIMD&amp;FP register to be loaded, encoded in the "Rt" field.</para>
</intro>
</account>
</explanation>
<explanation enclist="LDR_S_loadlit" symboldefcount="1">
<symbol link="sa_st">&lt;St&gt;</symbol>
<account encodedin="Rt">
<intro>
<para>Is the 32-bit name of the SIMD&amp;FP register to be loaded, encoded in the "Rt" field.</para>
</intro>
</account>
</explanation>
<explanation enclist="LDR_D_loadlit, LDR_Q_loadlit, LDR_S_loadlit" symboldefcount="1">
<symbol link="sa_label">&lt;label&gt;</symbol>
<account encodedin="imm19">
<intro>
<para>Is the program label from which the data is to be loaded. Its offset from the address of this instruction, in the range +/-1MB, is encoded as "imm19" times 4.</para>
</intro>
</account>
</explanation>
</explanations>
<ps_section howmany="1">
<ps name="aarch64/instrs/memory/literal/simdfp" mylink="execute" enclabels="" sections="1" secttype="Operation">
<pstext mayhavelinks="1" section="Execute" rep_section="execute">bits(64) address = <a link="impl-aarch64.PC.read.0" file="shared_pseudocode.xml" hover="accessor: bits(64) PC[]">PC</a>[] + offset;
bits(size*8) data;
boolean privileged = PSTATE.EL != <a link="EL0" file="shared_pseudocode.xml" hover="constant bits(2) EL0 = '00'">EL0</a>;
<a link="impl-aarch64.CheckFPEnabled64.0" file="shared_pseudocode.xml" hover="function: CheckFPEnabled64()">CheckFPEnabled64</a>();
<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 = <a link="impl-shared.CreateAccDescASIMD.3" file="shared_pseudocode.xml" hover="function: AccessDescriptor CreateAccDescASIMD(MemOp memop, boolean nontemporal, boolean tagchecked)">CreateAccDescASIMD</a>(<a link="MemOp_LOAD" file="shared_pseudocode.xml" hover="enumeration MemOp {MemOp_LOAD, MemOp_STORE, MemOp_PREFETCH}">MemOp_LOAD</a>, nontemporal, tagchecked);
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, size, accdesc];
<a link="impl-aarch64.V.write.2" file="shared_pseudocode.xml" hover="accessor: V[integer n, integer width] = bits(width) value">V</a>[t, size*8] = data;</pstext>
</ps>
</ps_section>
</instructionsection>