re PR target/79963 (vec_eq_any extracts wrong CR bit when compiling with -mcpu=power9)
authorKelvin Nilsen <kelvin@gcc.gnu.org>
Mon, 20 Mar 2017 18:05:00 +0000 (18:05 +0000)
committerKelvin Nilsen <kelvin@gcc.gnu.org>
Mon, 20 Mar 2017 18:05:00 +0000 (18:05 +0000)
gcc/testsuite/ChangeLog:

2017-03-20  Kelvin Nilsen  <kelvin@gcc.gnu.org>

PR target/79963
* gcc.target/powerpc/vsu/vec-any-eq-10.c: Add scan-assembler
directive to assure selection of proper bit using rlwinm insn.
* gcc.target/powerpc/vsu/vec-any-eq-14.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eq-7.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eq-8.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eq-9.c: Likewise.

gcc/ChangeLog:

2017-03-20  Kelvin Nilsen  <kelvin@gcc.gnu.org>

PR target/79963
* config/rs6000/altivec.h (vec_all_ne): Under __cplusplus__ and
__POWER9_VECTOR__ #ifdef control, change template definition to
use Power9-specific built-in function.
(vec_any_eq): Likewise.
* config/rs6000/vector.md (vector_ae_v2di_p): Change the flag used
to control outcomes from this test.
(vector_ae_<mode>p): For VEC_F modes, likewise.

From-SVN: r246287

gcc/ChangeLog
gcc/config/rs6000/altivec.h
gcc/config/rs6000/vector.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/vsu/vec-any-eq-10.c
gcc/testsuite/gcc.target/powerpc/vsu/vec-any-eq-14.c
gcc/testsuite/gcc.target/powerpc/vsu/vec-any-eq-7.c
gcc/testsuite/gcc.target/powerpc/vsu/vec-any-eq-8.c
gcc/testsuite/gcc.target/powerpc/vsu/vec-any-eq-9.c

index 1385d92bcdf2535fd66422c13710391bf42d171a..77952ffea1c51b524d7eef1237688292453fc5ad 100644 (file)
@@ -1,3 +1,14 @@
+2017-03-20  Kelvin Nilsen  <kelvin@gcc.gnu.org>
+
+       PR target/79963
+       * config/rs6000/altivec.h (vec_all_ne): Under __cplusplus__ and
+       __POWER9_VECTOR__ #ifdef control, change template definition to
+       use Power9-specific built-in function.
+       (vec_any_eq): Likewise.
+       * config/rs6000/vector.md (vector_ae_v2di_p): Change the flag used
+       to control outcomes from this test.
+       (vector_ae_<mode>p): For VEC_F modes, likewise.
+
 2017-03-20  Ian Lance Taylor  <iant@google.com>
 
        * config/i386/i386.c (ix86_function_regparm): Save an extra
