[PowerPC] Fix ISA_206 subword atomics

The POWER7 subword atomics were not using the correct instructions for
byte and halfword stores in the atomic_fcmpset code.

This only affects builds with custom CFLAGS that have explicitly enabled
ISA_206_ATOMICS.
This commit is contained in:
Justin Hibbits 2020-12-08 10:18:44 -06:00 committed by Brandon Bergren
parent 8dc8feb53d
commit 895a22583d

View File

@ -777,7 +777,7 @@ atomic_fcmpset_char(volatile u_char *p, u_char *cmpval, u_char newval)
"b 2f\n\t" /* we've succeeded */
"1:\n\t"
"stbcx. %0, 0, %3\n\t" /* clear reservation (74xx) */
"stwx %0, 0, %7\n\t"
"stbx %0, 0, %7\n\t"
"li %0, 0\n\t" /* failure - retval = 0 */
"2:\n\t"
: "=&r" (ret), "=m" (*p), "=m" (*cmpval)
@ -802,7 +802,7 @@ atomic_fcmpset_short(volatile u_short *p, u_short *cmpval, u_short newval)
"b 2f\n\t" /* we've succeeded */
"1:\n\t"
"sthcx. %0, 0, %3\n\t" /* clear reservation (74xx) */
"stwx %0, 0, %7\n\t"
"sthx %0, 0, %7\n\t"
"li %0, 0\n\t" /* failure - retval = 0 */
"2:\n\t"
: "=&r" (ret), "=m" (*p), "=m" (*cmpval)