From ae3f633bae373644db1ecd18f88c2446274949e2 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Fri, 17 May 2002 05:45:39 +0000 Subject: - Apparently, the Alpha ABI mandates that arguments be passed sign-extended regardless of if they are signed or unsigned since it is easier to work with sign-extended values. Thus, remove the disabled zapnot to zero-extend the sign-extended value we read from *p in atomic_cmpset_32() since the cmpval we are comparing against should already be sign-extended. - To ensure that the compiler knows to sign-extend the upper 32 bits of cmpval rather than leaving garbage in there, cast the appropriately in the constraints section. Help from: Richard Henderson --- sys/alpha/include/atomic.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'sys/alpha/include') diff --git a/sys/alpha/include/atomic.h b/sys/alpha/include/atomic.h index f5dd718d8661..af9c39714091 100644 --- a/sys/alpha/include/atomic.h +++ b/sys/alpha/include/atomic.h @@ -356,9 +356,6 @@ atomic_cmpset_32(volatile u_int32_t* p, u_int32_t cmpval, u_int32_t newval) __asm __volatile ( "1:\tldl_l %0, %4\n\t" /* load old value */ -#ifdef notyet - "zapnot %0,0xf,%0\n\t" /* Chop of signed bits */ -#endif "cmpeq %0, %2, %0\n\t" /* compare */ "beq %0, 2f\n\t" /* exit if not equal */ "mov %3, %0\n\t" /* value to store */ @@ -370,7 +367,7 @@ atomic_cmpset_32(volatile u_int32_t* p, u_int32_t cmpval, u_int32_t newval) "3:\tbr 1b\n" /* try again */ ".previous\n" : "=&r" (ret), "=m" (*p) - : "r" (cmpval), "r" (newval), "m" (*p) + : "r" ((long)(int)cmpval), "r" (newval), "m" (*p) : "memory"); return ret; -- cgit v1.3