I have just written the following commit message:
"Branch over unconditional jump" hack for arbitrary-length brcc. - brcc (branch and compare) instructions can have static branch-prediction hints, but can only jump a limited distance. - Calculating the distance of a jump at expand-time is hard. - So instead of emitting just a brcc instruction, we emit an unconditional jump to the same place and a branch over it. - I added a simple counter to emit/state to number the labels thus introduced. - With this commit, I forfeit all right to criticise the hackiness of anyone else's code. - Though I doubt that will stop me.
Tags: