icbi
Instruction Cache Block Invalidate
Invalidates the instruction cache block associated with the address. Critical for self-modifying code or JITs.
Details
Invalidates the instruction cache block that contains the address RA + RB, forcing subsequent instruction fetches from that block to reload from lower cache levels or memory. Essential for self-modifying code and JIT compilers. May affect performance on some implementations.
Pseudocode Operation
EA ← (RA) + (RB)
Invalidate_ICacheBlock(EA)
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
// Invalidate instruction cache at r3.
Encoding
Operands
-
RA
Base Address -
RB
Index Address