aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-11-22 21:48:38 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2017-11-22 21:48:38 +0100
commit217e4393f7540b4f32c4eafbe3ffeceeb063eb30 (patch)
tree264eddb370dec5ee4c22fdabee17192ddb563af4 /gcc
parenta97ae55991e4849f162a61bbf980009d549107e7 (diff)
downloadgcc-217e4393f7540b4f32c4eafbe3ffeceeb063eb30.zip
gcc-217e4393f7540b4f32c4eafbe3ffeceeb063eb30.tar.gz
gcc-217e4393f7540b4f32c4eafbe3ffeceeb063eb30.tar.bz2
simplify-rtx.c (simplify_binary_operation_1): Handle the case where both arguments are using gen_const_vec_series.
* 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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/simplify-rtx.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c9793ec..2bb7a54 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 36a2e37..806c309 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -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. */