<?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-2025 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="CPS" title="CPS, CPSID, CPSIE -- AArch32" type="instruction">
  <docvars>
    <docvar key="instr-class" value="general"/>
  </docvars>
  <heading>CPS, CPSID, CPSIE</heading>
  <desc>
    <brief>
      <para>Change PE State</para>
    </brief>
    <authored>
      <para>Change PE State changes one or more of the
<xref linkend="ARMARM_CHDEDFDC">PSTATE</xref>.{A, I, F} interrupt mask bits and,
optionally, the <xref linkend="ARMARM_CHDEDFDC">PSTATE</xref>.M mode field,
without changing any other <xref linkend="ARMARM_CHDEDFDC">PSTATE</xref> bits.</para>
      <para><instruction>CPS</instruction> is treated as <instruction>NOP</instruction> if executed in User mode unless it
is defined as being <arm-defined-word>CONSTRAINED UNPREDICTABLE</arm-defined-word>
elsewhere in this section.</para>
      <para>The PE checks whether the value being written to PSTATE.M is
legal. See <xref linkend="ARMARM_CHDDFIGE">Illegal changes to PSTATE.M</xref>.</para>
    </authored>
    <encodingnotes>
      <para>Hint instructions: In encoding T2, if the <field>imod</field> field is <binarynumber>0b00</binarynumber> and the <field>M</field> bit is <binarynumber>0b0</binarynumber>, a hint instruction is encoded. To determine which hint instruction, see <xref linkend="ARMARM_T32.encoding_index.bcrtrl">Branches and miscellaneous control</xref>.</para>
      <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>
    </encodingnotes>
  </desc>
  <alias_list howmany="0"/>
  <classes>
    <classesintro count="3">
      <txt>It has encodings from the following instruction sets:</txt>
      <txt> A32 (</txt>
      <a href="#iclass_a1">A1</a>
      <txt>)</txt>
      <txt> and </txt>
      <txt> T32 (</txt>
      <a href="#iclass_t1">T1</a>
      <txt> and </txt>
      <a href="#iclass_t2">T2</a>
      <txt>)</txt>
      <txt>.</txt>
    </classesintro>
    <iclass name="A1" oneof="3" id="iclass_a1" no_encodings="5" isa="A32">
      <docvars>
        <docvar key="armarmheading" value="A1"/>
        <docvar key="instr-class" value="general"/>
        <docvar key="isa" value="A32"/>
      </docvars>
      <iclassintro count="5"/>
      <regdiagram form="32" psname="A32.uncond_as.uncondmisc.cps.CPS_A1_AS" tworows="1">
        <box hibit="31" width="12" settings="12">
          <c>1</c>
          <c>1</c>
          <c>1</c>
          <c>1</c>
          <c>0</c>
          <c>0</c>
          <c>0</c>
          <c>1</c>
          <c>0</c>
          <c>0</c>
          <c>0</c>
          <c>0</c>
        </box>
        <box hibit="19" width="2" name="imod" usename="1">
          <c colspan="2"/>
        </box>
        <box hibit="17" width="1" name="M" usename="1">
          <c colspan="1"/>
        </box>
        <box hibit="16" name="op" usename="1" settings="1" psbits="x">
          <c>0</c>
        </box>
        <box hibit="15" width="6" settings="6">
          <c>(0)</c>
          <c>(0)</c>
          <c>(0)</c>
          <c>(0)</c>
          <c>(0)</c>
          <c>(0)</c>
        </box>
        <box hibit="9" name="E" usename="1" settings="1" psbits="x">
          <c>(0)</c>
        </box>
        <box hibit="8" width="1" name="A" usename="1">
          <c colspan="1"/>
        </box>
        <box hibit="7" width="1" name="I" usename="1">
          <c colspan="1"/>
        </box>
        <box hibit="6" width="1" name="F" usename="1">
          <c colspan="1"/>
        </box>
        <box hibit="5" width="1" settings="1">
          <c>0</c>
        </box>
        <box hibit="4" width="5" name="mode" usename="1">
          <c colspan="5"/>
        </box>
      </regdiagram>
      <encoding name="CPS_A1_AS" oneofinclass="5" oneof="12" label="Change mode" bitdiffs="imod == 00 &amp;&amp; M == 1">
        <docvars>
          <docvar key="armarmheading" value="A1"/>
          <docvar key="cps-type" value="cps-mode"/>
          <docvar key="instr-class" value="general"/>
          <docvar key="isa" value="A32"/>
          <docvar key="mnemonic" value="CPS"/>
        </docvars>
        <box hibit="19" width="2" name="imod">
          <c>0</c>
          <c>0</c>
        </box>
        <box hibit="17" width="1" name="M">
          <c>1</c>
        </box>
        <asmtemplate comment="Cannot be conditional"><text>CPS{</text><a hover="See x[Standard assembler syntax fields](Babbefhf)." link="qw_option">&lt;q&gt;</a><text>}  #</text><a hover="Is the number of the mode to change to, in the range 0 to 31, encoded in the &quot;mode&quot; field." link="mode__2">&lt;mode&gt;</a></asmtemplate>
      </encoding>
      <encoding name="CPSID_A1_AS" oneofinclass="5" oneof="12" label="Interrupt disable" bitdiffs="imod == 11 &amp;&amp; M == 0">
        <docvars>
          <docvar key="armarmheading" value="A1"/>
          <docvar key="cps-type" value="cps-id"/>
          <docvar key="instr-class" value="general"/>
          <docvar key="isa" value="A32"/>
          <docvar key="mnemonic" value="CPSID"/>
        </docvars>
        <box hibit="19" width="2" name="imod">
          <c>1</c>
          <c>1</c>
        </box>
        <box hibit="17" width="1" name="M">
          <c>0</c>
        </box>
        <asmtemplate comment="Cannot be conditional"><text>CPSID{</text><a hover="See x[Standard assembler syntax fields](Babbefhf)." link="qw_option">&lt;q&gt;</a><text>}  </text><a hover="Is a sequence of one or more of the following, specifying which interrupt mask bits are affected:&#10;&#10;&#10;a&#10;: Sets the A bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).A, the SError interrupt mask bit.&#10;&#10;i&#10;: Sets the I bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).I, the IRQ interrupt mask bit.&#10;&#10;f&#10;: Sets the F bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).F, the FIQ interrupt mask bit." link="A_I_F">&lt;iflags&gt;</a></asmtemplate>
      </encoding>
      <encoding name="CPSID_A1_ASM" oneofinclass="5" oneof="12" label="Interrupt disable and change mode" bitdiffs="imod == 11 &amp;&amp; M == 1">
        <docvars>
          <docvar key="armarmheading" value="A1"/>
          <docvar key="cps-type" value="cps-id-mode"/>
          <docvar key="instr-class" value="general"/>
          <docvar key="isa" value="A32"/>
          <docvar key="mnemonic" value="CPSID"/>
        </docvars>
        <box hibit="19" width="2" name="imod">
          <c>1</c>
          <c>1</c>
        </box>
        <box hibit="17" width="1" name="M">
          <c>1</c>
        </box>
        <asmtemplate comment="Cannot be conditional"><text>CPSID{</text><a hover="See x[Standard assembler syntax fields](Babbefhf)." link="qw_option">&lt;q&gt;</a><text>}  </text><a hover="Is a sequence of one or more of the following, specifying which interrupt mask bits are affected:&#10;&#10;&#10;a&#10;: Sets the A bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).A, the SError interrupt mask bit.&#10;&#10;i&#10;: Sets the I bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).I, the IRQ interrupt mask bit.&#10;&#10;f&#10;: Sets the F bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).F, the FIQ interrupt mask bit." link="A_I_F">&lt;iflags&gt;</a><text> , #</text><a hover="Is the number of the mode to change to, in the range 0 to 31, encoded in the &quot;mode&quot; field." link="mode__2">&lt;mode&gt;</a></asmtemplate>
      </encoding>
      <encoding name="CPSIE_A1_AS" oneofinclass="5" oneof="12" label="Interrupt enable" bitdiffs="imod == 10 &amp;&amp; M == 0">
        <docvars>
          <docvar key="armarmheading" value="A1"/>
          <docvar key="cps-type" value="cps-ie"/>
          <docvar key="instr-class" value="general"/>
          <docvar key="isa" value="A32"/>
          <docvar key="mnemonic" value="CPSIE"/>
        </docvars>
        <box hibit="19" width="2" name="imod">
          <c>1</c>
          <c>0</c>
        </box>
        <box hibit="17" width="1" name="M">
          <c>0</c>
        </box>
        <asmtemplate comment="Cannot be conditional"><text>CPSIE{</text><a hover="See x[Standard assembler syntax fields](Babbefhf)." link="qw_option">&lt;q&gt;</a><text>}  </text><a hover="Is a sequence of one or more of the following, specifying which interrupt mask bits are affected:&#10;&#10;&#10;a&#10;: Sets the A bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).A, the SError interrupt mask bit.&#10;&#10;i&#10;: Sets the I bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).I, the IRQ interrupt mask bit.&#10;&#10;f&#10;: Sets the F bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).F, the FIQ interrupt mask bit." link="A_I_F">&lt;iflags&gt;</a></asmtemplate>
      </encoding>
      <encoding name="CPSIE_A1_ASM" oneofinclass="5" oneof="12" label="Interrupt enable and change mode" bitdiffs="imod == 10 &amp;&amp; M == 1">
        <docvars>
          <docvar key="armarmheading" value="A1"/>
          <docvar key="cps-type" value="cps-ie-mode"/>
          <docvar key="instr-class" value="general"/>
          <docvar key="isa" value="A32"/>
          <docvar key="mnemonic" value="CPSIE"/>
        </docvars>
        <box hibit="19" width="2" name="imod">
          <c>1</c>
          <c>0</c>
        </box>
        <box hibit="17" width="1" name="M">
          <c>1</c>
        </box>
        <asmtemplate comment="Cannot be conditional"><text>CPSIE{</text><a hover="See x[Standard assembler syntax fields](Babbefhf)." link="qw_option">&lt;q&gt;</a><text>}  </text><a hover="Is a sequence of one or more of the following, specifying which interrupt mask bits are affected:&#10;&#10;&#10;a&#10;: Sets the A bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).A, the SError interrupt mask bit.&#10;&#10;i&#10;: Sets the I bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).I, the IRQ interrupt mask bit.&#10;&#10;f&#10;: Sets the F bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).F, the FIQ interrupt mask bit." link="A_I_F">&lt;iflags&gt;</a><text> , #</text><a hover="Is the number of the mode to change to, in the range 0 to 31, encoded in the &quot;mode&quot; field." link="mode__2">&lt;mode&gt;</a></asmtemplate>
      </encoding>
      <ps_section howmany="1">
        <ps name="A32.uncond_as.uncondmisc.cps.CPS_A1_AS" sections="1" secttype="noheading">
          <pstext mayhavelinks="1" section="Decode" rep_section="decode">if mode != '00000' &amp;&amp; M == '0' then UnpredictableProcedure(); end;
