public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Roland Dreier <rdreier@cisco.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	joerg.roedel@amd.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] introduce lower_32_bits() macro
Date: Fri, 25 Jul 2008 17:39:21 -0400	[thread overview]
Message-ID: <488A4809.8080703@zytor.com> (raw)
In-Reply-To: <ada63qtvg57.fsf@cisco.com>

Roland Dreier wrote:
>  > There's some readability benefit.  Sometimes it is hard to understand
>  > why some random open-coded cast was used.  But I seem to recall that
>  > there was another reason why we decided we needed this.  I forget, and
>  > so apparently did the changelog author ;)
> 
> The guy who added the macro explained it in a comment ;)
> 
>  * A basic shift-right of a 64- or 32-bit quantity.  Use this to suppress
>  * the "right shift count >= width of type" warning when that quantity is
>  * 32-bits.

That was for upper_32_bits() -- and can also be done with an internal 
(u64) cast; it would be interesting to find out if that would generate 
better code.

	-hpa

  reply	other threads:[~2008-07-25 21:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-25 15:12 [PATCH] introduce lower_32_bits() macro Joerg Roedel
2008-07-25 16:06 ` H. Peter Anvin
2008-07-25 20:47   ` Andrew Morton
2008-07-25 20:54     ` Roland Dreier
2008-07-25 21:39       ` H. Peter Anvin [this message]
2008-07-25 20:54     ` H. Peter Anvin
2008-07-28 10:59   ` Joerg Roedel
2008-07-28 12:07   ` Joerg Roedel

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=488A4809.8080703@zytor.com \
    --to=hpa@zytor.com \
    --cc=akpm@linux-foundation.org \
    --cc=joerg.roedel@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdreier@cisco.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