2.7.3. Execution state bits

The execution state bits consist of the If-Then state bits, IT, Java state bit, J, and Thumb state bit, T.

IT state bits

The IT_cond field encodes the base condition code for the current IT block, if any. It must contain b000 when no IT block is active.

The a, b, c, d, and e bits encode the number of instructions that are to be conditionally executed, and whether the condition for each is the base condition code or the inverse of the base condition code. They must contain b00000 when no IT block is active.

When an IT instruction is executed, these bits are set according to the condition in the instruction, and the Then and Else (T and E) parameters in the instruction.

During execution of an IT block, the a, b, c, d, and e bits are shifted:

  • to reduce the number of instructions to be conditionally executed by one

  • to move the next bit into position to form the least significant bit of the condition code.

Table 2.2 shows how the IT execution state bits operate.

Table 2.2. Shifting of IT execution state bits

 Old state  New state
IT_condabcde IT_condabcde
cond_baseP1P2P3P41 cond_baseP2P3P410
cond_baseP1P2P310 cond_baseP2P3100
cond_baseP1P2100 cond_baseP21000
cond_baseP11000 b00000000

Table 2.3 shows the effect of each state.

Table 2.3. Effect of IT execution state bits

Entry point for:IT_condabcdeDescription
4-instruction IT blockcond_baseP1P2P3P41Next instruction has condition cond_base, P1
3-instruction IT blockcond_baseP1P2P310Next instruction has condition cond_base, P1
2-instruction IT blockcond_baseP1P2100Next instruction has condition cond_base, P1
1-instruction IT blockcond_baseP11000Next instruction has condition cond_base, P1
Invalidnon-zerox0000

Unpredictable

Invalidbxxx10000

Unpredictable

Not in an IT blockb00000000Normal execution

Note

  • The IT state bits return as zero if an MRS of the CPSR is executed within an IT block in normal operation. In Debug state an MRS of the CPSR within an IT block return the IT state bits as shown in Table 2.2 and Table 2.3

  • Writing the IT bits by MSR instructions is ignored.

In Debug state an MRS of the CPSR within an IT block return the IT state bits as shown in Table 2.2 and Table 2.3.

For more details, see the ARM Architecture Reference Manual.

J bit

This bit is set to 0 on reset. For information on its behavior, see Acceleration of execution environments.

T bit

The T bit reflects the operating state:

  • when the T bit is set, the processor is executing in Thumb state

  • when the T bit is clear, the processor is executing in ARM state.

Note

Never use an MSR instruction to force a change to the state of the T bit in the CPSR. If an MSR instruction does try to modify this bit the result is architecturally Unpredictable. In the ARM1156T2-S processor this bit is not affected.

Copyright ©  2005-2007 ARM Limited. All rights reserved.ARM DDI 0338G
Non-Confidential