lkml.org 
[lkml]   [2007]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRE: kernel + gcc 4.1 = several problems


On Thu, 4 Jan 2007, Zou, Nanhai wrote:
>
> cmov will stall on eflags in your test program.

And that is EXACTLY my point.

CMOV is a piece of CRAP for most things, exactly because it serializes
three streams of data: the two inputs, and the conditional.

My test-case was actually _good_ for cmov, because there was just the one
conditional (which was 100% ALU) thing that was serialized. In real life,
the two data sources also come from memory, and _any_ of them being
delayed ends up delaying the cmov, and screwing up your out-of-order
pipeline because you now introduced a serialization point that was very
possibly not necessary at all.

In contrast, a conditional branch-around serializes absolutely NOTHING,
because branches get predicted.

> I think you will see benefit of cmov if you can manage to put some
> instructions which does NOT modify eflags between testl and cmov.

A lot of the time, the conditional _is_ the critical path.

The whole point of this discussion was that cmov isn't really all that
great. It has fundamental problems that a conditional branch that gets
predicted simply does not have.

That's qiute apart from the fact that cmov has rather limited semantics,
and that in 99% of all cases you have to use a conditional branch anyway.

Linus
-
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: 2009-11-18 23:46    [W:0.087 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site