On Thu, Mar 09, 2023 at 07:36:21PM +0000, Tamar Christina via Gcc-patches wrote: > PR target/108583 > * gcc.dg/mla_1.c: New test.
The testcase FAILs on all targets but AArch64 (maybe ARM is fine too). While f1/g1 are compilable on all targets and f3/g3 with -Wno-psabi in dg-options, f2/g2 are AArch64 specific. So, I think either the testcase should be moved to gcc.target/aarch64/ as whole, or you should split it, have gcc.dg/mla_1.c contain everything but f2/g2, drop vect_int requires and change dg-options to "-O2 -Wno-psabi", and then gcc.target/aarch64/mla_1.c which has the dg- directives as you currently have and #include "../../gcc.dg/mla_1.c" to get the functions + add f2/g2. > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/mla_1.c > @@ -0,0 +1,40 @@ > +/* { dg-do compile } */ > +/* { dg-require-effective-target vect_int } */ > +/* { dg-options "-O2 -msve-vector-bits=256 -march=armv8.2-a+sve > -fdump-tree-optimized" } */ > + > +unsigned int > +f1 (unsigned int a, unsigned int b, unsigned int c) { > + unsigned int d = a * b; > + return d + ((c + d) >> 1); > +} > + > +unsigned int > +g1 (unsigned int a, unsigned int b, unsigned int c) { > + return a * b + c; > +} > + > +__Uint32x4_t > +f2 (__Uint32x4_t a, __Uint32x4_t b, __Uint32x4_t c) { > + __Uint32x4_t d = a * b; > + return d + ((c + d) >> 1); > +} > + > +__Uint32x4_t > +g2 (__Uint32x4_t a, __Uint32x4_t b, __Uint32x4_t c) { > + return a * b + c; > +} > + > +typedef unsigned int vec __attribute__((vector_size(32))); vec > +f3 (vec a, vec b, vec c) > +{ > + vec d = a * b; > + return d + ((c + d) >> 1); > +} > + > +vec > +g3 (vec a, vec b, vec c) > +{ > + return a * b + c; > +} > + > +/* { dg-final { scan-tree-dump-times {\.FMA } 1 "optimized" { target > aarch64*-*-* } } } */ Jakub