icbi (Instruction Cache Block Invalidate) instruction

Purpose

Invalidates a block containing the byte addressed in the instruction cache, causing subsequent references to retrieve the block from main memory.

Note: The icbi instruction is supported only in the PowerPC® architecture.

Syntax

Bits Value
0-5 31
6-10 ///
11-15 RA
16-20 RB
21-30 982
31 /
PowerPC® 
icbi RA, RB

Description

The icbi instruction invalidates a block containing the byte addressed in the instruction cache. If RA is not 0, the icbi instruction calculates an effective address (EA) by adding the contents of general-purpose register (GPR) RA to the contents of GPR RB.

Consider the following when using the icbi instruction:

  • If the Data Relocate (DR) bit of the Machine State Register (MSR) is 0, the effective address is treated as a real address.
  • If the MSR DR bit is 1, the effective address is treated as a virtual address. The MSR Relocate (IR) bit is ignored in this case.
  • If a block containing the byte addressed by the EA is in the instruction cache, the block is made unusable so the next reference to the block is taken from main memory.

The icbi instruction has one syntax form and does not affect Condition Register Field 0 or the Fixed-Point Exception Register.

Parameters

Item Description
RA Specifies source general-purpose register for the EA calculation.
RB Specifies source general-purpose register for the EA calculation.

Examples

The following code ensures that modified instructions are available for execution:


# Assume GPR 3 contains a modified instruction.
# Assume GPR 4 contains the address of the memory location
# where the modified instruction will be stored.
stw     3,0(4)           # Store the modified instruction.
dcbf    0,4              # Copy the modified instruction to
                         # main memory.
sync                     # Ensure update is in main memory.
icbi    0,4              # Invalidate block with old instruction.
isync                    # Discard prefetched instructions.
b       newcode          # Go execute the new code.