Why is a conditional move not vulnerable for Branch Prediction Failure?
After reading this post (answer on StackOverflow) (at the optimization section), I was wondering why conditional moves are not vulnerable for Branch Prediction Failure. I found on an article on cond moves here (PDF by AMD) . Also there, they claim the performance advantage of cond. moves. But why is this? I don't see it. At the moment that that ASM-instruction is evaluated, the result of the preceding CMP instruction is not known yet. Thanks. Mis-predicted branches are expensive A modern processor generally executes between one and three instructions each cycle if things go well (if it does