Skip to content

Commit

Permalink
Add workaround for Clang 3.5
Browse files Browse the repository at this point in the history
It appears Clang 3.5's support for the “add” instruction is limited to
non-negative immediates only.
  • Loading branch information
oleavr committed Sep 12, 2015
1 parent 9ac99c7 commit 7b2a6d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/base/atomicops_internals_arm64_gcc.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
__asm__ __volatile__ ( // NOLINT
"0: \n\t"
"ldxr %w[result], %[ptr] \n\t" // Load the previous value.
"add %w[result], %w[result], %w[increment]\n\t"
"mov %w[temp], %[increment] \n\t"
"add %w[result], %w[result], %w[temp] \n\t"
"stxr %w[temp], %w[result], %[ptr] \n\t" // Try to store the result.
"cbnz %w[temp], 0b \n\t" // Retry on failure.
: [result]"=&r" (result),
Expand Down

0 comments on commit 7b2a6d6

Please sign in to comment.