-
- Downloads
x86: Use asm goto to implement better modify_and_test() functions
Linus suggested using asm goto to get rid of the typical SETcc + TEST instruction pair -- which also clobbers an extra register -- for our typical modify_and_test() functions. Because asm goto doesn't allow output fields it has to include an unconditinal memory clobber when it changes a memory variable to force a reload. Luckily all atomic ops already imply a compiler barrier to go along with their memory barrier semantics. Suggested-by:Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by:
Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/n/tip-0mtn9siwbeo1d33bap1422se@git.kernel.org Signed-off-by:
Ingo Molnar <mingo@kernel.org>
Showing
- arch/x86/include/asm/atomic.h 5 additions, 24 deletionsarch/x86/include/asm/atomic.h
- arch/x86/include/asm/atomic64_64.h 4 additions, 24 deletionsarch/x86/include/asm/atomic64_64.h
- arch/x86/include/asm/bitops.h 4 additions, 20 deletionsarch/x86/include/asm/bitops.h
- arch/x86/include/asm/local.h 4 additions, 24 deletionsarch/x86/include/asm/local.h
- arch/x86/include/asm/rmwcc.h 41 additions, 0 deletionsarch/x86/include/asm/rmwcc.h
arch/x86/include/asm/rmwcc.h
0 → 100644
Please register or sign in to comment