simplify-rtx.c (simplify_binary_operation_1): Handle the case where both arguments...
authorJakub Jelinek <jakub@redhat.com>
Wed, 22 Nov 2017 20:48:38 +0000 (21:48 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 22 Nov 2017 20:48:38 +0000 (21:48 +0100)
* simplify-rtx.c (simplify_binary_operation_1) <case VEC_SERIES>:
Handle the case where both arguments are using gen_const_vec_series.

From-SVN: r255079

gcc/ChangeLog
gcc/simplify-rtx.c

index c9793ece18d1e595632f3989cd737aa0ceefff39..2bb7a540f73718a7d6a09bff6f1631b23c2b8dbe 100644 (file)
@@ -1,3 +1,8 @@
+2017-11-22  Jakub Jelinek  <jakub@redhat.com>
+
+       * simplify-rtx.c (simplify_binary_operation_1) <case VEC_SERIES>:
+       Handle the case where both arguments are using gen_const_vec_series.
+
 2017-11-22  David Malcolm  <dmalcolm@redhat.com>
 
        PR c++/62170
index 36a2e3702937512dfcca6798e190eccfbad5e66a..806c3099923bc9acd00a55b24711293a1b9ec101 100644 (file)
@@ -3566,6 +3566,8 @@ simplify_binary_operation_1 (enum rtx_code code, machine_mode mode,
     case VEC_SERIES:
       if (op1 == CONST0_RTX (GET_MODE_INNER (mode)))
        return gen_vec_duplicate (mode, op0);
+      if (CONSTANT_P (op0) && CONSTANT_P (op1))
+       return gen_const_vec_series (mode, op0, op1);
       return 0;
 
     case VEC_SELECT:
@@ -6652,6 +6654,9 @@ test_vector_ops_series (machine_mode mode, rtx scalar_reg)
   ASSERT_RTX_EQ (series_r_1,
                 simplify_binary_operation (MINUS, mode, duplicate,
                                            series_0_m1));
+  ASSERT_RTX_EQ (series_0_m1,
+                simplify_binary_operation (VEC_SERIES, mode, const0_rtx,
+                                           constm1_rtx));
 }
 
 /* Verify some simplifications involving vectors.  */