1 /* { dg-do compile } */
2 /* { dg-require-effective-target powerpc_prefixed_addr } */
3 /* { dg-require-effective-target lp64 } */
4 /* { dg-options "-O2 -mdejagnu-cpu=power10" } */
6 /* Make sure that we don't generate a prefixed form of the load and store with
7 update instructions (i.e. instead of generating LWZU we have to generate
19 struct foo
*inc_load (struct foo
*p
, unsigned int *q
)
21 *q
= (++p
)->field
; /* PLWZ, PADDI, STW. */
25 struct foo
*dec_load (struct foo
*p
, unsigned int *q
)
27 *q
= (--p
)->field
; /* PLWZ, PADDI, STW. */
31 struct foo
*inc_store (struct foo
*p
, unsigned int *q
)
33 (++p
)->field
= *q
; /* LWZ, PADDI, PSTW. */
37 struct foo
*dec_store (struct foo
*p
, unsigned int *q
)
39 (--p
)->field
= *q
; /* LWZ, PADDI, PSTW. */
43 /* { dg-final { scan-assembler-times {\mlwz\M} 2 } } */
44 /* { dg-final { scan-assembler-times {\mstw\M} 2 } } */
45 /* { dg-final { scan-assembler-times {\mpaddi\M} 4 } } */
46 /* { dg-final { scan-assembler-times {\mplwz\M} 2 } } */
47 /* { dg-final { scan-assembler-times {\mpstw\M} 2 } } */
48 /* { dg-final { scan-assembler-not {\mplwzu\M} } } */
49 /* { dg-final { scan-assembler-not {\mpstwu\M} } } */
50 /* { dg-final { scan-assembler-not {\maddis\M} } } */
51 /* { dg-final { scan-assembler-not {\maddi\M} } } */