"Mike Stump" <[EMAIL PROTECTED]> 
??????:[EMAIL PROTECTED]
> On Apr 8, 2007, at 2:37 AM, Uros Bizjak wrote:
>> My docs say that "INC/DEC does not change the carry flag".
>
> Personally, I'm having a hard time envisioning how the semantics of  the 
> instruction are relevant at all.  This is all about instructing  tuning, 
> so, semantics cannot matter, otherwise, it would be wrong to  make this a 
> tune choice.

Intel's optimization reference manual says that:

3.5.1.1 Use of the INC and DEC Instructions
The INC and DEC instructions modify only a subset of the bits in the flag 
register. This creates a dependence on all previous writes of the flag 
register. This is especially problematic when these instructions are on the 
critical path because they are used to change an address for a load on which 
many other instructions depend.

Assembly/Compiler Coding Rule 32. (M impact, H generality)
INC and DEC instructions should be replaced with ADD or SUB instructions, 
because ADD and SUB overwrite all flags, whereas INC and DEC do not, 
therefore creating false dependencies on earlier instructions that set the 
flags.

>
>> But you have better resources that I, so if you think that C2D  should be 
>> left out of X86_TUNE_USE_INCDEC, then the patch is pre- approved for 
>> mainline.
>
> I'm confused again, it isn't that it should be left out, it is that  it 
> should be included.  My patch adds inc/dec selection for C2D.  I'd  also 
> like it for generic on darwin, as that makes more sense for us.   How does 
> the rest of the community feel about inc/dec selection for  generic?

-- 
Zuxy



Reply via email to