Files
archived-ballistic/spec/arm64_xml/zip1_p_pp.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

262 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="zip1_p_pp" title="ZIP1, ZIP2 (predicates)" type="instruction">
<docvars>
<docvar key="instr-class" value="sve" />
<docvar key="isa" value="A64" />
</docvars>
<heading>ZIP1, ZIP2 (predicates)</heading>
<desc>
<brief>Interleave elements from two half predicates</brief>
<description>
<para>Interleave alternating elements from the lowest or highest halves of the first and second source predicates and place in elements of the destination predicate. This instruction is unpredicated.</para>
</description>
<status>Green</status>
<predicated>False</predicated>
<uses_dit condition="FEAT_SVE2 is implemented or FEAT_SME is implemented">True</uses_dit>
</desc>
<alias_list howmany="0"></alias_list>
<classes>
<classesintro count="2">
<txt>It has encodings from 2 classes:</txt>
<a href="#iclass_sve_high_halves">High halves</a>
<txt> and </txt>
<a href="#iclass_sve_low_halves">Low halves</a>
</classesintro>
<iclass name="High halves" oneof="2" id="iclass_sve_high_halves" no_encodings="1" isa="A64">
<docvars>
<docvar key="instr-class" value="sve" />
<docvar key="isa" value="A64" />
<docvar key="mnemonic" value="ZIP2" />
<docvar key="sve-halves" value="sve-high-halves" />
</docvars>
<iclassintro count="1"></iclassintro>
<regdiagram form="32" psname="ZIP2-P.PP-_" tworows="1">
<box hibit="31" width="8" settings="8">
<c>0</c>
<c>0</c>
<c>0</c>
<c>0</c>
<c>0</c>
<c>1</c>
<c>0</c>
<c>1</c>
</box>
<box hibit="23" width="2" name="size" usename="1">
<c colspan="2"></c>
</box>
<box hibit="21" width="2" settings="2">
<c>1</c>
<c>0</c>
</box>
<box hibit="19" width="4" name="Pm" usename="1">
<c colspan="4"></c>
</box>
<box hibit="15" width="3" settings="3">
<c>0</c>
<c>1</c>
<c>0</c>
</box>
<box hibit="12" name="opc&lt;1&gt;" settings="1">
<c>0</c>
</box>
<box hibit="11" name="opc&lt;0&gt;" settings="1">
<c>0</c>
</box>
<box hibit="10" name="H" usename="1" settings="1">
<c>1</c>
</box>
<box hibit="9" settings="1">
<c>0</c>
</box>
<box hibit="8" width="4" name="Pn" usename="1">
<c colspan="4"></c>
</box>
<box hibit="4" settings="1">
<c>0</c>
</box>
<box hibit="3" width="4" name="Pd" usename="1">
<c colspan="4"></c>
</box>
</regdiagram>
<encoding name="zip2_p_pp_" oneofinclass="1" oneof="2" label="">
<docvars>
<docvar key="instr-class" value="sve" />
<docvar key="isa" value="A64" />
<docvar key="mnemonic" value="ZIP2" />
<docvar key="sve-halves" value="sve-high-halves" />
</docvars>
<asmtemplate><text>ZIP2 </text><a link="sa_pd" hover="Destination scalable predicate register (field &quot;Pd&quot;)">&lt;Pd&gt;</a><text>.</text><a link="sa_t" hover="Size specifier (field &quot;size&quot;) [B,D,H,S]">&lt;T&gt;</a><text>, </text><a link="sa_pn" hover="First source scalable predicate register (field &quot;Pn&quot;)">&lt;Pn&gt;</a><text>.</text><a link="sa_t" hover="Size specifier (field &quot;size&quot;) [B,D,H,S]">&lt;T&gt;</a><text>, </text><a link="sa_pm" hover="Second source scalable predicate register (field &quot;Pm&quot;)">&lt;Pm&gt;</a><text>.</text><a link="sa_t" hover="Size specifier (field &quot;size&quot;) [B,D,H,S]">&lt;T&gt;</a></asmtemplate>
</encoding>
<ps_section howmany="1">
<ps name="ZIP2-P.PP-_" mylink="ZIP2-P.PP-_" enclabels="" sections="1" secttype="noheading">
<pstext mayhavelinks="1" section="Decode" rep_section="decode">if !<a link="impl-aarch64.HaveSVE.0" file="shared_pseudocode.xml" hover="function: boolean HaveSVE()">HaveSVE</a>() &amp;&amp; !<a link="impl-aarch64.HaveSME.0" file="shared_pseudocode.xml" hover="function: boolean HaveSME()">HaveSME</a>() then UNDEFINED;
constant integer esize = 8 &lt;&lt; <a link="impl-shared.UInt.1" file="shared_pseudocode.xml" hover="function: integer UInt(bits(N) x)">UInt</a>(size);
integer n = <a link="impl-shared.UInt.1" file="shared_pseudocode.xml" hover="function: integer UInt(bits(N) x)">UInt</a>(Pn);
integer m = <a link="impl-shared.UInt.1" file="shared_pseudocode.xml" hover="function: integer UInt(bits(N) x)">UInt</a>(Pm);
integer d = <a link="impl-shared.UInt.1" file="shared_pseudocode.xml" hover="function: integer UInt(bits(N) x)">UInt</a>(Pd);
integer part = 1;</pstext>
</ps>
</ps_section>
</iclass>
<iclass name="Low halves" oneof="2" id="iclass_sve_low_halves" no_encodings="1" isa="A64">
<docvars>
<docvar key="instr-class" value="sve" />
<docvar key="isa" value="A64" />
<docvar key="mnemonic" value="ZIP1" />
<docvar key="sve-halves" value="sve-low-halves" />
</docvars>
<iclassintro count="1"></iclassintro>
<regdiagram form="32" psname="ZIP1-P.PP-_" tworows="1">
<box hibit="31" width="8" settings="8">
<c>0</c>
<c>0</c>
<c>0</c>
<c>0</c>
<c>0</c>
<c>1</c>
<c>0</c>
<c>1</c>
</box>
<box hibit="23" width="2" name="size" usename="1">
<c colspan="2"></c>
</box>
<box hibit="21" width="2" settings="2">
<c>1</c>
<c>0</c>
</box>
<box hibit="19" width="4" name="Pm" usename="1">
<c colspan="4"></c>
</box>
<box hibit="15" width="3" settings="3">
<c>0</c>
<c>1</c>
<c>0</c>
</box>
<box hibit="12" name="opc&lt;1&gt;" settings="1">
<c>0</c>
</box>
<box hibit="11" name="opc&lt;0&gt;" settings="1">
<c>0</c>
</box>
<box hibit="10" name="H" usename="1" settings="1">
<c>0</c>
</box>
<box hibit="9" settings="1">
<c>0</c>
</box>
<box hibit="8" width="4" name="Pn" usename="1">
<c colspan="4"></c>
</box>
<box hibit="4" settings="1">
<c>0</c>
</box>
<box hibit="3" width="4" name="Pd" usename="1">
<c colspan="4"></c>
</box>
</regdiagram>
<encoding name="zip1_p_pp_" oneofinclass="1" oneof="2" label="">
<docvars>
<docvar key="instr-class" value="sve" />
<docvar key="isa" value="A64" />
<docvar key="mnemonic" value="ZIP1" />
<docvar key="sve-halves" value="sve-low-halves" />
</docvars>
<asmtemplate><text>ZIP1 </text><a link="sa_pd" hover="Destination scalable predicate register (field &quot;Pd&quot;)">&lt;Pd&gt;</a><text>.</text><a link="sa_t" hover="Size specifier (field &quot;size&quot;) [B,D,H,S]">&lt;T&gt;</a><text>, </text><a link="sa_pn" hover="First source scalable predicate register (field &quot;Pn&quot;)">&lt;Pn&gt;</a><text>.</text><a link="sa_t" hover="Size specifier (field &quot;size&quot;) [B,D,H,S]">&lt;T&gt;</a><text>, </text><a link="sa_pm" hover="Second source scalable predicate register (field &quot;Pm&quot;)">&lt;Pm&gt;</a><text>.</text><a link="sa_t" hover="Size specifier (field &quot;size&quot;) [B,D,H,S]">&lt;T&gt;</a></asmtemplate>
</encoding>
<ps_section howmany="1">
<ps name="ZIP1-P.PP-_" mylink="ZIP1-P.PP-_" enclabels="" sections="1" secttype="noheading">
<pstext mayhavelinks="1" section="Decode" rep_section="decode">if !<a link="impl-aarch64.HaveSVE.0" file="shared_pseudocode.xml" hover="function: boolean HaveSVE()">HaveSVE</a>() &amp;&amp; !<a link="impl-aarch64.HaveSME.0" file="shared_pseudocode.xml" hover="function: boolean HaveSME()">HaveSME</a>() then UNDEFINED;
constant integer esize = 8 &lt;&lt; <a link="impl-shared.UInt.1" file="shared_pseudocode.xml" hover="function: integer UInt(bits(N) x)">UInt</a>(size);
integer n = <a link="impl-shared.UInt.1" file="shared_pseudocode.xml" hover="function: integer UInt(bits(N) x)">UInt</a>(Pn);
integer m = <a link="impl-shared.UInt.1" file="shared_pseudocode.xml" hover="function: integer UInt(bits(N) x)">UInt</a>(Pm);
integer d = <a link="impl-shared.UInt.1" file="shared_pseudocode.xml" hover="function: integer UInt(bits(N) x)">UInt</a>(Pd);
integer part = 0;</pstext>
</ps>
</ps_section>
</iclass>
</classes>
<explanations scope="all">
<explanation enclist="zip1_p_pp_, zip2_p_pp_" symboldefcount="1">
<symbol link="sa_pd">&lt;Pd&gt;</symbol>
<account encodedin="Pd">
<intro>
<para>Is the name of the destination scalable predicate register, encoded in the "Pd" field.</para>
</intro>
</account>
</explanation>
<explanation enclist="zip1_p_pp_, zip2_p_pp_" symboldefcount="1">
<symbol link="sa_t">&lt;T&gt;</symbol>
<definition encodedin="size">
<intro>Is the size specifier, </intro>
<table class="valuetable">
<tgroup cols="2">
<thead>
<row>
<entry class="bitfield">size</entry>
<entry class="symbol">&lt;T&gt;</entry>
</row>
</thead>
<tbody>
<row>
<entry class="bitfield">00</entry>
<entry class="symbol">B</entry>
</row>
<row>
<entry class="bitfield">01</entry>
<entry class="symbol">H</entry>
</row>
<row>
<entry class="bitfield">10</entry>
<entry class="symbol">S</entry>
</row>
<row>
<entry class="bitfield">11</entry>
<entry class="symbol">D</entry>
</row>
</tbody>
</tgroup>
</table>
</definition>
</explanation>
<explanation enclist="zip1_p_pp_, zip2_p_pp_" symboldefcount="1">
<symbol link="sa_pn">&lt;Pn&gt;</symbol>
<account encodedin="Pn">
<intro>
<para>Is the name of the first source scalable predicate register, encoded in the "Pn" field.</para>
</intro>
</account>
</explanation>
<explanation enclist="zip1_p_pp_, zip2_p_pp_" symboldefcount="1">
<symbol link="sa_pm">&lt;Pm&gt;</symbol>
<account encodedin="Pm">
<intro>
<para>Is the name of the second source scalable predicate register, encoded in the "Pm" field.</para>
</intro>
</account>
</explanation>
</explanations>
<ps_section howmany="1">
<ps name="ZIP2-P.PP-_" mylink="execute" enclabels="" sections="1" secttype="Operation">
<pstext mayhavelinks="1" section="Execute" rep_section="execute"><a link="impl-aarch64.CheckSVEEnabled.0" file="shared_pseudocode.xml" hover="function: CheckSVEEnabled()">CheckSVEEnabled</a>();
constant integer VL = <a link="impl-aarch64.CurrentVL.read.none" file="shared_pseudocode.xml" hover="accessor: integer CurrentVL">CurrentVL</a>;
constant integer PL = VL DIV 8;
constant integer pairs = VL DIV (esize * 2);
bits(PL) operand1 = <a link="impl-aarch64.P.read.2" file="shared_pseudocode.xml" hover="accessor: bits(width) P[integer n, integer width]">P</a>[n, PL];
bits(PL) operand2 = <a link="impl-aarch64.P.read.2" file="shared_pseudocode.xml" hover="accessor: bits(width) P[integer n, integer width]">P</a>[m, PL];
bits(PL) result;
integer base = part * pairs;
for p = 0 to pairs-1
<a link="impl-shared.Elem.write.3" file="shared_pseudocode.xml" hover="accessor: Elem[bits(N) &amp;vector, integer e, integer size] = bits(size) value">Elem</a>[result, 2*p+0, esize DIV 8] = <a link="impl-shared.Elem.read.3" file="shared_pseudocode.xml" hover="accessor: bits(size) Elem[bits(N) vector, integer e, integer size]">Elem</a>[operand1, base+p, esize DIV 8];
<a link="impl-shared.Elem.write.3" file="shared_pseudocode.xml" hover="accessor: Elem[bits(N) &amp;vector, integer e, integer size] = bits(size) value">Elem</a>[result, 2*p+1, esize DIV 8] = <a link="impl-shared.Elem.read.3" file="shared_pseudocode.xml" hover="accessor: bits(size) Elem[bits(N) vector, integer e, integer size]">Elem</a>[operand2, base+p, esize DIV 8];
<a link="impl-aarch64.P.write.2" file="shared_pseudocode.xml" hover="accessor: P[integer n, integer width] = bits(width) value">P</a>[d, PL] = result;</pstext>
</ps>
</ps_section>
</instructionsection>