mirror of
https://github.com/pound-emu/ballistic.git
synced 2026-01-31 01:15:21 +01:00
214 lines
13 KiB
XML
214 lines
13 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="SWPP" title="SWPP, SWPPA, SWPPAL, SWPPL -- A64" type="instruction">
|
|
<docvars>
|
|
<docvar key="instr-class" value="general" />
|
|
<docvar key="isa" value="A64" />
|
|
</docvars>
|
|
<heading>SWPP, SWPPA, SWPPAL, SWPPL</heading>
|
|
<desc>
|
|
<brief>
|
|
<para>Swap quadword in memory</para>
|
|
</brief>
|
|
<authored>
|
|
<para>Swap quadword in memory atomically loads a 128-bit quadword from a memory location, and stores the value held in a pair of registers back to the same memory location. The value initially loaded from memory is returned in the same pair of registers.</para>
|
|
<list type="unordered">
|
|
<listitem><content><instruction>SWPPA</instruction> and <instruction>SWPPAL</instruction> load from memory with acquire semantics.</content></listitem>
|
|
<listitem><content><instruction>SWPPL</instruction> and <instruction>SWPPAL</instruction> store to memory with release semantics.</content></listitem>
|
|
<listitem><content><instruction>SWPP</instruction> has neither acquire nor release semantics.</content></listitem>
|
|
</list>
|
|
</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="Integer" oneof="1" id="iclass_general" no_encodings="4" isa="A64">
|
|
<docvars>
|
|
<docvar key="instr-class" value="general" />
|
|
<docvar key="isa" value="A64" />
|
|
</docvars>
|
|
<iclassintro count="4"></iclassintro>
|
|
<arch_variants>
|
|
<arch_variant name="FEAT_LSE128" feature="FEAT_LSE128" />
|
|
</arch_variants>
|
|
<regdiagram form="32" psname="aarch64/instrs/memory/atomicops/swp_128" tworows="1">
|
|
<box hibit="31" settings="1">
|
|
<c>0</c>
|
|
</box>
|
|
<box hibit="30" name="S" usename="1" settings="1" psbits="x">
|
|
<c>0</c>
|
|
</box>
|
|
<box hibit="29" width="6" settings="6">
|
|
<c>0</c>
|
|
<c>1</c>
|
|
<c>1</c>
|
|
<c>0</c>
|
|
<c>0</c>
|
|
<c>1</c>
|
|
</box>
|
|
<box hibit="23" name="A" usename="1">
|
|
<c></c>
|
|
</box>
|
|
<box hibit="22" name="R" usename="1">
|
|
<c></c>
|
|
</box>
|
|
<box hibit="21" settings="1">
|
|
<c>1</c>
|
|
</box>
|
|
<box hibit="20" width="5" name="Rt2" usename="1">
|
|
<c colspan="5"></c>
|
|
</box>
|
|
<box hibit="15" name="o3" usename="1" settings="1" psbits="x">
|
|
<c>1</c>
|
|
</box>
|
|
<box hibit="14" width="3" name="opc" usename="1" settings="3" psbits="xxx">
|
|
<c>0</c>
|
|
<c>0</c>
|
|
<c>0</c>
|
|
</box>
|
|
<box hibit="11" width="2" settings="2">
|
|
<c>0</c>
|
|
<c>0</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="SWPP_128_memop_128" oneofinclass="4" oneof="4" label="SWPP" bitdiffs="A == 0 && R == 0">
|
|
<docvars>
|
|
<docvar key="instr-class" value="general" />
|
|
<docvar key="isa" value="A64" />
|
|
<docvar key="mnemonic" value="SWPP" />
|
|
</docvars>
|
|
<box hibit="23" width="1" name="A">
|
|
<c>0</c>
|
|
</box>
|
|
<box hibit="22" width="1" name="R">
|
|
<c>0</c>
|
|
</box>
|
|
<asmtemplate><text>SWPP </text><a link="sa_xt1" hover="First 64-bit general-purpose register to be transferred (field "Rt")"><Xt1></a><text>, </text><a link="sa_xt2" hover="Second 64-bit general-purpose register to be transferred (field "Rt2")"><Xt2></a><text>, [</text><a link="sa_xn_sp" hover="64-bit general-purpose base register or SP (field "Rn")"><Xn|SP></a><text>]</text></asmtemplate>
|
|
</encoding>
|
|
<encoding name="SWPPA_128_memop_128" oneofinclass="4" oneof="4" label="SWPPA" bitdiffs="A == 1 && R == 0">
|
|
<docvars>
|
|
<docvar key="instr-class" value="general" />
|
|
<docvar key="isa" value="A64" />
|
|
<docvar key="mnemonic" value="SWPPA" />
|
|
</docvars>
|
|
<box hibit="23" width="1" name="A">
|
|
<c>1</c>
|
|
</box>
|
|
<box hibit="22" width="1" name="R">
|
|
<c>0</c>
|
|
</box>
|
|
<asmtemplate><text>SWPPA </text><a link="sa_xt1" hover="First 64-bit general-purpose register to be transferred (field "Rt")"><Xt1></a><text>, </text><a link="sa_xt2" hover="Second 64-bit general-purpose register to be transferred (field "Rt2")"><Xt2></a><text>, [</text><a link="sa_xn_sp" hover="64-bit general-purpose base register or SP (field "Rn")"><Xn|SP></a><text>]</text></asmtemplate>
|
|
</encoding>
|
|
<encoding name="SWPPAL_128_memop_128" oneofinclass="4" oneof="4" label="SWPPAL" bitdiffs="A == 1 && R == 1">
|
|
<docvars>
|
|
<docvar key="instr-class" value="general" />
|
|
<docvar key="isa" value="A64" />
|
|
<docvar key="mnemonic" value="SWPPAL" />
|
|
</docvars>
|
|
<box hibit="23" width="1" name="A">
|
|
<c>1</c>
|
|
</box>
|
|
<box hibit="22" width="1" name="R">
|
|
<c>1</c>
|
|
</box>
|
|
<asmtemplate><text>SWPPAL </text><a link="sa_xt1" hover="First 64-bit general-purpose register to be transferred (field "Rt")"><Xt1></a><text>, </text><a link="sa_xt2" hover="Second 64-bit general-purpose register to be transferred (field "Rt2")"><Xt2></a><text>, [</text><a link="sa_xn_sp" hover="64-bit general-purpose base register or SP (field "Rn")"><Xn|SP></a><text>]</text></asmtemplate>
|
|
</encoding>
|
|
<encoding name="SWPPL_128_memop_128" oneofinclass="4" oneof="4" label="SWPPL" bitdiffs="A == 0 && R == 1">
|
|
<docvars>
|
|
<docvar key="instr-class" value="general" />
|
|
<docvar key="isa" value="A64" />
|
|
<docvar key="mnemonic" value="SWPPL" />
|
|
</docvars>
|
|
<box hibit="23" width="1" name="A">
|
|
<c>0</c>
|
|
</box>
|
|
<box hibit="22" width="1" name="R">
|
|
<c>1</c>
|
|
</box>
|
|
<asmtemplate><text>SWPPL </text><a link="sa_xt1" hover="First 64-bit general-purpose register to be transferred (field "Rt")"><Xt1></a><text>, </text><a link="sa_xt2" hover="Second 64-bit general-purpose register to be transferred (field "Rt2")"><Xt2></a><text>, [</text><a link="sa_xn_sp" hover="64-bit general-purpose base register or SP (field "Rn")"><Xn|SP></a><text>]</text></asmtemplate>
|
|
</encoding>
|
|
<ps_section howmany="1">
|
|
<ps name="aarch64/instrs/memory/atomicops/swp_128" mylink="aarch64.instrs.memory.atomicops.swp_128" enclabels="" sections="1" secttype="noheading">
|
|
<pstext mayhavelinks="1" section="Decode" rep_section="decode">if !<a link="impl-shared.HaveLSE128.0" file="shared_pseudocode.xml" hover="function: boolean HaveLSE128()">HaveLSE128</a>() then UNDEFINED;
|
|
if Rt == '11111' then UNDEFINED;
|
|
if Rt2 == '11111' then UNDEFINED;
|
|
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);
|
|
integer n = <a link="impl-shared.UInt.1" file="shared_pseudocode.xml" hover="function: integer UInt(bits(N) x)">UInt</a>(Rn);
|
|
|
|
boolean acquire = A == '1';
|
|
boolean release = R == '1';
|
|
boolean tagchecked = n != 31;</pstext>
|
|
</ps>
|
|
</ps_section>
|
|
</iclass>
|
|
</classes>
|
|
<explanations scope="all">
|
|
<explanation enclist="SWPP_128_memop_128, SWPPA_128_memop_128, SWPPAL_128_memop_128, SWPPL_128_memop_128" symboldefcount="1">
|
|
<symbol link="sa_xt1"><Xt1></symbol>
|
|
<account encodedin="Rt">
|
|
<intro>
|
|
<para>Is the 64-bit name of the first general-purpose register to be transferred, encoded in the "Rt" field.</para>
|
|
</intro>
|
|
</account>
|
|
</explanation>
|
|
<explanation enclist="SWPP_128_memop_128, SWPPA_128_memop_128, SWPPAL_128_memop_128, SWPPL_128_memop_128" symboldefcount="1">
|
|
<symbol link="sa_xt2"><Xt2></symbol>
|
|
<account encodedin="Rt2">
|
|
<intro>
|
|
<para>Is the 64-bit name of the second general-purpose register to be transferred, encoded in the "Rt2" field.</para>
|
|
</intro>
|
|
</account>
|
|
</explanation>
|
|
<explanation enclist="SWPP_128_memop_128, SWPPA_128_memop_128, SWPPAL_128_memop_128, SWPPL_128_memop_128" 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/atomicops/swp_128" mylink="execute" enclabels="" sections="1" secttype="Operation">
|
|
<pstext mayhavelinks="1" section="Execute" rep_section="execute">bits(64) address;
|
|
bits(64) value1 = <a link="impl-aarch64.X.read.2" file="shared_pseudocode.xml" hover="accessor: bits(width) X[integer n, integer width]">X</a>[t, 64];
|
|
bits(64) value2 = <a link="impl-aarch64.X.read.2" file="shared_pseudocode.xml" hover="accessor: bits(width) X[integer n, integer width]">X</a>[t2, 64];
|
|
bits(128) data;
|
|
bits(128) store_value;
|
|
|
|
<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.CreateAccDescAtomicOp.4" file="shared_pseudocode.xml" hover="function: AccessDescriptor CreateAccDescAtomicOp(MemAtomicOp modop, boolean acquire, boolean release, boolean tagchecked)">CreateAccDescAtomicOp</a>(<a link="MemAtomicOp_SWP" file="shared_pseudocode.xml" hover="enumeration MemAtomicOp { MemAtomicOp_GCSSS1, MemAtomicOp_ADD, MemAtomicOp_BIC, MemAtomicOp_EOR, MemAtomicOp_ORR, MemAtomicOp_SMAX, MemAtomicOp_SMIN, MemAtomicOp_UMAX, MemAtomicOp_UMIN, MemAtomicOp_SWP, MemAtomicOp_CAS }">MemAtomicOp_SWP</a>, acquire, release, 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];
|
|
|
|
store_value = if <a link="impl-shared.BigEndian.1" file="shared_pseudocode.xml" hover="function: boolean BigEndian(AccessType acctype)">BigEndian</a>(accdesc.acctype) then value1:value2 else value2:value1;
|
|
|
|
bits(128) comparevalue = bits(128) UNKNOWN; // Irrelevant when not executing CAS
|
|
data = <a link="impl-aarch64.MemAtomic.4" file="shared_pseudocode.xml" hover="function: bits(size) MemAtomic(bits(64) address, bits(size) cmpoperand, bits(size) operand, AccessDescriptor accdesc_in)">MemAtomic</a>(address, comparevalue, store_value, accdesc);
|
|
|
|
if <a link="impl-shared.BigEndian.1" file="shared_pseudocode.xml" hover="function: boolean BigEndian(AccessType acctype)">BigEndian</a>(accdesc.acctype) then
|
|
<a link="impl-aarch64.X.write.2" file="shared_pseudocode.xml" hover="accessor: X[integer n, integer width] = bits(width) value">X</a>[t, 64] = data<127:64>;
|
|
<a link="impl-aarch64.X.write.2" file="shared_pseudocode.xml" hover="accessor: X[integer n, integer width] = bits(width) value">X</a>[t2, 64] = data<63:0>;
|
|
else
|
|
<a link="impl-aarch64.X.write.2" file="shared_pseudocode.xml" hover="accessor: X[integer n, integer width] = bits(width) value">X</a>[t, 64] = data<63:0>;
|
|
<a link="impl-aarch64.X.write.2" file="shared_pseudocode.xml" hover="accessor: X[integer n, integer width] = bits(width) value">X</a>[t2, 64] = data<127:64>;</pstext>
|
|
</ps>
|
|
</ps_section>
|
|
</instructionsection>
|