<?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="IT" title="IT -- AArch32" type="instruction">
  <docvars>
    <docvar key="armarmheading" value="T1"/>
    <docvar key="instr-class" value="general"/>
    <docvar key="isa" value="T32"/>
    <docvar key="mnemonic" value="IT"/>
  </docvars>
  <heading>IT</heading>
  <desc>
    <brief>
      <para>If-Then</para>
    </brief>
    <authored>
      <para>If-Then makes up to four following instructions (the IT block)
conditional. The conditions for the instructions in the IT block are
the same as, or the inverse of, the condition the <instruction>IT</instruction>
instruction specifies for the first instruction in the block.</para>
      <para>The <instruction>IT</instruction> instruction itself does not affect the condition flags,
but the execution of the instructions in the IT block can change the
condition flags.</para>
      <para>16-bit instructions in the IT block, other than <instruction>CMP</instruction>, <instruction>CMN</instruction>
and <instruction>TST</instruction>, do not set the condition flags. An <instruction>IT</instruction> instruction
with the <value>AL</value> condition can change the behavior without
conditional execution.</para>
      <para>The architecture permits exception return to an instruction in the
IT block only if the restoration of the
<xref linkend="ARMARM_CIHJBHJA">CPSR</xref> restores
<xref linkend="ARMARM_CHDEDFDC">PSTATE</xref>.IT to a state consistent
with the conditions specified by the <instruction>IT</instruction> instruction.  Any other
exception return to an instruction in an IT block is
<arm-defined-word>UNPREDICTABLE</arm-defined-word>. Any branch to a target
instruction in an IT block is not permitted, and if such a branch is
made it is <arm-defined-word>UNPREDICTABLE</arm-defined-word> what condition is used
when executing that target instruction and any subsequent
instruction in the IT block.</para>
      <para>Many uses of the IT instruction are deprecated for performance reasons,
and an implementation might include ITD controls that can disable those uses
of IT, making them <arm-defined-word>UNDEFINED</arm-defined-word>.</para>
      <para>For more information see <xref linkend="ARMARM_BABGABFG">Conditional execution</xref>
