On Mon, Aug 01, 2022 at 02:19:32PM +0800, Kewen.Lin wrote: > > new file mode 100644 > > index 00000000000..256e05d5677 > > --- /dev/null > > +++ b/gcc/testsuite/gcc.target/powerpc/pr103109.c > > @@ -0,0 +1,16 @@ > > +/* { dg-do compile { target { lp64 } } } */ > > Since the guard is TARGET_POWERPC64, should use has_arch_ppc64?
Yes, we should almost never have lp64 in testcases anymore, since now we have has_arch_ppc64. Previously we had only has_powerpc64, which is a very different thing unfortunately. > > +/* { dg-require-effective-target powerpc_p9modulo_ok } */ > > Need effective target int128 as well? Yes. This was hidden by the lp64 test, which skips on -m32 already :-) > > +/* { dg-options "-mdejagnu-cpu=power9 -O2" } */ > > +/* { dg-final { scan-assembler-times {\mmaddld\M} 2 } } */ > > +/* { dg-final { scan-assembler-times {\mmaddhd\M} 1 } } */ > > +/* { dg-final { scan-assembler-times {\mmaddhdu\M} 1 } } */ > > + > > +__int128 test (long a, long b, long c) > > +{ > > + return (__int128) a * (__int128) b + (__int128) c; > > +} > > + > > +unsigned __int128 testu (unsigned long a, unsigned long b, unsigned long c) > > +{ > > + return (unsigned __int128) a * (unsigned __int128) b + (unsigned > > __int128) c; > > +} (You only need to cast the first here always, the rest is promoted automatically). > Not sure there is some coverage for this kind of multiply-add (promoted first > then mul and add), if no, it seems better to add one runnable test case. Good point. We won't automatically see it from the compiler build itself for example, int128 isn't used there. Segher