clrbhrb
Clear Branch History Rolling Buffer
clrbhrb
Clear Branch History Rolling Buffer. Clears all entries in the Branch History Rolling Buffer (BHRB) to zero. Used to flush branch prediction history, for example when switching execution contexts to prevent information leakage between security domains.
Encoding
Binary Layout
31
0:5
/
6:10
/
11:15
/
16:20
894
21:30
/
31
Operands
Related
More in Base
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
Sets all BHRB entries to 0s.
Operation
for n = 0 to (number_of_BHRBEs implemented - 1)
BHRB(n) ←0
Programming Note
The clrbhrb instruction is used to clear the Branch History Rolling Buffer, resetting all its entries to zero. This can be useful for ensuring a predictable state before branch prediction analysis or when isolating performance tests. However, it should be used with caution as it affects speculative execution paths, potentially impacting performance if not necessary.