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