Skip to content

Commit 6a6f5eb

Browse files
committed
asm/ppc: Fix a regression in powerpc atomics
Add a missing constraint to the input operand list. This fixes a regression caused by d4be138. Thanks to Orion Poplawski for reporting the issue. Refs #2610 Signed-off-by: Nysal Jan K.A <[email protected]>
1 parent 0971faf commit 6a6f5eb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

opal/include/opal/sys/powerpc/atomic.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ static inline int32_t opal_atomic_swap_32(volatile int32_t *addr, int32_t newval
223223
#if (OPAL_ASSEMBLY_ARCH == OPAL_POWERPC64)
224224

225225
#if OPAL_GCC_INLINE_ASSEMBLY
226+
226227
static inline int64_t opal_atomic_add_64 (volatile int64_t* v, int64_t inc)
227228
{
228229
int64_t t;
@@ -232,7 +233,7 @@ static inline int64_t opal_atomic_add_64 (volatile int64_t* v, int64_t inc)
232233
" stdcx. %0, 0, %3 \n\t"
233234
" bne- 1b \n\t"
234235
: "=&r" (t), "=m" (*v)
235-
: "r" (OPAL_ASM_VALUE64(inc)), "r" OPAL_ASM_ADDR(v)
236+
: "r" (OPAL_ASM_VALUE64(inc)), "r" OPAL_ASM_ADDR(v), "m" (*v)
236237
: "cc");
237238

238239
return t;
@@ -249,7 +250,7 @@ static inline int64_t opal_atomic_sub_64 (volatile int64_t* v, int64_t dec)
249250
" stdcx. %0,0,%3 \n\t"
250251
" bne- 1b \n\t"
251252
: "=&r" (t), "=m" (*v)
252-
: "r" (OPAL_ASM_VALUE64(dec)), "r" OPAL_ASM_ADDR(v)
253+
: "r" (OPAL_ASM_VALUE64(dec)), "r" OPAL_ASM_ADDR(v), "m" (*v)
253254
: "cc");
254255

255256
return t;
@@ -268,7 +269,7 @@ static inline int opal_atomic_cmpset_64(volatile int64_t *addr,
268269
" bne- 1b \n\t"
269270
"2:"
270271
: "=&r" (ret), "=m" (*addr)
271-
: "r" (addr), "r" (OPAL_ASM_VALUE64(oldval)), "r" (OPAL_ASM_VALUE64(newval))
272+
: "r" (addr), "r" (OPAL_ASM_VALUE64(oldval)), "r" (OPAL_ASM_VALUE64(newval)), "m" (*addr)
272273
: "cc", "memory");
273274

274275
return (ret == oldval);

0 commit comments

Comments
 (0)