On Thu, Mar 14, 2013 at 4:54 AM, Nicolas Boulay <[email protected]> wrote:

>
>
> 2013/3/13 Mark Marshall <[email protected]>
>
>> Hi.
>> ...
>>
>>
>> PS.
>> We're not trying to create instruction sets to make writing assembly
>> programs nice and easy.  We're creating instruction sets to make the
>> compilers life easy.  I don't know how easy it is to get GCC to issue a MUX
>> instruction, but I bet it's much harder than the conditional move, which
>> almost all instruction sets have these days.
>>
>
> Instruction in pipeline could be slow down by dependencies between
> register. One way of doing fast instruction execution is to reduce read
> after write dependancies, so MOV is faster than MUX. That why 3 registers
> instruction operation are fashionable, the "dsp instruction", because 2
> registers instruction as in x86 instroduce more (false) dependancies
> between registers.
>
> Linus have wrote a comment about the use of CMOV compare to a branch. It
> prefer a branch because a branch could be easly predicted, which is not the
> case for a data value. The advantage of branch is seen in wide pipelined
> superscalar design.
>

I teach this to my students (and provide the link to the discussion) when I
go over predication.  For an OOO processor with branch prediction (and
therefore speculative execution), it's much better to use branches, because
there are effectively no dependencies to resolve.  (They are, but the
predictor usually makes the right prediction.)  With CMOV, the instruction
can't complete until the dependencies are resolved, which could take a LONG
TIME.

But for an in-order processor, CMOV is usually better because it avoids
branch overhead.  For a GPU, it's even MORE useful because we can avoid
warp divergence.


>
>
> Nicolas
>



-- 
Timothy Normand Miller, PhD
Assistant Professor of Computer Science, Binghamton University
http://www.cs.binghamton.edu/~millerti/
Open Graphics Project
_______________________________________________
Open-graphics mailing list
[email protected]
http://lists.duskglow.com/mailman/listinfo/open-graphics
List service provided by Duskglow Consulting, LLC (www.duskglow.com)

Reply via email to