[PATCH libX11 1/2] xcb_io: Fix Xlib 32-bit request number wrapping

Jonas Petersen jnsptrsn1 at gmail.com
Sun Nov 17 14:57:05 PST 2013


Am 17.11.2013 20:20, schrieb Mouse:
>>     *wide = new + ((unsigned long) (new < *wide) << 16 << 16);
>> The comment says "Treating the comparison as a 1 and shifting it
>> avoids a conditional branch".
> Only on architectures with conditional moves - and, on those, the
> version using ? : is likely to compile down to a conditional move
> anyway.  I think that comment should be fixed.
What do you mean exactly? I thought the comment was saying that using 
"(x < y) << z" is avoiding a conditinal branch introduced by using an 
"if" or "? :" in some way to get the calculation done. Isn't the comment 
true then?

- Jonas


More information about the xorg-devel mailing list