Quote from the original MRP issue ( https://web.archive.org/web/20150521201215/http://jira.codehaus.org/browse/MRP-11 ):
Currently our edge counters saturate at 0x7FFFFFFF which means hot code will often have saturated values on both branch edges. We should saturate at 0xFFFFFFFF.
Currently our code to increment an edge counter is:
by subtracting the carry if it occurs this code can saturate at 0xFFFFFFFF with:
We should check if the improvements could be applied to PPC. AFAIK PPC doesn't have instructions that can directly subtract the carry flag, but I might be wrong. I suppose we could add the carry flag to another empty scratch register and subtract that but I'm not sure if that would be a good idea.