dcbz
Data Cache Block Set to Zero
Zeros out an entire cache block (usually 128 bytes) in memory. Critical for optimizing memory clears (memset).
Details
The dcbz instruction sets all bytes in the block containing the byte addressed by the effective address (EA) to zero. The EA is calculated as the sum of RA and RB. If the specified block is in storage that is neither Write Through Required nor Caching Inhibited, establishing the block in the data cache without fetching it from main storage may provide the best performance.
Pseudocode Operation
Programming Note
dcbz does not cause the block to exist in the data cache if the block is in storage that is Caching Inhibited. For storage that is neither Write Through Required nor Caching Inhibited, dcbz provides an efficient means of setting blocks of storage to zero. It can be used to initialize large areas of such storage, in a manner that is likely to consume less memory bandwidth than an equivalent sequence of Store instructions. For storage that is either Write Through Required or Caching Inhibited, dcbz is likely to take significantly longer to execute than an equivalent sequence of Store instructions.
Example
Encoding
Operands
-
RA
Base Address -
RB
Index Address