This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

What is P1, P2, P3 and P4 use in Thumb2 IF block instruction?

Hi,

When I read IT block in Thumb2 instruction, I don't understand the use of P1, P2, P3 and P4. From below pictures, can you tell me what use are P1, P2, P3 and P4?

Thanks,

This line is especially puzzling. Could you explain it to me?     Next instruction has condition cond_base, P1

Thumb2P.PNG
  • Basically this is just the mechanism by which the IT instruction makes up to four of the following instructions conditional. It is not necessary to know this to know what the IT instruction does - it just shows what will be stored to allow execution to be resumed if there is an interrupt between instruction.

    The IT instruction sets 8 bits in the status register

    The first 3 are the three highest bits of the condition code. The other 5 form a shift code of the top bit to be added to the condition code plus a 1 bit to make the field non-zero whilst IT is operating. The field is shifted left after each following operation and before executing the next one.. When it becomes 10000 it is all zeroed and instructions are executed unconditionally

    The condition code for each instruction is given by IT[7:4], P1 is the lowest bit of the condition code under which the instruction is executed.