if (imod[1] == '1' &amp;&amp; A::I::F == '000') || (imod[1] == '0' &amp;&amp; A::I::F != '000') then
    UnpredictableProcedure();
end;
let enable : boolean = (imod == '10');
let disable : boolean = (imod == '11');
let changemode : boolean = (M == '1');
let pemode : bits(5) = mode;
let affectA : boolean = (A == '1');
let affectI : boolean = (I == '1');
let affectF : boolean = (F == '1');
if (imod == '00' &amp;&amp; M == '0') || imod == '01' then UnpredictableProcedure(); end;</pstext></ps>
      </ps_section>
      <constrained_unpredictables encoding="A1" ps_block="Decode">
        <cu_case>
          <cu_cause>
            <pstext mayhavelinks="1">imod == '01'</pstext></cu_cause>
          <cu_type constraint="Constraint_UNDEF"/>
          <cu_type constraint="Constraint_NOP"/>
        </cu_case>
        <cu_case>
          <cu_cause>
            <pstext mayhavelinks="1">imod == '00' &amp;&amp; M == '0'</pstext></cu_cause>
          <cu_type constraint="Constraint_UNDEF"/>
          <cu_type constraint="Constraint_NOP"/>
        </cu_case>
        <cu_case>
          <cu_cause>
            <pstext mayhavelinks="1">mode != '00000' &amp;&amp; M == '0'</pstext></cu_cause>
          <cu_type constraint="Constraint_UNDEF"/>
          <cu_type constraint="Constraint_NOP"/>
          <cu_type constraint="Constraint_ADDITIONAL_DECODE">
            <cu_type_variable name="pseudocode" value="changemode = TRUE"/>
          </cu_type>
          <cu_type>
            <cu_type_text>The instruction executes as described, and the value specified by mode is ignored. There are no additional side-effects.</cu_type_text>
          </cu_type>
        </cu_case>
        <cu_case>
          <cu_cause>
            <pstext mayhavelinks="1">imod&lt;1&gt; == '1' &amp;&amp; A:I:F == '000'</pstext></cu_cause>
          <cu_type constraint="Constraint_UNDEF"/>
          <cu_type constraint="Constraint_NOP"/>
          <cu_type>
            <cu_type_text>The instruction behaves as if imod&lt;1&gt; == '0'.</cu_type_text>
          </cu_type>
          <cu_type>
            <cu_type_text>The instruction behaves as if A:I:F has an UNKNOWN nonzero value.</cu_type_text>
          </cu_type>
        </cu_case>
        <cu_case>
          <cu_cause>
            <pstext mayhavelinks="1">imod&lt;1&gt; == '0' &amp;&amp; A:I:F != '000'</pstext></cu_cause>
          <cu_type constraint="Constraint_UNDEF"/>
          <cu_type constraint="Constraint_NOP"/>
          <cu_type>
            <cu_type_text>The instruction behaves as if imod&lt;1&gt; == '1'.</cu_type_text>
          </cu_type>
          <cu_type>
            <cu_type_text>The instruction behaves as if A:I:F == '000'.</cu_type_text>
          </cu_type>
        </cu_case>
      </constrained_unpredictables>
    </iclass>
    <iclass name="T1" oneof="3" id="iclass_t1" no_encodings="2" isa="T32">
      <docvars>
        <docvar key="armarmheading" value="T1"/>
        <docvar key="instr-class" value="general"/>
        <docvar key="isa" value="T32"/>
      </docvars>
      <iclassintro count="2"/>
      <regdiagram form="16" psname="T32.n.misc16.cps16.CPSID_T1_AS" tworows="1">
        <box hibit="15" width="10" settings="10">
          <c>1</c>
          <c>0</c>
          <c>1</c>
          <c>1</c>
          <c>0</c>
          <c>1</c>
          <c>1</c>
          <c>0</c>
          <c>0</c>
          <c>1</c>
        </box>
        <box hibit="5" name="op" usename="1" settings="1" psbits="x">
          <c>1</c>
        </box>
        <box hibit="4" width="1" name="im" usename="1">
          <c colspan="1"/>
        </box>
        <box hibit="3" width="1" settings="1">
          <c>(0)</c>
        </box>
        <box hibit="2" width="1" name="A" usename="1">
          <c colspan="1"/>
        </box>
        <box hibit="1" width="1" name="I" usename="1">
          <c colspan="1"/>
        </box>
        <box hibit="0" width="1" name="F" usename="1">
          <c colspan="1"/>
        </box>
      </regdiagram>
      <encoding name="CPSID_T1_AS" oneofinclass="2" oneof="12" label="Interrupt disable" bitdiffs="im == 1">
        <docvars>
          <docvar key="armarmheading" value="T1"/>
          <docvar key="cps-type" value="cps-id"/>
          <docvar key="instr-class" value="general"/>
          <docvar key="isa" value="T32"/>
          <docvar key="mnemonic" value="CPSID"/>
        </docvars>
        <box hibit="4" width="1" name="im">
          <c>1</c>
        </box>
        <asmtemplate comment="Not permitted in IT block"><text>CPSID{</text><a hover="See x[Standard assembler syntax fields](Babbefhf)." link="qw_option">&lt;q&gt;</a><text>}  </text><a hover="Is a sequence of one or more of the following, specifying which interrupt mask bits are affected:&#10;&#10;&#10;a&#10;: Sets the A bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).A, the SError interrupt mask bit.&#10;&#10;i&#10;: Sets the I bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).I, the IRQ interrupt mask bit.&#10;&#10;f&#10;: Sets the F bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).F, the FIQ interrupt mask bit." link="A_I_F">&lt;iflags&gt;</a></asmtemplate>
      </encoding>
      <encoding name="CPSIE_T1_AS" oneofinclass="2" oneof="12" label="Interrupt enable" bitdiffs="im == 0">
        <docvars>
          <docvar key="armarmheading" value="T1"/>
          <docvar key="cps-type" value="cps-ie"/>
          <docvar key="instr-class" value="general"/>
          <docvar key="isa" value="T32"/>
          <docvar key="mnemonic" value="CPSIE"/>
        </docvars>
        <box hibit="4" width="1" name="im">
          <c>0</c>
        </box>
        <asmtemplate comment="Not permitted in IT block"><text>CPSIE{</text><a hover="See x[Standard assembler syntax fields](Babbefhf)." link="qw_option">&lt;q&gt;</a><text>}  </text><a hover="Is a sequence of one or more of the following, specifying which interrupt mask bits are affected:&#10;&#10;&#10;a&#10;: Sets the A bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).A, the SError interrupt mask bit.&#10;&#10;i&#10;: Sets the I bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).I, the IRQ interrupt mask bit.&#10;&#10;f&#10;: Sets the F bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).F, the FIQ interrupt mask bit." link="A_I_F">&lt;iflags&gt;</a></asmtemplate>
      </encoding>
      <ps_section howmany="1">
        <ps name="T32.n.misc16.cps16.CPSID_T1_AS" sections="1" secttype="noheading">
          <pstext mayhavelinks="1" section="Decode" rep_section="decode">if A::I::F == '000' then UnpredictableProcedure(); end;
