- 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 <rth@redhat.com>
This commit is contained in:
parent
cf45dcc8e6
commit
ae3f633bae
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user