[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPybu_3MLxefeLDoU_HhSrS7ugc1idE7Qa7=h5a2F0x+4TizFg@mail.gmail.com>
Date: Mon, 18 Jul 2016 15:21:10 +0200
From: Ricardo Ribalda Delgado <ricardo.ribalda@...il.com>
To: Philipp Zabel <p.zabel@...gutronix.de>
Cc: Jonathan Corbet <corbet@....net>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Hans Verkuil <hverkuil@...all.nl>,
Markus Heiser <markus.heiser@...marit.de>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Helen Mae Koike Fornazier <helen.koike@...labora.co.uk>,
Antti Palosaari <crope@....fi>,
Shuah Khan <shuahkh@....samsung.com>,
linux-doc@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
linux-media <linux-media@...r.kernel.org>
Subject: Re: [PATCH v4 09/12] [media] vivid: Local optimization
Hi Philipp
On Mon, Jul 18, 2016 at 3:13 PM, Philipp Zabel <p.zabel@...gutronix.de> 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
Powered by blists - more mailing lists