let enable : boolean = (im == '0');
let disable : boolean = (im == '1');
let changemode : boolean = FALSE;
let affectA : boolean = (A == '1');
let affectI : boolean = (I == '1');
let affectF : boolean = (F == '1');
let pemode : bits(5) = ARBITRARY : bits(5);
if InITBlock() then UnpredictableProcedure(); end;</pstext></ps>
      </ps_section>
      <constrained_unpredictables encoding="T1" ps_block="Decode">
        <cu_case>
          <cu_cause>
            <pstext mayhavelinks="1">A:I:F == '000'</pstext></cu_cause>
          <cu_type constraint="Constraint_UNDEF"/>
          <cu_type constraint="Constraint_NOP"/>
        </cu_case>
      </constrained_unpredictables>
    </iclass>
    <iclass name="T2" oneof="3" id="iclass_t2" no_encodings="5" isa="T32">
      <docvars>
        <docvar key="armarmheading" value="T2"/>
        <docvar key="instr-class" value="general"/>
        <docvar key="isa" value="T32"/>
      </docvars>
      <iclassintro count="5"/>
      <regdiagram form="16x2" psname="T32.w.bcrtrl.cps.CPS_T2_AS">
        <box hibit="31" width="21" settings="21">
          <c>1</c>
          <c>1</c>
          <c>1</c>
          <c>1</c>
          <c>0</c>
          <c>0</c>
          <c>1</c>
          <c>1</c>
          <c>1</c>
          <c>0</c>
          <c>1</c>
          <c>0</c>
          <c>(1)</c>
          <c>(1)</c>
          <c>(1)</c>
          <c>(1)</c>
          <c>1</c>
          <c>0</c>
          <c>(0)</c>
          <c>0</c>
          <c>(0)</c>
        </box>
        <box hibit="10" width="2" name="imod" usename="1">
          <c colspan="2"/>
        </box>
        <box hibit="8" width="1" name="M" usename="1">
          <c colspan="1"/>
        </box>
        <box hibit="7" width="1" name="A" usename="1">
          <c colspan="1"/>
        </box>
        <box hibit="6" width="1" name="I" usename="1">
          <c colspan="1"/>
        </box>
        <box hibit="5" width="1" name="F" usename="1">
          <c colspan="1"/>
        </box>
        <box hibit="4" width="5" name="mode" usename="1">
          <c colspan="5"/>
        </box>
      </regdiagram>
      <encoding name="CPS_T2_AS" oneofinclass="5" oneof="12" label="Change mode" bitdiffs="imod == 00 &amp;&amp; M == 1">
        <docvars>
          <docvar key="armarmheading" value="T2"/>
          <docvar key="cps-type" value="cps-mode"/>
          <docvar key="instr-class" value="general"/>
          <docvar key="isa" value="T32"/>
          <docvar key="mnemonic" value="CPS"/>
        </docvars>
        <box hibit="10" width="2" name="imod">
          <c>0</c>
          <c>0</c>
        </box>
        <box hibit="8" width="1" name="M">
          <c>1</c>
        </box>
        <asmtemplate comment="Not permitted in IT block"><text>CPS{</text><a hover="See x[Standard assembler syntax fields](Babbefhf)." link="qw_option">&lt;q&gt;</a><text>}  #</text><a hover="Is the number of the mode to change to, in the range 0 to 31, encoded in the &quot;mode&quot; field." link="mode__2">&lt;mode&gt;</a></asmtemplate>
      </encoding>
      <encoding name="CPSID_T2_AS" oneofinclass="5" oneof="12" label="Interrupt disable" bitdiffs="imod == 11 &amp;&amp; M == 0">
        <docvars>
          <docvar key="armarmheading" value="T2"/>
          <docvar key="cps-type" value="cps-id"/>
          <docvar key="instr-class" value="general"/>
          <docvar key="isa" value="T32"/>
          <docvar key="mnemonic" value="CPSID"/>
        </docvars>
        <box hibit="10" width="2" name="imod">
          <c>1</c>
          <c>1</c>
        </box>
        <box hibit="8" width="1" name="M">
          <c>0</c>
        </box>
        <asmtemplate comment="Not permitted in IT block"><text>CPSID.W  </text><a hover="Is a sequence of one or more of the following, specifying which interrupt mask bits are affected:&#10;&#10;&#10;a&#10;: Sets the A bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).A, the SError interrupt mask bit.&#10;&#10;i&#10;: Sets the I bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).I, the IRQ interrupt mask bit.&#10;&#10;f&#10;: Sets the F bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).F, the FIQ interrupt mask bit." link="A_I_F">&lt;iflags&gt;</a></asmtemplate>
      </encoding>
      <encoding name="CPSID_T2_ASM" oneofinclass="5" oneof="12" label="Interrupt disable and change mode" bitdiffs="imod == 11 &amp;&amp; M == 1">
        <docvars>
          <docvar key="armarmheading" value="T2"/>
          <docvar key="cps-type" value="cps-id-mode"/>
          <docvar key="instr-class" value="general"/>
          <docvar key="isa" value="T32"/>
          <docvar key="mnemonic" value="CPSID"/>
        </docvars>
        <box hibit="10" width="2" name="imod">
          <c>1</c>
          <c>1</c>
        </box>
        <box hibit="8" width="1" name="M">
          <c>1</c>
        </box>
        <asmtemplate comment="Not permitted in IT block"><text>CPSID{</text><a hover="See x[Standard assembler syntax fields](Babbefhf)." link="qw_option">&lt;q&gt;</a><text>}  </text><a hover="Is a sequence of one or more of the following, specifying which interrupt mask bits are affected:&#10;&#10;&#10;a&#10;: Sets the A bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).A, the SError interrupt mask bit.&#10;&#10;i&#10;: Sets the I bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).I, the IRQ interrupt mask bit.&#10;&#10;f&#10;: Sets the F bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).F, the FIQ interrupt mask bit." link="A_I_F">&lt;iflags&gt;</a><text>, #</text><a hover="Is the number of the mode to change to, in the range 0 to 31, encoded in the &quot;mode&quot; field." link="mode__2">&lt;mode&gt;</a></asmtemplate>
      </encoding>
      <encoding name="CPSIE_T2_AS" oneofinclass="5" oneof="12" label="Interrupt enable" bitdiffs="imod == 10 &amp;&amp; M == 0">
        <docvars>
          <docvar key="armarmheading" value="T2"/>
          <docvar key="cps-type" value="cps-ie"/>
          <docvar key="instr-class" value="general"/>
          <docvar key="isa" value="T32"/>
          <docvar key="mnemonic" value="CPSIE"/>
        </docvars>
        <box hibit="10" width="2" name="imod">
          <c>1</c>
          <c>0</c>
        </box>
        <box hibit="8" width="1" name="M">
          <c>0</c>
        </box>
        <asmtemplate comment="Not permitted in IT block"><text>CPSIE.W  </text><a hover="Is a sequence of one or more of the following, specifying which interrupt mask bits are affected:&#10;&#10;&#10;a&#10;: Sets the A bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).A, the SError interrupt mask bit.&#10;&#10;i&#10;: Sets the I bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).I, the IRQ interrupt mask bit.&#10;&#10;f&#10;: Sets the F bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).F, the FIQ interrupt mask bit." link="A_I_F">&lt;iflags&gt;</a></asmtemplate>
      </encoding>
      <encoding name="CPSIE_T2_ASM" oneofinclass="5" oneof="12" label="Interrupt enable and change mode" bitdiffs="imod == 10 &amp;&amp; M == 1">
        <docvars>
          <docvar key="armarmheading" value="T2"/>
          <docvar key="cps-type" value="cps-ie-mode"/>
          <docvar key="instr-class" value="general"/>
          <docvar key="isa" value="T32"/>
          <docvar key="mnemonic" value="CPSIE"/>
        </docvars>
        <box hibit="10" width="2" name="imod">
          <c>1</c>
          <c>0</c>
        </box>
        <box hibit="8" width="1" name="M">
          <c>1</c>
        </box>
        <asmtemplate comment="Not permitted in IT block"><text>CPSIE{</text><a hover="See x[Standard assembler syntax fields](Babbefhf)." link="qw_option">&lt;q&gt;</a><text>}  </text><a hover="Is a sequence of one or more of the following, specifying which interrupt mask bits are affected:&#10;&#10;&#10;a&#10;: Sets the A bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).A, the SError interrupt mask bit.&#10;&#10;i&#10;: Sets the I bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).I, the IRQ interrupt mask bit.&#10;&#10;f&#10;: Sets the F bit in the instruction, causing the specified effect on x[PSTATE](CHDEDFDC).F, the FIQ interrupt mask bit." link="A_I_F">&lt;iflags&gt;</a><text>, #</text><a hover="Is the number of the mode to change to, in the range 0 to 31, encoded in the &quot;mode&quot; field." link="mode__2">&lt;mode&gt;</a></asmtemplate>
      </encoding>
      <ps_section howmany="1">
        <ps name="T32.w.bcrtrl.cps.CPS_T2_AS" sections="1" secttype="noheading">
          <pstext mayhavelinks="1" section="Decode" rep_section="decode">if imod == '00' &amp;&amp; M == '0' then See("Hint instructions"); end;
