Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if(APPLE)
- #define FUNCTION_NAME(name) _##name
- #else
- #define FUNCTION_NAME(name) name
- #endif
- .globl FUNCTION_NAME(AtomicLoad)
- .globl FUNCTION_NAME(AtomicStore)
- .globl FUNCTION_NAME(AtomicExchange)
- FUNCTION_NAME(AtomicLoad):
- movq (%rdi), %rax
- retq
- FUNCTION_NAME(AtomicStore):
- movq %rsi, (%rdi)
- retq
- FUNCTION_NAME(AtomicExchange):
- xchg (%rdi), %rsi # Swap
- movq %rsi, %rax # Set prev value to RAX
- retq
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement