Re: [PATCH 4/5] New target check for double<->int conversions

2017-10-02 Thread Jeff Law
On 09/28/2017 05:50 AM, Andreas Krebbel wrote:
> gcc/ChangeLog:
> 
> 2017-09-28  Andreas Krebbel  
> 
>   * doc/sourcebuild.texi: Document vect_intdouble_cvt and
>   vect_doubleint_cvt.
> 
> gcc/testsuite/ChangeLog:
> 
> 2017-09-28  Andreas Krebbel  
> 
>   * gcc.dg/vect/pr66251.c: Replace vect_floatint_cvt with
>   vect_doubleint_cvt and vect_intfloat_cvt with vect_intdouble_cvt.
>   * gcc.dg/vect/vect-floatint-conversion-2.c: Replace
>   vect_floatint_cvt with vect_doubleint_cvt.
>   * gcc.dg/vect/vect-intfloat-conversion-3.c: Replace
>   vect_intfloat_cvt with vect_intdouble_cvt.
>   * gfortran.dg/vect/pr60510.f: Require vect_intdouble_cvt.
>   * gfortran.dg/vect/vect-8.f90: Make number of vectorized loops
>   depend on vect_intdouble_cvt.
>   * lib/target-supports.exp
>   (check_effective_target_vect_doubleint_cvt)
>   (check_effective_target_vect_intdouble_cvt): New procs.
OK.
jeff


[PATCH 4/5] New target check for double<->int conversions

2017-09-28 Thread Andreas Krebbel
gcc/ChangeLog:

2017-09-28  Andreas Krebbel  

* doc/sourcebuild.texi: Document vect_intdouble_cvt and
vect_doubleint_cvt.

gcc/testsuite/ChangeLog:

2017-09-28  Andreas Krebbel  

* gcc.dg/vect/pr66251.c: Replace vect_floatint_cvt with
vect_doubleint_cvt and vect_intfloat_cvt with vect_intdouble_cvt.
* gcc.dg/vect/vect-floatint-conversion-2.c: Replace
vect_floatint_cvt with vect_doubleint_cvt.
* gcc.dg/vect/vect-intfloat-conversion-3.c: Replace
vect_intfloat_cvt with vect_intdouble_cvt.
* gfortran.dg/vect/pr60510.f: Require vect_intdouble_cvt.
* gfortran.dg/vect/vect-8.f90: Make number of vectorized loops
depend on vect_intdouble_cvt.
* lib/target-supports.exp
(check_effective_target_vect_doubleint_cvt)
(check_effective_target_vect_intdouble_cvt): New procs.
---
 gcc/doc/sourcebuild.texi   |  6 +++
 gcc/testsuite/gcc.dg/vect/pr66251.c|  4 +-
 .../gcc.dg/vect/vect-floatint-conversion-2.c   |  2 +-
 .../gcc.dg/vect/vect-intfloat-conversion-3.c   |  2 +-
 gcc/testsuite/gfortran.dg/vect/pr60510.f   |  1 +
 gcc/testsuite/gfortran.dg/vect/vect-8.f90  |  3 +-
 gcc/testsuite/lib/target-supports.exp  | 62 ++
 7 files changed, 75 insertions(+), 5 deletions(-)

diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 4f25268..e09bca1 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -1508,6 +1508,12 @@ Target supports conversion from @code{float} to 
@code{signed int}.
 @item vect_floatuint_cvt
 Target supports conversion from @code{float} to @code{unsigned int}.
 
+@item vect_intdouble_cvt
+Target supports conversion from @code{signed int} to @code{double}.
+
+@item vect_doubleint_cvt
+Target supports conversion from @code{double} to @code{signed int}.
+
 @item vect_max_reduc
 Target supports max reduction for vectors.
 @end table
diff --git a/gcc/testsuite/gcc.dg/vect/pr66251.c 
b/gcc/testsuite/gcc.dg/vect/pr66251.c
index 7f0c4bc..26afbc9 100644
--- a/gcc/testsuite/gcc.dg/vect/pr66251.c
+++ b/gcc/testsuite/gcc.dg/vect/pr66251.c
@@ -1,7 +1,7 @@
 /* { dg-require-effective-target vect_int } */
 /* { dg-require-effective-target vect_double } */
-/* { dg-require-effective-target vect_floatint_cvt } */
-/* { dg-require-effective-target vect_intfloat_cvt } */
+/* { dg-require-effective-target vect_doubleint_cvt } */
+/* { dg-require-effective-target vect_intdouble_cvt } */
 /* { dg-require-effective-target vect_pack_trunc } */
 /* { dg-require-effective-target vect_unpack } */
 /* { dg-require-effective-target vect_hw_misalign } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-2.c 
b/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-2.c
index 27d248b..64fab38 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-2.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-2.c
@@ -36,4 +36,4 @@ main (void)
   return main1 ();
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target 
vect_floatint_cvt } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target 
vect_doubleint_cvt } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c 
b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c
index 6eb4fec..78fc3da 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c
@@ -35,4 +35,4 @@ int main (void)
   return main1 ();
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target 
vect_intfloat_cvt } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target 
vect_intdouble_cvt } } } */
diff --git a/gcc/testsuite/gfortran.dg/vect/pr60510.f 
b/gcc/testsuite/gfortran.dg/vect/pr60510.f
index 5e2c085..202c1be 100644
--- a/gcc/testsuite/gfortran.dg/vect/pr60510.f
+++ b/gcc/testsuite/gfortran.dg/vect/pr60510.f
@@ -1,5 +1,6 @@
 ! { dg-do run }
 ! { dg-require-effective-target vect_double }
+! { dg-require-effective-target vect_intdouble_cvt }
 ! { dg-additional-options "-fno-inline -ffast-math" }
   subroutine foo(a,x,y,n)
   implicit none
diff --git a/gcc/testsuite/gfortran.dg/vect/vect-8.f90 
b/gcc/testsuite/gfortran.dg/vect/vect-8.f90
index ec95598..8e18be5 100644
--- a/gcc/testsuite/gfortran.dg/vect/vect-8.f90
+++ b/gcc/testsuite/gfortran.dg/vect/vect-8.f90
@@ -704,4 +704,5 @@ CALL track('KERNEL  ')
 RETURN
 END SUBROUTINE kernel
 
-! { dg-final { scan-tree-dump-times "vectorized 21 loops" 1 "vect" } }
+! { dg-final { scan-tree-dump-times "vectorized 21 loops" 1 "vect" { target { 
vect_intdouble_cvt } } } }
+! { dg-final { scan-tree-dump-times "vectorized 17 loops" 1 "vect" { target { 
! vect_intdouble_cvt } } } }
diff --git a/gcc/testsuite/lib/target-supports.exp 
b/gcc/testsuite/lib/target-supports.exp