x86: fix btX functions

C casts to unsigned int by default, so we were experiencing some negative
undefined behavior in the 1 << 31 case. x86 now works; bts and btc are
both passing.
ck_pring
Devon H. O'Dell 14 years ago
parent 0c8c054c0a
commit ccf002223c

@ -303,7 +303,7 @@ CK_PR_BIN_S(or, 8, uint8_t, |)
punt = ck_pr_load_##S(target); \ punt = ck_pr_load_##S(target); \
previous = (T)punt; \ previous = (T)punt; \
while (ck_pr_cas_##S##_value(target, (C)previous, \ while (ck_pr_cas_##S##_value(target, (C)previous, \
(C)(previous P (R (1 << offset))), &previous) == false) \ (C)(previous P (R ((T)1 << offset))), &previous) == false) \
ck_pr_stall(); \ ck_pr_stall(); \
return ((previous >> offset) & 1); \ return ((previous >> offset) & 1); \
} }

Loading…
Cancel
Save