<?xml version="1.0" ?><?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-2026 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="STZGM" title="STZGM -- A64" type="instruction">
  <docvars>
    <docvar key="instr-class" value="general"/>
    <docvar key="isa" value="A64"/>
    <docvar key="mnemonic" value="STZGM"/>
  </docvars>
  <heading>STZGM</heading>
  <desc>
    <brief>
      <para>Store Allocation Tag and zero multiple</para>
    </brief>
    <authored>
      <para>This instruction writes a naturally aligned block of N Allocation Tags
and stores zero to the associated data locations, where the size of N
is identified in <register_link id="AArch64-dczid_el0.xml" state="AArch64">DCZID_EL0</register_link>.BS, and the Allocation Tag
is taken from the source register bits&lt;3:0&gt;.</para>
      <para>This instruction is <arm-defined-word>UNDEFINED</arm-defined-word> at EL0.
This instruction generates an Unchecked access.</para>
    </authored>
  </desc>
  <alias_list howmany="0"/>
  <classes>
    <iclass name="Integer" oneof="1" id="iclass_integer" no_encodings="1" isa="A64">
      <docvars>
        <docvar key="instr-class" value="general"/>
        <docvar key="isa" value="A64"/>
        <docvar key="mnemonic" value="STZGM"/>
      </docvars>
      <iclassintro count="1"/>
      <arch_variants>
        <arch_variant feature="FEAT_MTE2" name="v8Ap5"/>
      </arch_variants>
      <regdiagram form="32" psname="A64.ldst.ldsttags.STZGM_64bulk_ldsttags" tworows="1">
        <box hibit="31" width="4" settings="4">
          <c>1</c>
          <c>1</c>
          <c>0</c>
          <c>1</c>
        </box>
        <box hibit="27" width="1" settings="1">
          <c>1</c>
        </box>
        <box hibit="26" width="1" settings="1">
          <c>0</c>
        </box>
        <box hibit="25" width="1" settings="1">
          <c>0</c>
        </box>
        <box hibit="24" width="1" settings="1">
          <c>1</c>
        </box>
        <box hibit="23" width="2" name="opc" usename="1" settings="2" psbits="xx">
          <c>0</c>
          <c>0</c>
        </box>
        <box hibit="21" width="1" settings="1">
          <c>1</c>
        </box>
        <box hibit="20" width="9" name="imm9" usename="1" settings="9" psbits="xxxxxxxxx">
          <c>0</c>
          <c>0</c>
          <c>0</c>
          <c>0</c>
          <c>0</c>
          <c>0</c>
          <c>0</c>
          <c>0</c>
          <c>0</c>
        </box>
        <box hibit="11" width="2" name="op2" usename="1" settings="2" psbits="xx">
          <c>0</c>
          <c>0</c>
        </box>
        <box hibit="9" width="5" name="Rn" usename="1">
          <c colspan="5"/>
        </box>
        <box hibit="4" width="5" name="Rt" usename="1">
          <c colspan="5"/>
        </box>
      </regdiagram>
      <encoding name="STZGM_64bulk_ldsttags" oneofinclass="1" oneof="1" label="">
        <docvars>
          <docvar key="instr-class" value="general"/>
          <docvar key="isa" value="A64"/>
          <docvar key="mnemonic" value="STZGM"/>
        </docvars>
        <asmtemplate><text>STZGM  </text><a hover="Is the 64-bit name of the general-purpose source register, encoded in the &quot;Rt&quot; field." link="XtOrXZR__3">&lt;Xt&gt;</a><text>, [</text><a hover="Is the 64-bit name of the general-purpose base register or stack pointer, encoded in the &quot;Rn&quot; field." link="XnSP_option">&lt;Xn|SP&gt;</a><text>]</text></asmtemplate>
      </encoding>
      <ps_section howmany="1">
        <ps name="A64.ldst.ldsttags.STZGM_64bulk_ldsttags" sections="1" secttype="noheading">
          <pstext mayhavelinks="1" section="Decode" rep_section="decode">if !IsFeatureImplemented(FEAT_MTE2) then <a link="func_EndOfDecode_1" file="shared_pseudocode.xml">EndOfDecode</a>(<a link="enum_Decode_UNDEF" file="shared_pseudocode.xml">Decode_UNDEF</a>); end;
