On 2017-10-25 8:22 PM, Christoph Biedl wrote:
After staring at lws_compare_and_swap_2 a long time it seems there are
two issues: First, there is more usage of ",ma" so an update of mem/r26
hits the wrong place.
The other uses of ",ma" are not a problem as the increment value is 0.
So, the pointer
is unchanged. The double word case had an increment of 4 messing up the
pointer.
Technically, ",ma" with a zero increment provides an ordered load.
However, the completer
probably isn't necessary as I believe all loads and stores are ordered
on real hardware.
The "=" completer in the "sub" instructions looks correct to me. When
*mem and old are
equal, the "b,n cas2_end" instruction is nullified and new is stored
in mem. See comment
from code:
/*
prev = *addr;
if ( prev == old )
*addr = new;
return prev;
*/
In your first test example, old and new should be exchanged in mem. Pass
should be
mem == new. Second case should be mem == old.
Dave
--
John David Anglin dave.anglin@xxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html