Uoti Urpala <[email protected]> writes:

> On Tue, 2012-03-20 at 12:44 +0000, Måns Rullgård wrote:
>> "Ronald S. Bultje" <[email protected]> writes:
>> >          "mov    "byte"      , %%"REG_c"                             \n\t"\
>> > +        "cmp    "end"       , %%"REG_c"                             \n\t"\
>> > +        "jge    1f                                                  \n\t"\
>> >          "add"OPSIZE" $2     , "byte"                                \n\t"\
>> > +        "1:                                                         \n\t"\
>> 
>> Is there no way of doing this with cmov instead of branching?
>
> Branches don't have to be expensive if they're never actually taken and
> are predicted correctly. It's not obvious whether cmov would be better.

Every branch puts extra pressure on the prediction resources, so
avoiding them can be beneficial even if they'd be predicted.  If there
is a reasonable branch-free alternative, it's worth testing both.

-- 
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to