if mode != '00000' &amp;&amp; M == '0' then UnpredictableProcedure(); end;
if (imod[1] == '1' &amp;&amp; A::I::F == '000') || (imod[1] == '0' &amp;&amp; A::I::F != '000') then
    UnpredictableProcedure();
end;
let enable : boolean = (imod == '10');
let disable : boolean = (imod == '11');
let changemode : boolean = (M == '1');
let pemode : bits(5) = mode;
let affectA : boolean = (A == '1');
let affectI : boolean = (I == '1');
let affectF : boolean = (F == '1');
if imod == '01' || InITBlock() then UnpredictableProcedure(); end;</pstext></ps>
      </ps_section>
      <constrained_unpredictables encoding="T2" ps_block="Decode">
        <cu_case>
          <cu_cause>
            <pstext mayhavelinks="1">imod == '01'</pstext></cu_cause>
          <cu_type constraint="Constraint_UNDEF"/>
          <cu_type constraint="Constraint_NOP"/>
        </cu_case>
        <cu_case>
          <cu_cause>
            <pstext mayhavelinks="1">mode != '00000' &amp;&amp; M == '0'</pstext></cu_cause>
          <cu_type constraint="Constraint_UNDEF"/>
          <cu_type constraint="Constraint_NOP"/>
          <cu_type constraint="Constraint_ADDITIONAL_DECODE">
            <cu_type_variable name="pseudocode" value="changemode = TRUE"/>
          </cu_type>
          <cu_type>
            <cu_type_text>The instruction executes as described, and the value specified by mode is ignored. There are no additional side-effects.</cu_type_text>
          </cu_type>
        </cu_case>
        <cu_case>
          <cu_cause>
            <pstext mayhavelinks="1">imod&lt;1&gt; == '1' &amp;&amp; A:I:F == '000'</pstext></cu_cause>
          <cu_type constraint="Constraint_UNDEF"/>
          <cu_type constraint="Constraint_NOP"/>
          <cu_type>
            <cu_type_text>The instruction behaves as if imod&lt;1&gt; == '0'.</cu_type_text>
          </cu_type>
          <cu_type>
            <cu_type_text>The instruction behaves as if A:I:F has an UNKNOWN nonzero value.</cu_type_text>
          </cu_type>
        </cu_case>
        <cu_case>
          <cu_cause>
            <pstext mayhavelinks="1">imod&lt;1&gt; == '0' &amp;&amp; A:I:F != '000'</pstext></cu_cause>
          <cu_type constraint="Constraint_UNDEF"/>
          <cu_type constraint="Constraint_NOP"/>
          <cu_type>
            <cu_type_text>The instruction behaves as if imod&lt;1&gt; == '1'.</cu_type_text>
          </cu_type>
          <cu_type>
            <cu_type_text>The instruction behaves as if A:I:F == '000'.</cu_type_text>
          </cu_type>
        </cu_case>
      </constrained_unpredictables>
    </iclass>
  </classes>
  <explanations scope="all">
    <explanation enclist="CPS_A1_AS, CPSID_A1_AS, CPSID_A1_ASM, CPSIE_A1_AS, CPSIE_A1_ASM, CPSID_T1_AS, CPSIE_T1_AS, CPS_T2_AS, CPSID_T2_ASM, CPSIE_T2_ASM" symboldefcount="1">
      <symbol link="qw_option">&lt;q&gt;</symbol>
      <account encodedin="">
        <intro>
          <para>See <xref linkend="Babbefhf">Standard assembler syntax fields</xref>.</para>
        </intro>
      </account>
    </explanation>
    <explanation enclist="CPS_A1_AS, CPSID_A1_ASM, CPSIE_A1_ASM, CPS_T2_AS, CPSID_T2_ASM, CPSIE_T2_ASM" symboldefcount="1">
      <symbol link="mode__2">&lt;mode&gt;</symbol>
      <account encodedin="mode">
        <intro>
          <para>Is the number of the mode to change to, in the range 0 to 31, encoded in the "mode" field.</para>
        </intro>
      </account>
    </explanation>
    <explanation enclist="CPSID_A1_AS, CPSID_A1_ASM, CPSIE_A1_AS, CPSIE_A1_ASM, CPSID_T1_AS, CPSIE_T1_AS, CPSID_T2_AS, CPSID_T2_ASM, CPSIE_T2_AS, CPSIE_T2_ASM" symboldefcount="1">
      <symbol link="A_I_F">&lt;iflags&gt;</symbol>
      <account encodedin="(A :: I :: F)">
        <intro>
          <para>Is a sequence of one or more of the following, specifying which interrupt mask bits are affected:</para>
          <list type="param">
            <listitem>
              <param>a</param>
              <content>Sets the A bit in the instruction, causing the specified effect on <xref linkend="CHDEDFDC">PSTATE</xref>.A, the SError interrupt mask bit.</content>
            </listitem>
            <listitem>
              <param>i</param>
              <content>Sets the I bit in the instruction, causing the specified effect on <xref linkend="CHDEDFDC">PSTATE</xref>.I, the IRQ interrupt mask bit.</content>
            </listitem>
            <listitem>
              <param>f</param>
              <content>Sets the F bit in the instruction, causing the specified effect on <xref linkend="CHDEDFDC">PSTATE</xref>.F, the FIQ interrupt mask bit.</content>
            </listitem>
          </list>
        </intro>
      </account>
    </explanation>
  </explanations>
  <ps_section howmany="1">
    <ps name="A32.uncond_as.uncondmisc.cps.CPS_A1_AS" sections="1" secttype="Operation">
      <pstext mayhavelinks="1" section="Execute" rep_section="execute">if CurrentInstrSet() == InstrSet_A32 then
    EncodingSpecificOperations();
    if PSTATE.EL != EL0 then
        if enable then
            if affectA then PSTATE.A = '0'; end;
            if affectI then PSTATE.I = '0'; end;
            if affectF then PSTATE.F = '0'; end;
        end;
        if disable then
            if affectA then PSTATE.A = '1'; end;
            if affectI then PSTATE.I = '1'; end;
            if affectF then PSTATE.F = '1'; end;
        end;
        if changemode then
            // AArch32_WriteModeByInstr() sets PSTATE.IL to 1 if this is an illegal mode change.
            AArch32_WriteModeByInstr(pemode);
        end;
    end;
else
    EncodingSpecificOperations();
    if PSTATE.EL != EL0 then
        if enable then
            if affectA then PSTATE.A = '0'; end;
            if affectI then PSTATE.I = '0'; end;
            if affectF then PSTATE.F = '0'; end;
        end;
        if disable then
            if affectA then PSTATE.A = '1'; end;
            if affectI then PSTATE.I = '1'; end;
            if affectF then PSTATE.F = '1'; end;
        end;
        if changemode then
            // AArch32_WriteModeByInstr() sets PSTATE.IL to 1 if this is an illegal mode change.
            AArch32_WriteModeByInstr(pemode);
        end;
    end;
end;</pstext></ps>
  </ps_section>
  <timestamp>2026-03-12 12:23:09</timestamp>
  <commit_id>2025-09_rel_asl1</commit_id>
</instructionsection>
