lkml.org 
[lkml]   [1999]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Improving send_sigio() scalability
Date
From
Jamie Lokier <lkd@tantalophile.demon.co.uk> said:
> > > > Why don't you use != when that is what you mean?

> Linus Torvalds wrote:
> > It used to do noticeably better compiler-wise. I don't know if newer
> > versions of gcc have made ^ and != generate the same code.

> Odd.
>
> I would expect != to generate better code than ^: != uses `cmp'
> instruction, ^ uses `xor' unless the compiler gets clever.

Don't "expect", write a proggie and check. E.g. with egcs-19990524, both ifs
in this give the same code:

f(int a, int b, int c, int a2, int b2, int c2)
{
if((a ^ b) && (b ^ c))
do_it1();

if((a2 != b2) && (b2 != c2))
do_it2();
}
--
Horst von Brand vonbrand@sleipnir.valparaiso.cl
Casilla 9G, Viña del Mar, Chile +56 32 672616

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

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