Richard B. Johnson wrote:
> > Leave that to the gcc. If it is faster to clear high bit with two
> > shifts, _gcc_ is the one to decide that. And yes gcc is clever enough
> > to se things like that. [replacing and 0x7fffffff with shl 1 shr 1
> > is really no problem].
>
> Well it's a problem if it doesn't work.
> int main()
> {
> int xxx = 0xffffffff;
> printf("%d\n", foo0(xxx));
> printf("%d\n", foo1(xxx));
> return 0;
> }
You forgot to use `unsigned int' :-)
-- Jamie
-
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/
This archive was generated by hypermail 2b29 : Sun Jan 23 2000 - 21:00:18 EST