6 /* Simple test program, no race.
7 Tests the 'xadd' exchange-and-add instruction with {r,r} operands, which is rarely generated by compilers. */
10 #undef PLAT_amd64_linux
11 #undef PLAT_ppc32_linux
12 #undef PLAT_ppc64_linux
15 # define PLAT_x86_linux 1
16 #elif defined(__x86_64__)
17 # define PLAT_amd64_linux 1
21 #if defined(PLAT_amd64_linux) || defined(PLAT_x86_linux)
22 # define XADD_R_R(_addr,_lval) \
23 __asm__ __volatile__( \
25 : /*out*/ "=r"(_lval),"=r"(_addr) \
26 : /*in*/ "0"(_lval),"1"(_addr) \
30 # error "Unsupported architecture"
37 #define XADD_R_R_RES 42
41 assert(xadd_r_r_res
== XADD_R_R_RES
);
43 if (xadd_r_r_res
== XADD_R_R_RES
)