Hi Philipp On Mon, Jul 18, 2016 at 3:13 PM, Philipp Zabel <p.zabel@xxxxxxxxxxxxxx> wrote: > Since the constant expressions are evaluated at compile time, you are > not actually removing shifts. The code generated for precalculate_color > by gcc 5.4 even grows by one asr instruction with this patch. > I dont think that I follow you completely here. The original code was if (a) y= clamp(y, 16<<4, 235<<4) y = clamp(y>>4, 1, 254) And now is if (a) y= clamp(y >>4, 16, 235) else y = clamp(y, 1, 254) On the previous case, when a was true there was 2 clamp operations. Now it is only one. Best regards! -- Ricardo Ribalda -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html