lkml.org 
[lkml]   [2009]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86: percpu_to_op() misses memory and flags clobbers
Herbert Xu wrote:
> Jeremy Fitzhardinge <jeremy@goop.org> wrote:
>
>> There's probably not a lot of value in this. The Intel and AMD
>> optimisation guides tend to deprecate inc/dec in favour of using
>> add/sub, because the former can cause pipeline stalls due to its partial
>> flags update.
>>
>
> Is this still the case on the latest Intel CPUs?
>

Yes:

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.

J


\
 
 \ /
  Last update: 2009-04-02 16:15    [W:0.050 / U:1.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site