On Sat, May 21, 2016 at 09:51:36 +0200, Uros Bizjak wrote: > On Fri, May 20, 2016 at 8:01 PM, Ilya Verbin <iver...@gmail.com> wrote: > > In some cases the i387 version of a math function may be inlined from > > math.h, > > and the testcase (like gcc.target/i386/sse4_1-ceil-vec.c) will actually test > > inlined asm instead of vectorized builtin. To fix this I've created a new > > file > > gcc.dg/mathfunc.h (similar to gcc.dg/strlenopt.h) and changed vectorization > > tests so that they include it instead of math.h. > > Regtested on x86_64-linux and i686-linux. Is it OK for trunk? > > No, please just #define NO_MATH_INLINES before math.h is included. > This will solve unwanted inlining.
Thanks for the hint. I'll check-in this patch tomorrow. gcc/testsuite/ * gcc.target/i386/avx-ceil-sfix-2-vec.c: Define __NO_MATH_INLINES before math.h is included. * gcc.target/i386/avx-floor-sfix-2-vec.c: Likewise. * gcc.target/i386/avx-rint-sfix-2-vec.c: Likewise. * gcc.target/i386/avx-round-sfix-2-vec.c: Likewise. * gcc.target/i386/avx512f-ceil-sfix-vec-1.c: Likewise. * gcc.target/i386/avx512f-floor-sfix-vec-1.c: Likewise. * gcc.target/i386/sse4_1-ceil-sfix-vec.c: Likewise. * gcc.target/i386/sse4_1-ceil-vec.c: Likewise. * gcc.target/i386/sse4_1-ceilf-sfix-vec.c: Likewise. * gcc.target/i386/sse4_1-ceilf-vec.c: Likewise. * gcc.target/i386/sse4_1-floor-sfix-vec.c: Likewise. * gcc.target/i386/sse4_1-floor-vec.c: Likewise. * gcc.target/i386/sse4_1-rint-sfix-vec.c: Likewise. * gcc.target/i386/sse4_1-rint-vec.c: Likewise. * gcc.target/i386/sse4_1-rintf-sfix-vec.c: Likewise. * gcc.target/i386/sse4_1-rintf-vec.c: Likewise. * gcc.target/i386/sse4_1-round-sfix-vec.c: Likewise. * gcc.target/i386/sse4_1-round-vec.c: Likewise. * gcc.target/i386/sse4_1-roundf-sfix-vec.c: Likewise. * gcc.target/i386/sse4_1-roundf-vec.c: Likewise. * gcc.target/i386/sse4_1-trunc-vec.c: Likewise. * gcc.target/i386/sse4_1-truncf-vec.c: Likewise. * gcc.target/i386/sse4_1-floorf-sfix-vec.c: Likewise. * gcc.target/i386/sse4_1-floorf-vec.c: Likewise. diff --git a/gcc/testsuite/gcc.target/i386/avx-ceil-sfix-2-vec.c b/gcc/testsuite/gcc.target/i386/avx-ceil-sfix-2-vec.c index bf48b80..45b7af7 100644 --- a/gcc/testsuite/gcc.target/i386/avx-ceil-sfix-2-vec.c +++ b/gcc/testsuite/gcc.target/i386/avx-ceil-sfix-2-vec.c @@ -13,6 +13,7 @@ #include CHECK_H +#define __NO_MATH_INLINES #include <math.h> extern double ceil (double); diff --git a/gcc/testsuite/gcc.target/i386/avx-floor-sfix-2-vec.c b/gcc/testsuite/gcc.target/i386/avx-floor-sfix-2-vec.c index 275199c..0a28c76 100644 --- a/gcc/testsuite/gcc.target/i386/avx-floor-sfix-2-vec.c +++ b/gcc/testsuite/gcc.target/i386/avx-floor-sfix-2-vec.c @@ -13,6 +13,7 @@ #include CHECK_H +#define __NO_MATH_INLINES #include <math.h> extern double floor (double); diff --git a/gcc/testsuite/gcc.target/i386/avx-rint-sfix-2-vec.c b/gcc/testsuite/gcc.target/i386/avx-rint-sfix-2-vec.c index 9f273af..e6c47b8 100644 --- a/gcc/testsuite/gcc.target/i386/avx-rint-sfix-2-vec.c +++ b/gcc/testsuite/gcc.target/i386/avx-rint-sfix-2-vec.c @@ -13,6 +13,7 @@ #include CHECK_H +#define __NO_MATH_INLINES #include <math.h> extern double rint (double); diff --git a/gcc/testsuite/gcc.target/i386/avx-round-sfix-2-vec.c b/gcc/testsuite/gcc.target/i386/avx-round-sfix-2-vec.c index ddb46d9..dc0a7db 100644 --- a/gcc/testsuite/gcc.target/i386/avx-round-sfix-2-vec.c +++ b/gcc/testsuite/gcc.target/i386/avx-round-sfix-2-vec.c @@ -13,6 +13,7 @@ #include CHECK_H +#define __NO_MATH_INLINES #include <math.h> extern double round (double); diff --git a/gcc/testsuite/gcc.target/i386/avx512f-ceil-sfix-vec-1.c b/gcc/testsuite/gcc.target/i386/avx512f-ceil-sfix-vec-1.c index 038d25e..d7d6916 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-ceil-sfix-vec-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-ceil-sfix-vec-1.c @@ -3,6 +3,7 @@ /* { dg-require-effective-target avx512f } */ /* { dg-skip-if "no M_PI" { vxworks_kernel } } */ +#define __NO_MATH_INLINES #include <math.h> #include "avx512f-check.h" diff --git a/gcc/testsuite/gcc.target/i386/avx512f-floor-sfix-vec-1.c b/gcc/testsuite/gcc.target/i386/avx512f-floor-sfix-vec-1.c index fab7e65..b46ea9f 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-floor-sfix-vec-1.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-floor-sfix-vec-1.c @@ -3,6 +3,7 @@ /* { dg-require-effective-target avx512f } */ /* { dg-skip-if "no M_PI" { vxworks_kernel } } */ +#define __NO_MATH_INLINES #include <math.h> #include "avx512f-check.h" diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-ceil-sfix-vec.c b/gcc/testsuite/gcc.target/i386/sse4_1-ceil-sfix-vec.c index ca07d9c..bb32c8d 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-ceil-sfix-vec.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-ceil-sfix-vec.c @@ -13,6 +13,7 @@ #include CHECK_H +#define __NO_MATH_INLINES #include <math.h> extern double ceil (double); diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-ceil-vec.c b/gcc/testsuite/gcc.target/i386/sse4_1-ceil-vec.c index 20bb264..4193aaa 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-ceil-vec.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-ceil-vec.c @@ -13,6 +13,7 @@ #include CHECK_H +#define __NO_MATH_INLINES #include <math.h> extern double ceil (double); diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-ceilf-sfix-vec.c b/gcc/testsuite/gcc.target/i386/sse4_1-ceilf-sfix-vec.c index b0559bf..971ccb8 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-ceilf-sfix-vec.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-ceilf-sfix-vec.c @@ -13,6 +13,7 @@ #include CHECK_H +#define __NO_MATH_INLINES #include <math.h> extern float ceilf (float); diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-ceilf-vec.c b/gcc/testsuite/gcc.target/i386/sse4_1-ceilf-vec.c index 314be91..e2ebafc 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-ceilf-vec.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-ceilf-vec.c @@ -13,6 +13,7 @@ #include CHECK_H +#define __NO_MATH_INLINES #include <math.h> extern float ceilf (float); diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-floor-sfix-vec.c b/gcc/testsuite/gcc.target/i386/sse4_1-floor-sfix-vec.c index 2083a60..15db225 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-floor-sfix-vec.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-floor-sfix-vec.c @@ -13,6 +13,7 @@ #include CHECK_H +#define __NO_MATH_INLINES #include <math.h> extern double floor (double); diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-floor-vec.c b/gcc/testsuite/gcc.target/i386/sse4_1-floor-vec.c index d250413..a33f7d9 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-floor-vec.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-floor-vec.c @@ -13,6 +13,7 @@ #include CHECK_H +#define __NO_MATH_INLINES #include <math.h> extern double floor (double); diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-floorf-sfix-vec.c b/gcc/testsuite/gcc.target/i386/sse4_1-floorf-sfix-vec.c index 7e18b46..bf05af3 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-floorf-sfix-vec.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-floorf-sfix-vec.c @@ -13,6 +13,7 @@ #include CHECK_H +#define __NO_MATH_INLINES #include <math.h> #define NUM 64 diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-floorf-vec.c b/gcc/testsuite/gcc.target/i386/sse4_1-floorf-vec.c index 019ef89..13630fb 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-floorf-vec.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-floorf-vec.c @@ -13,6 +13,7 @@ #include CHECK_H +#define __NO_MATH_INLINES #include <math.h> #define NUM 64 diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-rint-sfix-vec.c b/gcc/testsuite/gcc.target/i386/sse4_1-rint-sfix-vec.c index d9c2fbf..6111933 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-rint-sfix-vec.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-rint-sfix-vec.c @@ -13,6 +13,7 @@ #include CHECK_H +#define __NO_MATH_INLINES #include <math.h> extern double rint (double); diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-rint-vec.c b/gcc/testsuite/gcc.target/i386/sse4_1-rint-vec.c index f20359a..88965a5 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-rint-vec.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-rint-vec.c @@ -13,6 +13,7 @@ #include CHECK_H +#define __NO_MATH_INLINES #include <math.h> extern double rint (double); diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-rintf-sfix-vec.c b/gcc/testsuite/gcc.target/i386/sse4_1-rintf-sfix-vec.c index 1d25f76..12d3dbe 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-rintf-sfix-vec.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-rintf-sfix-vec.c @@ -13,6 +13,7 @@ #include CHECK_H +#define __NO_MATH_INLINES #include <math.h> extern float rintf (float); diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-rintf-vec.c b/gcc/testsuite/gcc.target/i386/sse4_1-rintf-vec.c index 716cad1..362832d 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-rintf-vec.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-rintf-vec.c @@ -13,6 +13,7 @@ #include CHECK_H +#define __NO_MATH_INLINES #include <math.h> extern float rintf (float); diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-round-sfix-vec.c b/gcc/testsuite/gcc.target/i386/sse4_1-round-sfix-vec.c index 9abbe55..c54acee 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-round-sfix-vec.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-round-sfix-vec.c @@ -13,6 +13,7 @@ #include CHECK_H +#define __NO_MATH_INLINES #include <math.h> extern double round (double); diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-round-vec.c b/gcc/testsuite/gcc.target/i386/sse4_1-round-vec.c index bb912cef..83aeb64 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-round-vec.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-round-vec.c @@ -13,6 +13,7 @@ #include CHECK_H +#define __NO_MATH_INLINES #include <math.h> extern double round (double); diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-roundf-sfix-vec.c b/gcc/testsuite/gcc.target/i386/sse4_1-roundf-sfix-vec.c index 5384e5c..cd11071 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-roundf-sfix-vec.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-roundf-sfix-vec.c @@ -13,6 +13,7 @@ #include CHECK_H +#define __NO_MATH_INLINES #include <math.h> extern float roundf (float); diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-roundf-vec.c b/gcc/testsuite/gcc.target/i386/sse4_1-roundf-vec.c index d254aa6..b55e5df 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-roundf-vec.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-roundf-vec.c @@ -13,6 +13,7 @@ #include CHECK_H +#define __NO_MATH_INLINES #include <math.h> extern float roundf (float); diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-trunc-vec.c b/gcc/testsuite/gcc.target/i386/sse4_1-trunc-vec.c index 9cbcd9b..5c27083 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-trunc-vec.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-trunc-vec.c @@ -13,6 +13,7 @@ #include CHECK_H +#define __NO_MATH_INLINES #include <math.h> extern double trunc (double); diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-truncf-vec.c b/gcc/testsuite/gcc.target/i386/sse4_1-truncf-vec.c index 815b508..e491fee 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-truncf-vec.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-truncf-vec.c @@ -13,6 +13,7 @@ #include CHECK_H +#define __NO_MATH_INLINES #include <math.h> extern float truncf (float); -- Ilya