icbi

Instruction Cache Block Invalidate

icbi RA, RB

Invalidates the instruction cache block associated with the address. Critical for self-modifying code or JITs.

Details

The icbi instruction invalidates a block of the instruction cache. This means that any previously cached instructions in that block are discarded, and subsequent fetches for those instructions will reload them from memory.

Pseudocode Operation

InvalidateICache(EffectiveAddr(RA, RB))

Programming Note

Use icbi to ensure that changes to executable code in memory are reflected in the instruction cache. This is crucial after modifying code at runtime. Ensure the address is properly aligned; typically, block boundaries align with cache line sizes. This instruction operates at user privilege level and may raise an exception if the address is invalid or access is denied.

Example

icbi 0, r3

Encoding

Binary Layout
31
0
/
6
RA
11
RB
16
982
21
/
31
 
Format X-form
Opcode 0x7C0007D6
Extension Base

Operands

  • RA
    Base Address
  • RB
    Index Address