Commit 17378b20 authored by Henrik Gramner's avatar Henrik Gramner Committed by Anton Mitrofanov
Browse files

gcc: Enable __sync_fetch_and_add() on x86-64

It was previously only enabled on 32-bit x86 for no reason, so 64-bit
systems had to use a mutex instead of a simple `lock xadd` instruction.

Note that this code is only used in some very specific configurations
involving sliced threads.
parent 86b71982
......@@ -249,7 +249,7 @@ int x264_threading_init( void );
static ALWAYS_INLINE int x264_pthread_fetch_and_add( int *val, int add, x264_pthread_mutex_t *mutex )
{
#if HAVE_THREAD
#if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ > 0) && ARCH_X86
#if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ > 0) && (ARCH_X86 || ARCH_X86_64)
return __sync_fetch_and_add( val, add );
#else
x264_pthread_mutex_lock( mutex );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment