@@ -54,9 +54,9 @@ namespace zmq
5454// mutexes).
5555
5656#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_ARM64))
57- class __declspec (align (8 )) atomic_counter_t
57+ class __declspec (align (8 )) atomic_counter_t
5858#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_ARM_ARMV7VE))
59- class __declspec (align (4 )) atomic_counter_t
59+ class __declspec (align (4 )) atomic_counter_t
6060#else
6161class atomic_counter_t
6262#endif
@@ -86,23 +86,23 @@ class atomic_counter_t
8686#elif defined ZMQ_ATOMIC_COUNTER_TILE
8787 old_value = arch_atomic_add (&_value, increment_);
8888#elif defined ZMQ_ATOMIC_COUNTER_X86
89- __asm__ volatile (" lock; xadd %0, %1 \n\t "
90- : " =r" (old_value), " =m" (_value)
91- : " 0" (increment_), " m" (_value)
92- : " cc" , " memory" );
89+ __asm__ volatile (" lock; xadd %0, %1 \n\t "
90+ : " =r" (old_value), " =m" (_value)
91+ : " 0" (increment_), " m" (_value)
92+ : " cc" , " memory" );
9393#elif defined ZMQ_ATOMIC_COUNTER_ARM
9494 integer_t flag, tmp;
95- __asm__ volatile (" dmb sy\n\t "
96- " 1: ldrex %0, [%5]\n\t "
97- " add %2, %0, %4\n\t "
98- " strex %1, %2, [%5]\n\t "
99- " teq %1, #0\n\t "
100- " bne 1b\n\t "
101- " dmb sy\n\t "
102- : " =&r" (old_value), " =&r" (flag), " =&r" (tmp),
103- " +Qo" (_value)
104- : " Ir" (increment_), " r" (&_value)
105- : " cc" );
95+ __asm__ volatile (" dmb sy\n\t "
96+ " 1: ldrex %0, [%5]\n\t "
97+ " add %2, %0, %4\n\t "
98+ " strex %1, %2, [%5]\n\t "
99+ " teq %1, #0\n\t "
100+ " bne 1b\n\t "
101+ " dmb sy\n\t "
102+ : " =&r" (old_value), " =&r" (flag), " =&r" (tmp),
103+ " +Qo" (_value)
104+ : " Ir" (increment_), " r" (&_value)
105+ : " cc" );
106106#elif defined ZMQ_ATOMIC_COUNTER_MUTEX
107107 sync.lock ();
108108 old_value = _value;
@@ -140,24 +140,24 @@ class atomic_counter_t
140140#elif defined ZMQ_ATOMIC_COUNTER_X86
141141 integer_t oldval = -decrement_;
142142 volatile integer_t *val = &_value;
143- __asm__ volatile (" lock; xaddl %0,%1"
144- : " =r" (oldval), " =m" (*val)
145- : " 0" (oldval), " m" (*val)
146- : " cc" , " memory" );
143+ __asm__ volatile (" lock; xaddl %0,%1"
144+ : " =r" (oldval), " =m" (*val)
145+ : " 0" (oldval), " m" (*val)
146+ : " cc" , " memory" );
147147 return oldval != decrement_;
148148#elif defined ZMQ_ATOMIC_COUNTER_ARM
149149 integer_t old_value, flag, tmp;
150- __asm__ volatile (" dmb sy\n\t "
151- " 1: ldrex %0, [%5]\n\t "
152- " sub %2, %0, %4\n\t "
153- " strex %1, %2, [%5]\n\t "
154- " teq %1, #0\n\t "
155- " bne 1b\n\t "
156- " dmb sy\n\t "
157- : " =&r" (old_value), " =&r" (flag), " =&r" (tmp),
158- " +Qo" (_value)
159- : " Ir" (decrement_), " r" (&_value)
160- : " cc" );
150+ __asm__ volatile (" dmb sy\n\t "
151+ " 1: ldrex %0, [%5]\n\t "
152+ " sub %2, %0, %4\n\t "
153+ " strex %1, %2, [%5]\n\t "
154+ " teq %1, #0\n\t "
155+ " bne 1b\n\t "
156+ " dmb sy\n\t "
157+ : " =&r" (old_value), " =&r" (flag), " =&r" (tmp),
158+ " +Qo" (_value)
159+ : " Ir" (decrement_), " r" (&_value)
160+ : " cc" );
161161 return old_value - decrement_ != 0 ;
162162#elif defined ZMQ_ATOMIC_COUNTER_MUTEX
163163 sync.lock ();
@@ -170,10 +170,7 @@ class atomic_counter_t
170170#endif
171171 }
172172
173- integer_t get () const ZMQ_NOEXCEPT
174- {
175- return _value;
176- }
173+ integer_t get () const ZMQ_NOEXCEPT { return _value; }
177174
178175 private:
179176#if defined ZMQ_ATOMIC_COUNTER_CXX11
0 commit comments