Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mxshadowsrv: Use __atomic_fetch_sub instead of __sync_fetch_and_sub
Quote gcc manual: "These functions are intended to replace the legacy ‘__sync’ builtins. The main difference is that the memory order that is requested is a parameter to the functions. New code should always use the ‘__atomic’ builtins rather than the ‘__sync’ builtins. Same assembler code generated on x86_64 for both builtins and no matter what memory order is specified: lock xaddl %eax, debug_remaining_connects(%rip) On ppc, however, __sync_fetch_and_sub creates code for sequential consistency and puts a "sync" instruction before the decrement (which is done atomicially between "lwarx" and "stwcx" instructions) and a "isync" instruction behind it. These two instructions are omitted when only relaxed consistency is requested: sync # optional L22: lwarx 9,0,27 addi 10,9,-1 stwcx. 10,0,27 bne 0,.L22 isync # optional Not, that it would matter at all :-) Make this change anyway to get used to the recommended builtins.
- Loading branch information