index cd4b724bc5248bfd3eb2684112020f2caca750aa..b9de05a72f0c5ede05ee87dbd46876ec6fb47701 100644 (file)
@@ -521,9 +521,9 @@ __altivec_scalar_pred(vec_all_nez,
 __altivec_scalar_pred(vec_any_eqz,
   __builtin_vec_vcmpnez_p (__CR6_LT_REV, a1, a2))
 __altivec_scalar_pred(vec_all_ne,
-  __builtin_vec_allne_p (a1, a2))
+  __builtin_vec_vcmpne_p (a1, a2))
 __altivec_scalar_pred(vec_any_eq,
-  __builtin_vec_anyeq_p (a1, a2))
+  __builtin_vec_vcmpae_p (a1, a2))
 #endif
 
 __altivec_scalar_pred(vec_any_ne,
index fefe5db6aae101d41d380b085e87015ec82be505..e6489a861cdd4ba51290bfc720df79e1f930a0cd 100644 (file)
          (eq:V2DI (match_dup 1)
                   (match_dup 2)))])
    (set (match_operand:SI 0 "register_operand" "=r")
-       (lt:SI (reg:CC CR6_REGNO)
+       (eq:SI (reg:CC CR6_REGNO)
               (const_int 0)))
    (set (match_dup 0)
        (xor:SI (match_dup 0)
          (eq:VEC_F (match_dup 1)
                    (match_dup 2)))])
    (set (match_operand:SI 0 "register_operand" "=r")
-       (lt:SI (reg:CC CR6_REGNO)
+       (eq:SI (reg:CC CR6_REGNO)
               (const_int 0)))
    (set (match_dup 0)
        (xor:SI (match_dup 0)
index abfaa5c2955b08db402f2eedae9698d1db6d375c..2b6d7c6286c15a8876eab30569f7960dd2245405 100644 (file)
@@ -1,3 +1,13 @@
+2017-03-20  Kelvin Nilsen  <kelvin@gcc.gnu.org>
+
+       PR target/79963
+       * gcc.target/powerpc/vsu/vec-any-eq-10.c: Add scan-assembler
+       directive to assure selection of proper bit using rlwinm insn.
+       * gcc.target/powerpc/vsu/vec-any-eq-14.c: Likewise.
+       * gcc.target/powerpc/vsu/vec-any-eq-7.c: Likewise.
+       * gcc.target/powerpc/vsu/vec-any-eq-8.c: Likewise.
+       * gcc.target/powerpc/vsu/vec-any-eq-9.c: Likewise.
+
 2017-03-20  Marek Polacek  <polacek@redhat.com>
            Paolo Carlini  <paolo.carlini@oracle.com>
 
index 7a3660e25fc4562d1409c55bf6e35969674446cf..4e6ca9a694a8ae091151d5de12aa023b9bd3c08c 100644 (file)
@@ -16,3 +16,4 @@ test_any_equal (vector unsigned long long *arg1_p,
 }
 
 /* { dg-final { scan-assembler "vcmpequd." } } */
+/* { dg-final { scan-assembler "rlwinm r?\[0-9\]+,r?\[0-9\]+,27,1" } } */
index 658b4dffa8398ea4f58059fd4b912cf26d98232c..2f319bcf2ecfb25481902d21c35cc5836f202403 100644 (file)
@@ -15,3 +15,4 @@ test_any_equal (vector bool long long *arg1_p, vector bool long long *arg2_p)
 }
 
 /* { dg-final { scan-assembler "vcmpequd." } } */
+/* { dg-final { scan-assembler "rlwinm r?\[0-9\]+,r?\[0-9\]+,27,1" } } */
index 5cd9e36f3bb4952349fdfcade27e3712683da5e4..3693aeafedeea9fe7e770a8f0b3df23b0306896a 100644 (file)
@@ -15,3 +15,4 @@ test_any_equal (vector float *arg1_p, vector float *arg2_p)
 }
 
 /* { dg-final { scan-assembler "xvcmpeqsp." } } */
+/* { dg-final { scan-assembler "rlwinm r?\[0-9\]+,r?\[0-9\]+,27,1" } } */
index 038753ff069ab257a5ef0a84b33382ec7cfeeb2e..9443c75024f6c2afdb4effb12e93b4d555200af1 100644 (file)
@@ -15,3 +15,4 @@ test_any_equal (vector double *arg1_p, vector double *arg2_p)
 }
 
 /* { dg-final { scan-assembler "xvcmpeqdp." } } */
+/* { dg-final { scan-assembler "rlwinm r?\[0-9\]+,r?\[0-9\]+,27,1" } } */
index e8c058d6f32793590159e7a7d7cf5dc3382fb3e7..8011a925321b3a9f097314d1e22a963e27c57e93 100644 (file)
@@ -15,3 +15,4 @@ test_any_equal (vector long long *arg1_p, vector long long *arg2_p)
 }
 
 /* { dg-final { scan-assembler "vcmpequd." } } */
+/* { dg-final { scan-assembler "rlwinm r?\[0-9\]+,r?\[0-9\]+,27,1" } } */