Re: [PATCH] only use 48-bit lba when necessary

From: Matt Mackall (mpm@selenic.com)
Date: Thu Apr 17 2003 - 23:18:20 EST


On Thu, Apr 17, 2003 at 09:34:37PM -0400, Chuck Ebbert wrote:
> Matt Mackall wrote:
>
>
> >FYI, GCC as of 3.2.3 doesn't yet reduce the if(...) form to branchless
> >code but the & and && versions come out the same with -O2.
>
> The operands of & can be evaluated in any order, while && requires
> left-to-right and does not evaluate the right operand if the left one
> is false. Only the simplest cases could possibly generate the same
> code.

Actually, any where the arguments to && are already boolean (pretty
common) and have no side effects (pretty common) will be equivalent
and could very well result in the same code. Only the simplest cases
are interesting anyway, otherwise the branchless & obfuscation is a
loss due to extra evaluation.

-- 
Matt Mackall : http://www.selenic.com : of or relating to the moon
-
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/



This archive was generated by hypermail 2b29 : Wed Apr 23 2003 - 22:00:23 EST