On 6/8/18 11:21 AM, Segher Boessenkool wrote: > On Fri, Jun 08, 2018 at 10:35:22AM -0500, Peter Bergner wrote: >> +/* { dg-final { scan-assembler-times {\mstdu\M} 2 } } */ >> +/* { dg-final { scan-assembler-not {\mstfdu\M} } } */ > > Does this need p8 at all? Would it be better to just test without -mcpu=, > on just whatever default cpu is thrown at it? p8 is default for powerpc64le > so it will get plenty coverage. > > You do need an lp64 target btw.
I guess I was just following what was reported in the bugzilla, but you are correct, we don't need -mcpu=power8. How about the following? Peter Index: pr85755.c =================================================================== --- pr85755.c (nonexistent) +++ pr85755.c (working copy) @@ -0,0 +1,22 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-options "-O1" } */ + +void +preinc (long *q, long n) +{ + long i; + for (i = 0; i < n; i++) + q[i] = i; +} + +void +predec (long *q, long n) +{ + long i; + for (i = n; i >= 0; i--) + q[i] = i; +} + +/* { dg-final { scan-assembler-times {\mstwu\M} 2 { target ilp32 } } } */ +/* { dg-final { scan-assembler-times {\mstdu\M} 2 { target lp64 } } } */ +/* { dg-final { scan-assembler-not {\mstfdu\M} } } */