let t : integer{} = UInt(Rt);
let n : integer{} = UInt(Rn);</pstext></ps>
      </ps_section>
    </iclass>
  </classes>
  <explanations scope="all">
    <explanation enclist="STZGM_64bulk_ldsttags" symboldefcount="1">
      <symbol link="XtOrXZR__3">&lt;Xt&gt;</symbol>
      <account encodedin="Rt">
        <intro>
          <para>Is the 64-bit name of the general-purpose source register, encoded in the &quot;Rt&quot; field.</para>
        </intro>
      </account>
    </explanation>
    <explanation enclist="STZGM_64bulk_ldsttags" symboldefcount="1">
      <symbol link="XnSP_option">&lt;Xn|SP&gt;</symbol>
      <account encodedin="Rn">
        <intro>
          <para>Is the 64-bit name of the general-purpose base register or stack pointer, encoded in the &quot;Rn&quot; field.</para>
        </intro>
      </account>
    </explanation>
  </explanations>
  <ps_section howmany="1">
    <ps name="A64.ldst.ldsttags.STZGM_64bulk_ldsttags" sections="1" secttype="Operation">
      <pstext mayhavelinks="1" section="Execute" rep_section="execute">if <a link="global_PSTATE" file="shared_pseudocode.xml">PSTATE</a>.EL == <a link="global_EL0" file="shared_pseudocode.xml">EL0</a> then Undefined(); end;

let data : bits(64) = X{}(t);
let tag : bits(4) = data[3:0];
var address : bits(64);
if n == 31 then
    <a link="func_CheckSPAlignment_0" file="shared_pseudocode.xml">CheckSPAlignment</a>();
    address = <a link="accessor_SP_1" file="shared_pseudocode.xml">SP</a>{64}();
else
    address = <a link="accessor_X_2" file="shared_pseudocode.xml">X</a>{64}(n);
end;

let size : integer{} = 4 * (2 ^ (UInt(DCZID_EL0().BS)));
address = AlignDownSize(address, size);
let count : integer = size &gt;&gt; <a link="global_LOG2_TAG_GRANULE" file="shared_pseudocode.xml">LOG2_TAG_GRANULE</a>;
let stzgm : boolean = TRUE;
let accdesc : <a link="type_AccessDescriptor" file="shared_pseudocode.xml">AccessDescriptor</a> = <a link="func_CreateAccDescLDGSTG_3" file="shared_pseudocode.xml">CreateAccDescLDGSTG</a>(<a link="enum_MemOp_STORE" file="shared_pseudocode.xml">MemOp_STORE</a>, stzgm, t);

for i = 0 to count-1 do
    <a link="accessor_AArch64_MemTag_2" file="shared_pseudocode.xml">AArch64_MemTag</a>(address, accdesc) = tag;
    <a link="accessor_Mem_3" file="shared_pseudocode.xml">Mem</a>{8*<a link="global_TAG_GRANULE" file="shared_pseudocode.xml">TAG_GRANULE</a>}(address, accdesc) = Zeros{8*<a link="global_TAG_GRANULE" file="shared_pseudocode.xml">TAG_GRANULE</a>};
    address = <a link="func_AddressIncrement_3" file="shared_pseudocode.xml">AddressIncrement</a>(address, <a link="global_TAG_GRANULE" file="shared_pseudocode.xml">TAG_GRANULE</a>, accdesc);
end;</pstext></ps>
  </ps_section>
  <timestamp>2026-03-26 20:27:25</timestamp>
  <commit_id>2026-03_rel</commit_id>
</instructionsection>