When the "ob" option is specified, the code generator will try to order the blocks of code emitted such that the "expected" execution path (as determined by a set of simple heuristics) will be straight through, with other cases being handled by jumps to separate blocks of code "out of line". This will result in better cache utilization on the Pentium. If the heuristics do not apply to your code, it could result in a performance decrease.
However it gives no information as to what those heuristics are. Is anyone able to explain how watcom decides how it determines which path is expected? Maybe it can be added to the guide?
Additionally is there any way to add a hint for this such as c++ likely/unlikely attributes or gcc's __builtin_expect?
The user guide says this about branch prediction:
However it gives no information as to what those heuristics are. Is anyone able to explain how watcom decides how it determines which path is expected? Maybe it can be added to the guide?
Additionally is there any way to add a hint for this such as c++ likely/unlikely attributes or gcc's __builtin_expect?