> On May 6, 2020, at 10:23 AM, Linus Torvalds <[email protected]> > wrote: > > On Wed, May 6, 2020 at 6:51 AM Peter Zijlstra <[email protected]> wrote: >> >> I was hoping for: >> >> bar: # @bar >> movl %edi, .L_x$local(%rip) >> retq >> ponies: # @ponies >> movq .Lfoo$local(%rip), %rax >> testq %rax, %rax >> jz 1f >> jmpq *%rcx # TAILCALL >> 1: >> retq > > If you want to just avoid the 'cmov', the best way to do that is to > insert a barrier() on one side of the if-statement. > > That breaks the ability to turn the conditional jump into a cmov. Having done this in the past, you can get potentially better code with asm volatile (“”); than with a barrier and its memory clobber. I don’t know if that will make a difference in this particular case.
- Re: [PATCH v4 14/18] static_call: Add static_cond_c... Linus Torvalds
- Re: [PATCH v4 14/18] static_call: Add static_co... Mathieu Desnoyers
- Re: [PATCH v4 14/18] static_call: Add stati... Nick Desaulniers
- Re: [PATCH v4 14/18] static_call: Add s... Mathieu Desnoyers
- Re: [PATCH v4 14/18] static_call: ... Peter Zijlstra
- Re: [PATCH v4 14/18] static_ca... Mathieu Desnoyers
- Re: [PATCH v4 14/18] static_ca... Peter Zijlstra
- Re: [PATCH v4 14/18] static_call: Add static_cond_call() Peter Zijlstra
- Re: [PATCH v4 14/18] static_call: Add static_cond_c... Peter Zijlstra
- Re: [PATCH v4 14/18] static_call: Add static_cond_c... Linus Torvalds
- Re: [PATCH v4 14/18] static_call: Add static_co... Andy Lutomirski
- Re: [PATCH v4 14/18] static_call: Add static_cond_call() Josh Poimboeuf
- Re: [PATCH v4 14/18] static_call: Add static_cond_c... Peter Zijlstra
- Re: [PATCH v4 14/18] static_call: Add static_co... Josh Poimboeuf
- Re: [PATCH v4 14/18] static_call: Add stati... Peter Zijlstra

