lkml.org 
[lkml]   [2003]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] 2.4.21-rc1 pointless IDE noise reduction
Hi !

Well, although I usually don't like these endless coding-style threads, why
don't you simply use this common form ? :

return !!(foo & MASK);

I found that the compilers like it much and easily emit conditionnal set
instructions. Eg, on x86, this should be something like :

testl MASK, foo
setnz retcode

Cheers,
Willy

On Thu, Apr 24, 2003 at 01:15:39PM -0400, Timothy Miller wrote:
> >
> >
> >I meant return ((foo & MASK) && 1);
> >
> >Try it, you'll like it! No shifts, no jumps.
> >
> >
> >
>
> Looks sweet! If the compiler is smart, that is. I'll add that to my
> repetoire. I'll have to see what the asm output looks like.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:34    [W:0.240 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site