lkml.org 
[lkml]   [2008]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] introduce lower_32_bits() macro
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


\
 
 \ /
  Last update: 2008-07-25 23:43    [W:0.052 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site