1 /* { dg-do run { target { powerpc*-*-* && lp64 } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-options "-mdejagnu-cpu=power8 -O3" } */
7 typedef unsigned U_16
__attribute__((mode(TI
)));
9 extern int libat_compare_exchange_16 (U_16
*, U_16
*, U_16
, int, int)
10 __attribute__((__noinline__
));
12 /* PR 57744: lqarx/stqcx needs even/odd register pairs. The assembler will
13 complain if the compiler gets an odd/even register pair. Create a function
14 which has the 16 byte compare and exchange instructions, but don't actually
15 execute it, so that we can detect these failures on older machines. */
18 libat_compare_exchange_16 (U_16
*mptr
, U_16
*eptr
, U_16 newval
,
19 int smodel
, int fmodel
__attribute__((unused
)))
22 return __atomic_compare_exchange_n (mptr
, eptr
, newval
, 0, 0, 0);
23 else if (((smodel
) != 5))
24 return __atomic_compare_exchange_n (mptr
, eptr
, newval
, 0, 4, 0);
26 return __atomic_compare_exchange_n (mptr
, eptr
, newval
, 0, 5, 0);
29 U_16 a
= 1, b
= 1, c
= -2;
30 volatile int do_test
= 0;
34 if (do_test
&& !libat_compare_exchange_16 (&a
, &b
, c
, 0, 0))