BFC and BFI

Bit Field Clear and Bit Field Insert. Clear adjacent bits in a register, or Insert adjacent bits from one register into another.

Show/hideSyntax

BFC{cond} Rd, #lsb, #width
BFI{cond} Rd, Rn, #lsb, #width

where:

cond

is an optional condition code.

Rd

is the destination register.

Rn

is the source register.

lsb

is the least significant bit that is to be cleared or copied.

width

is the number of bits to be cleared or copied. width must not be 0, and (width+lsb) must be less than 32.

Show/hideBFC

width bits in Rd are cleared, starting at lsb. Other bits in Rd are unchanged.

Show/hideBFI

width bits in Rd, starting at lsb, are replaced by width bits from Rn, starting at bit[0]. Other bits in Rd are unchanged.

Show/hideRegister restrictions

You cannot use PC for any register.

You can use SP in ARM instructions but these are deprecated in ARMv6T2 and above. You cannot use SP in Thumb instructions.

Show/hideCondition flags

These instructions do not change the flags.

Show/hideArchitectures

These ARM instructions are available in ARMv6T2 and above.

These 32-bit Thumb instructions are available in ARMv6T2 and above.

There are no 16-bit Thumb versions of these instructions.

Show/hideSee also

Reference:
Copyright © 2010-2011 ARM. All rights reserved.ARM DUI 0489C
Non-ConfidentialID080411