From: "George Spelvin" <linux@horizon.com>
To: akpm@linux-foundation.org, dvlasenk@redhat.com,
linux@horizon.com, linux@rasmusvillemoes.dk, martink@posteo.de,
maxime.coquelin@st.com, mingo@kernel.org,
torvalds@linux-foundation.org, yury.norov@gmail.com
Cc: linux-kernel@vger.kernel.org, martin.kepplinger@theobroma-systems.com
Subject: Re: [PATCH 5/5] arch: x86: use sign_extend64() for sign extension
Date: 16 Oct 2015 17:30:26 -0400 [thread overview]
Message-ID: <20151016213026.22362.qmail@ns.horizon.com> (raw)
In-Reply-To: <1444986427-12101-6-git-send-email-martink@posteo.de>
> --- a/arch/x86/kernel/cpu/perf_event_msr.c
> +++ b/arch/x86/kernel/cpu/perf_event_msr.c
> @@ -163,10 +163,9 @@ again:
> goto again;
>
> delta = now - prev;
> - if (unlikely(event->hw.event_base == MSR_SMI_COUNT)) {
> - delta <<= 32;
> - delta >>= 32; /* sign extend */
> - }
> + if (unlikely(event->hw.event_base == MSR_SMI_COUNT))
> + delta = sign_extend64(delta, 31);
> +
> local64_add(now - prev, &event->count);
> }
GCC can figure it out wither way, but wouldn't
delta = (s32)delta;
be simpler than either?
prev parent reply other threads:[~2015-10-16 21:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-16 9:07 [PATCH v2 0/5] improve sign extension API Martin Kepplinger
2015-10-16 9:07 ` [PATCH 1/5] bitops.h: Improve sign_extend32()'s documentation Martin Kepplinger
2015-10-16 9:07 ` [PATCH 2/5] bitops.h: add sign_extend64() Martin Kepplinger
2015-10-16 9:07 ` [PATCH 3/5] arch: sh: use sign_extend64() for sign extension Martin Kepplinger
2015-10-16 9:07 ` [PATCH 4/5] " Martin Kepplinger
2015-10-16 21:25 ` George Spelvin
2015-10-16 9:07 ` [PATCH 5/5] arch: x86: " Martin Kepplinger
2015-10-16 21:30 ` George Spelvin [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=20151016213026.22362.qmail@ns.horizon.com \
--to=linux@horizon.com \
--cc=akpm@linux-foundation.org \
--cc=dvlasenk@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=martin.kepplinger@theobroma-systems.com \
--cc=martink@posteo.de \
--cc=maxime.coquelin@st.com \
--cc=mingo@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=yury.norov@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
all inboxes | Powered by JetHome®