From 002ff853059c14c55188a6cbe4fdbc4baa06219e Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 22 Mar 2003 00:05:02 +0000 Subject: 2003-03-21 Roland McGrath * sysdeps/i386/i486/bits/atomic.h (atomic_bit_set): Use "ir" constraint to permit non-constant BIT argument. (atomic_bit_test_set): Likewise. * sysdeps/x86_64/bits/atomic.h (atomic_bit_test_set): Likewise. (atomic_bit_set): Likewise. Use 1UL in case that BIT might be >= 32. For quadword case, use "i" constraint if __builtin_constant_p and < 32 or "r" constraint otherwise. --- sysdeps/i386/i486/bits/atomic.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sysdeps/i386') diff --git a/sysdeps/i386/i486/bits/atomic.h b/sysdeps/i386/i486/bits/atomic.h index 502d392270..33c47dc63b 100644 --- a/sysdeps/i386/i486/bits/atomic.h +++ b/sysdeps/i386/i486/bits/atomic.h @@ -326,15 +326,15 @@ typedef uintmax_t uatomic_max_t; (void) ({ if (sizeof (*mem) == 1) \ __asm __volatile (LOCK "orb %b2, %0" \ : "=m" (*mem) \ - : "m" (*mem), "i" (1 << (bit))); \ + : "m" (*mem), "ir" (1 << (bit))); \ else if (sizeof (*mem) == 2) \ __asm __volatile (LOCK "orw %w2, %0" \ : "=m" (*mem) \ - : "m" (*mem), "i" (1 << (bit))); \ + : "m" (*mem), "ir" (1 << (bit))); \ else if (sizeof (*mem) == 4) \ __asm __volatile (LOCK "orl %2, %0" \ : "=m" (*mem) \ - : "m" (*mem), "i" (1 << (bit))); \ + : "m" (*mem), "ir" (1 << (bit))); \ else \ abort (); \ }) @@ -345,15 +345,15 @@ typedef uintmax_t uatomic_max_t; if (sizeof (*mem) == 1) \ __asm __volatile (LOCK "btsb %3, %1; setc %0" \ : "=q" (__result), "=m" (*mem) \ - : "m" (*mem), "i" (bit)); \ + : "m" (*mem), "ir" (bit)); \ else if (sizeof (*mem) == 2) \ __asm __volatile (LOCK "btsw %3, %1; setc %0" \ : "=q" (__result), "=m" (*mem) \ - : "m" (*mem), "i" (bit)); \ + : "m" (*mem), "ir" (bit)); \ else if (sizeof (*mem) == 4) \ __asm __volatile (LOCK "btsl %3, %1; setc %0" \ : "=q" (__result), "=m" (*mem) \ - : "m" (*mem), "i" (bit)); \ + : "m" (*mem), "ir" (bit)); \ else \ abort (); \ __result; }) -- cgit v1.2.3