diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-08-21 14:50:56 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-08-21 14:50:56 +0000 |
commit | 2be65d9e98a1335e0d948c2de59946e715afcbe5 (patch) | |
tree | a5f3b1eb5eba6d6c7a010dd6ece0a25d1e89b38a /gcc/tree-vect-patterns.c | |
parent | e83fe013941bf8b3129a8ceb19e14ea7d8c51aa2 (diff) | |
download | gcc-2be65d9e98a1335e0d948c2de59946e715afcbe5.zip gcc-2be65d9e98a1335e0d948c2de59946e715afcbe5.tar.gz gcc-2be65d9e98a1335e0d948c2de59946e715afcbe5.tar.bz2 |
Add a type_has_mode_precision_p helper function
...to replace instances of:
TYPE_PRECISION (t) == GET_MODE_PRECISION (TYPE_MODE (t))
These conditions would need to be rewritten with variable-sized
modes anyway.
2017-08-21 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
* tree.h (type_has_mode_precision_p): New function.
* convert.c (convert_to_integer_1): Use it.
* expr.c (expand_expr_real_2): Likewise.
(expand_expr_real_1): Likewise.
* fold-const.c (fold_single_bit_test_into_sign_test): Likewise.
* match.pd: Likewise.
* tree-ssa-forwprop.c (simplify_rotate): Likewise.
* tree-ssa-math-opts.c (convert_mult_to_fma): Likewise.
* tree-tailcall.c (process_assignment): Likewise.
* tree-vect-loop.c (vectorizable_reduction): Likewise.
* tree-vect-patterns.c (vect_recog_vector_vector_shift_pattern)
(vect_recog_mult_pattern, vect_recog_divmod_pattern): Likewise.
* tree-vect-stmts.c (vectorizable_conversion): Likewise.
(vectorizable_assignment): Likewise.
(vectorizable_shift): Likewise.
(vectorizable_operation): Likewise.
* tree-vrp.c (register_edge_assert_for_2): Likewise.
From-SVN: r251231
Diffstat (limited to 'gcc/tree-vect-patterns.c')
-rw-r--r-- | gcc/tree-vect-patterns.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index 17d1083..877711a 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -2067,8 +2067,7 @@ vect_recog_vector_vector_shift_pattern (vec<gimple *> *stmts, if (TREE_CODE (oprnd0) != SSA_NAME || TREE_CODE (oprnd1) != SSA_NAME || TYPE_MODE (TREE_TYPE (oprnd0)) == TYPE_MODE (TREE_TYPE (oprnd1)) - || TYPE_PRECISION (TREE_TYPE (oprnd1)) - != GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (oprnd1))) + || !type_has_mode_precision_p (TREE_TYPE (oprnd1)) || TYPE_PRECISION (TREE_TYPE (lhs)) != TYPE_PRECISION (TREE_TYPE (oprnd0))) return NULL; @@ -2470,7 +2469,7 @@ vect_recog_mult_pattern (vec<gimple *> *stmts, if (TREE_CODE (oprnd0) != SSA_NAME || TREE_CODE (oprnd1) != INTEGER_CST || !INTEGRAL_TYPE_P (itype) - || TYPE_PRECISION (itype) != GET_MODE_PRECISION (TYPE_MODE (itype))) + || !type_has_mode_precision_p (itype)) return NULL; vectype = get_vectype_for_scalar_type (itype); @@ -2585,7 +2584,7 @@ vect_recog_divmod_pattern (vec<gimple *> *stmts, if (TREE_CODE (oprnd0) != SSA_NAME || TREE_CODE (oprnd1) != INTEGER_CST || TREE_CODE (itype) != INTEGER_TYPE - || TYPE_PRECISION (itype) != GET_MODE_PRECISION (TYPE_MODE (itype))) + || !type_has_mode_precision_p (itype)) return NULL; vectype = get_vectype_for_scalar_type (itype); |