EmbeddedRelated.com
Forums
The 2026 Embedded Online Conference

What use of 'AL condition' in ARM IT block?

Started by Robert Willy August 9, 2015
Hi,

I read the following on IT block in ARM Thumb2 instruction. I don't understand
the last sentence on AL to get the changed behavior.

Could you explain it to me?


Thanks,


/////////////
A8.6.50 IT
If Then makes up to four following instructions (the IT block) conditional.
 The conditions for the instructions in the IT block can be the same, or some
 of them can be the inverse of others.

IT does not affect the condition code flags. Branches to any instruction in
 the IT block are not permitted, apart from those performed by exception
 returns.

16-bit instructions in the IT block, other than CMP, CMN and TST, do not set
 the condition code flags. The AL condition can be specified to get this
 changed behavior without conditional execution.
 
On Sun, 09 Aug 2015 16:55:16 -0700, Robert Willy wrote:

> I read the following on IT block in ARM Thumb2 instruction. I don't > understand the last sentence on AL to get the changed behavior. > > Could you explain it to me?
> > 16-bit instructions in the IT block, other than CMP, CMN and TST, do > > not set the condition code flags. The AL condition can be specified > > to get this changed behavior without conditional execution.
The IT (ITT/ITE) instruction is followed by a condition. The AL (ALways) condition is always true. Thus an "IT AL" instruction commences a sequence of four instructions which are always executed (use of the E (Else) flag is prohibited when the condition is AL). Most 16-bit instructions set the condition code flags based upon the result (e.g. the Z flag will be set if the result is zero). 32-bit instructions have an optional S flag to control whether flags are affected. But instructions which are part of an IT block (even one with the AL condition) don't set the condition code flags unless the instruction is CMP, CMN or TST. The term "changed behaviour" refers to not setting the flags.
The 2026 Embedded Online Conference