[lkml]   [2011]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 13/15] x86: add cmpxchg_flag() variant
On 08/24/2011 01:38 PM, Jeremy Fitzhardinge wrote:
> On 08/24/2011 01:31 PM, H. Peter Anvin wrote:
>> The sete is actually more expensive than the compare for the single-word
>> case. The double-word case is a different matter.
> Hm, setcc has a longer latency but a higher throughput, is that
> correct? Still, its recommended where you can use it to avoid a branch.

Yes, but you don't know when that is (the compiler does, of course.)

> I was also thinking that using it reduces register pressure, since you
> don't need to keep the "old" value around, so it dies sooner.

... but you burn a register for the intermediate flag value, so you're
just as bad off.


 \ /
  Last update: 2011-08-25 01:07    [from the cache]
©2003-2011 Jasper Spaans