and <xref linkend="ARMARM_BABHIJHI">Conditional instructions</xref>. The first of these
sections includes more information about the ITD controls.</para>
    </authored>
    <encodingnotes>
      <para>For more information about the <arm-defined-word>CONSTRAINED UNPREDICTABLE</arm-defined-word> behavior of this instruction, see <xref linkend="ARMARM_CJAEGDJC">Architectural Constraints on UNPREDICTABLE behaviors</xref>.</para>
      <para>Related encodings: <xref linkend="ARMARM_T32.encoding_index.misc16">Miscellaneous 16-bit instructions</xref>.</para>
    </encodingnotes>
    <syntaxnotes>
      <para>The conditions specified in an <instruction>IT</instruction> instruction must match those specified in the syntax of the instructions in its IT block. When assembling to A32 code, assemblers check <instruction>IT</instruction> instruction syntax for validity but do not generate assembled instructions for them. See <xref linkend="ARMARM_BABHIJHI">Conditional instructions</xref>.</para>
    </syntaxnotes>
  </desc>
  <alias_list howmany="0"/>
  <classes>
    <iclass name="T1" oneof="1" id="iclass_t1" no_encodings="1" isa="T32">
      <docvars>
        <docvar key="armarmheading" value="T1"/>
        <docvar key="instr-class" value="general"/>
        <docvar key="isa" value="T32"/>
        <docvar key="mnemonic" value="IT"/>
      </docvars>
      <iclassintro count="1"/>
      <regdiagram form="16" psname="T32.n.misc16.it16.IT_T1" tworows="1">
        <box hibit="15" width="4" settings="4">
          <c>1</c>
          <c>0</c>
          <c>1</c>
          <c>1</c>
        </box>
        <box hibit="11" width="4" settings="4">
          <c>1</c>
          <c>1</c>
          <c>1</c>
          <c>1</c>
        </box>
        <box hibit="7" width="4" name="firstcond" usename="1">
          <c colspan="4"/>
        </box>
        <box hibit="3" width="4" name="mask" usename="1" settings="4" constraint="!= 0000">
          <c colspan="4">!= 0000</c>
        </box>
      </regdiagram>
      <encoding name="IT_T1" oneofinclass="1" oneof="1" label="">
        <docvars>
          <docvar key="armarmheading" value="T1"/>
          <docvar key="instr-class" value="general"/>
          <docvar key="isa" value="T32"/>
          <docvar key="mnemonic" value="IT"/>
        </docvars>
        <asmtemplate><text>IT{</text><a hover="The condition for the second instruction in the IT block. If omitted, the &quot;mask&quot; field is set to 0b1000. If present it is encoded in the &quot;mask[3]&quot; field:


T
: firstcond[0]

E
: NOT firstcond[0]" link="x">&lt;x&gt;</a><text>{</text><a hover="The condition for the third instruction in the IT block. If omitted and &lt;x&gt; is present, the &quot;mask[2:0]&quot; field is set to 0b100. If &lt;y&gt; is present it is encoded in the &quot;mask[2]&quot; field:


T
: firstcond[0]

E
: NOT firstcond[0]" link="y">&lt;y&gt;</a><text>{</text><a hover="The condition for the fourth instruction in the IT block. If omitted and &lt;y&gt; is present, the &quot;mask[1:0]&quot; field is set to 0b10. If &lt;z&gt; is present, the &quot;mask[0]&quot; field is set to 1, and it is encoded in the &quot;mask[1]&quot; field:


T
: firstcond[0]

E
: NOT firstcond[0]" link="z">&lt;z&gt;</a><text>}}}{</text><a hover="See x[Standard assembler syntax fields](Babbefhf)." link="qn_option">&lt;q&gt;</a><text>}  </text><a hover="The condition for the first instruction in the IT block, encoded in the &quot;firstcond&quot; field. See x[Condition codes](tbl:Chdcgdjb) for the range of conditions available, and the encodings." link="cond__5">&lt;cond&gt;</a></asmtemplate>
      </encoding>
      <ps_section howmany="1">
        <ps name="T32.n.misc16.it16.IT_T1" sections="1" secttype="noheading">
          <pstext mayhavelinks="1" section="Decode" rep_section="decode">if mask == '0000' then See(&quot;Related encodings&quot;); end;
if firstcond == '1111' || (firstcond == '1110' &amp;&amp; BitCount(mask) != 1) then
    UnpredictableProcedure();
end;
if <a link="func_InITBlock_0" file="shared_pseudocode.xml">InITBlock</a>() then UnpredictableProcedure(); end;</pstext></ps>
      </ps_section>
      <constrained_unpredictables encoding="T1" ps_block="Decode">
        <cu_case>
          <cu_cause>
            <pstext mayhavelinks="1">firstcond == '1111' || (firstcond == '1110' &amp;&amp; BitCount(mask) != 1)</pstext></cu_cause>
          <cu_type constraint="Constraint_UNDEF"/>
          <cu_type constraint="Constraint_NOP"/>
          <cu_type>
            <cu_type_text>The '1111' condition is treated as being the same as the '1110' condition, meaning always, and the ITSTATE state machine is progressed in the same way as for any other cond_base value.</cu_type_text>
          </cu_type>
        </cu_case>
      </constrained_unpredictables>
    </iclass>
  </classes>
  <explanations scope="all">
    <explanation enclist="IT_T1" symboldefcount="1">
      <symbol link="x">&lt;x&gt;</symbol>
      <account encodedin="">
        <intro>
          <para>The condition for the second instruction in the IT block. If omitted, the &quot;mask&quot; field is set to <binarynumber>0b1000</binarynumber>. If present it is encoded in the &quot;mask[3]&quot; field:</para>
          <list type="param">
            <listitem>
              <param>T</param>
              <content>firstcond[0]</content>
            </listitem>
            <listitem>
              <param>E</param>
              <content>NOT firstcond[0]</content>
            </listitem>
          </list>
        </intro>
      </account>
    </explanation>
    <explanation enclist="IT_T1" symboldefcount="1">
      <symbol link="y">&lt;y&gt;</symbol>
      <account encodedin="">
        <intro>
          <para>The condition for the third instruction in the IT block. If omitted and <syntax>&lt;x&gt;</syntax> is present, the &quot;mask[2:0]&quot; field is set to <binarynumber>0b100</binarynumber>. If <syntax>&lt;y&gt;</syntax> is present it is encoded in the &quot;mask[2]&quot; field:</para>
          <list type="param">
            <listitem>
              <param>T</param>
              <content>firstcond[0]</content>
            </listitem>
            <listitem>
              <param>E</param>
              <content>NOT firstcond[0]</content>
            </listitem>
          </list>
        </intro>
      </account>
    </explanation>
    <explanation enclist="IT_T1" symboldefcount="1">
      <symbol link="z">&lt;z&gt;</symbol>
      <account encodedin="">
        <intro>
          <para>The condition for the fourth instruction in the IT block. If omitted and <syntax>&lt;y&gt;</syntax> is present, the &quot;mask[1:0]&quot; field is set to <binarynumber>0b10</binarynumber>. If <syntax>&lt;z&gt;</syntax> is present, the &quot;mask[0]&quot; field is set to 1, and it is encoded in the &quot;mask[1]&quot; field:</para>
          <list type="param">
            <listitem>
              <param>T</param>
              <content>firstcond[0]</content>
            </listitem>
            <listitem>
              <param>E</param>
              <content>NOT firstcond[0]</content>
            </listitem>
          </list>
        </intro>
      </account>
    </explanation>
    <explanation enclist="IT_T1" symboldefcount="1">
      <symbol link="qn_option">&lt;q&gt;</symbol>
      <account encodedin="">
        <intro>
          <para>See <xref linkend="Babbefhf">Standard assembler syntax fields</xref>.</para>
        </intro>
      </account>
    </explanation>
    <explanation enclist="IT_T1" symboldefcount="1">
      <symbol link="cond__5">&lt;cond&gt;</symbol>
      <account encodedin="">
        <intro>
          <para>The condition for the first instruction in the IT block, encoded in the &quot;firstcond&quot; field. See <xref linkend="tbl:Chdcgdjb">Condition codes</xref> for the range of conditions available, and the encodings.</para>
        </intro>
      </account>
    </explanation>
  </explanations>
  <ps_section howmany="1">
    <ps name="T32.n.misc16.it16.IT_T1" sections="1" secttype="Operation">
      <pstext mayhavelinks="1" section="Execute" rep_section="execute">EncodingSpecificOperations();
<a link="func_AArch32_CheckITEnabled_1" file="shared_pseudocode.xml">AArch32_CheckITEnabled</a>(mask);
<a link="global_PSTATE" file="shared_pseudocode.xml">PSTATE</a>.IT[7:0] = firstcond::mask;
<a link="global_ShouldAdvanceIT" file="shared_pseudocode.xml">ShouldAdvanceIT</a> = FALSE;</pstext></ps>
  </ps_section>
  <timestamp>2026-03-26 20:27:25</timestamp>
  <commit_id>2026-03_rel</commit_id>
</instructionsection>