From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Shailendra Verma <shailendra.capricorn@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input:evdev - Fix to avoid the execution of same instruction in every iteration of for loop.
Date: Wed, 20 May 2015 12:36:44 -0700 [thread overview]
Message-ID: <20150520193644.GF23809@dtor-ws> (raw)
In-Reply-To: <1432148746-3845-1-git-send-email-shailendra.capricorn@gmail.com>
Hi Shailendra,
On Thu, May 21, 2015 at 12:35:46AM +0530, Shailendra Verma wrote:
> Here in for loop the instruction "len / sizeof(compat_long_t)" is used
> as a terminating condition which is executing (being computed) in every
> iteration of for loop. Below is the armv7-a architecture assembly code with
> similar for loop having the same instruction in condition.Note that the
> instruction "lsr r3, r3, #2" i.e Logical Shift Right on behalf of
> "len / sizeof(compat_long_t)" is getting executed every time the loop
> iterates.
No, it is not. We compile kernel with -O2 and compiler is smart enough
to optimize such constructs.
Thanks.
--
Dmitry
prev parent reply other threads:[~2015-05-20 19:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-20 19:05 [PATCH] Input:evdev - Fix to avoid the execution of same instruction in every iteration of for loop Shailendra Verma
2015-05-20 19:36 ` Dmitry Torokhov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150520193644.GF23809@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shailendra.capricorn@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).