Recent versions of the Solaris/x86 assembler do support AVX512F, but
there are a couple of bugs: it chokes on

        vaddsd  {rn-sae}, %xmm2, %xmm0, %xmm0
        vaddsd  {rn-sae}, %xmm0, %xmm1, %xmm5{%k1}
        vaddsd  {rn-sae}, %xmm2, %xmm0, %xmm0{%k1}{z}

and similar for vaddss, vdivs[ds], vmuls[ds], vsubs[ds]; also on

        vgetmantsd      $2, {sae}, %xmm1, %xmm0, %xmm3
        vgetmantss      $2, {sae}, %xmm1, %xmm0, %xmm3

Since this creates quite a bit of testsuite noise, I extended the
avx512f effective-target check to also test for those.  Doing so, I
noticed that the check_effective_target_avx512f proc is duplicated in
gcc.target/i386/i386.exp.  For the moment I changed both, but they
should be consolidated in one place to avoid confusion.

Bootstrapped without regressions on i386-pc-solaris2.11 and
x86_64-pc-linux-gnu.  Ok for mainline and the gcc-6 and gcc-7 branches
after a soak time?

        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2017-09-28  Rainer Orth  <r...@cebitec.uni-bielefeld.de>

        * lib/target-supports.exp (check_effective_target_avx512f): Also
        check for __builtin_ia32_addsd_round,
        __builtin_ia32_getmantsd_round.
        * gcc.target/i386/i386.exp (check_effective_target_avx512f):
        Likewise.

# HG changeset patch
# Parent  d01cdb0ecacbbf61de4cd12700ceb5a4eec05345
Guard against incomplete AVX512F support in Solaris as

diff --git a/gcc/testsuite/gcc.target/i386/i386.exp b/gcc/testsuite/gcc.target/i386/i386.exp
--- a/gcc/testsuite/gcc.target/i386/i386.exp
+++ b/gcc/testsuite/gcc.target/i386/i386.exp
@@ -250,6 +250,17 @@ proc check_effective_target_avx512f { } 
 	{
             return __builtin_ia32_pandq512_mask (__X, __Y, __X, -1);
 	}
+
+	typedef double __m128d __attribute__ ((__vector_size__ (16)));
+	__m128d _mm128_add (__m128d a)
+	{
+	  return __builtin_ia32_addsd_round (a, a, 8);
+	}
+
+	__m128d _mm128_getmant (__m128d a)
+	{
+	  return __builtin_ia32_getmantsd_round (a, a, 0, 8);
+	}
     } "-mavx512f" ]
 }
 
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -7590,11 +7590,22 @@ proc check_prefer_avx128 { } {
 proc check_effective_target_avx512f { } {
     return [check_no_compiler_messages avx512f object {
 	typedef double __m512d __attribute__ ((__vector_size__ (64)));
+	typedef double __m128d __attribute__ ((__vector_size__ (16)));
 
 	__m512d _mm512_add (__m512d a)
 	{
 	  return __builtin_ia32_addpd512_mask (a, a, a, 1, 4);
 	}
+
+	__m128d _mm128_add (__m128d a)
+	{
+	  return __builtin_ia32_addsd_round (a, a, 8);
+	}
+
+	__m128d _mm128_getmant (__m128d a)
+	{
+	  return __builtin_ia32_getmantsd_round (a, a, 0, 8);
+	}
     } "-O2 -mavx512f" ]
 }
 

Reply via email to