diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-08-30 11:19:29 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-08-30 11:19:29 +0000 |
commit | b397965cae46d88d4c274fb2ecdde9a4714a4e6a (patch) | |
tree | dc2102813ae17dff7c73a78ce34cfb4b7c869d3f /gcc/tree-vect-patterns.c | |
parent | d21cefc26f716395b03e3c0d379ecac04656f963 (diff) | |
download | gcc-b397965cae46d88d4c274fb2ecdde9a4714a4e6a.zip gcc-b397965cae46d88d4c274fb2ecdde9a4714a4e6a.tar.gz gcc-b397965cae46d88d4c274fb2ecdde9a4714a4e6a.tar.bz2 |
[65/77] Add a SCALAR_TYPE_MODE macro
This patch adds a SCALAR_TYPE_MODE macro, along the same lines as
SCALAR_INT_TYPE_MODE and SCALAR_FLOAT_TYPE_MODE. It also adds
two instances of as_a <scalar_mode> to c_common_type, when converting
an unsigned fixed-point SCALAR_TYPE_MODE to the equivalent signed mode.
2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
gcc/
* tree.h (SCALAR_TYPE_MODE): New macro.
* expr.c (expand_expr_addr_expr_1): Use it.
(expand_expr_real_2): Likewise.
* fold-const.c (fold_convert_const_fixed_from_fixed): Likeise.
(fold_convert_const_fixed_from_int): Likewise.
(fold_convert_const_fixed_from_real): Likewise.
(native_encode_fixed): Likewise
(native_encode_complex): Likewise
(native_encode_vector): Likewise.
(native_interpret_fixed): Likewise.
(native_interpret_real): Likewise.
(native_interpret_complex): Likewise.
(native_interpret_vector): Likewise.
* omp-simd-clone.c (simd_clone_adjust_return_type): Likewise.
(simd_clone_adjust_argument_types): Likewise.
(simd_clone_init_simd_arrays): Likewise.
(simd_clone_adjust): Likewise.
* stor-layout.c (layout_type): Likewise.
* tree.c (build_minus_one_cst): Likewise.
* tree-cfg.c (verify_gimple_assign_ternary): Likewise.
* tree-inline.c (estimate_move_cost): Likewise.
* tree-ssa-math-opts.c (convert_plusminus_to_widen): Likewise.
* tree-vect-loop.c (vect_create_epilog_for_reduction): Likewise.
(vectorizable_reduction): Likewise.
* tree-vect-patterns.c (vect_recog_widen_mult_pattern): Likewise.
(vect_recog_mixed_size_cond_pattern): Likewise.
(check_bool_pattern): Likewise.
(adjust_bool_pattern): Likewise.
(search_type_for_mask_1): Likewise.
* tree-vect-slp.c (vect_schedule_slp_instance): Likewise.
* tree-vect-stmts.c (vectorizable_conversion): Likewise.
(vectorizable_load): Likewise.
(vectorizable_store): Likewise.
* ubsan.c (ubsan_encode_value): Likewise.
* varasm.c (output_constant): Likewise.
gcc/c-family/
* c-lex.c (interpret_fixed): Use SCALAR_TYPE_MODE.
* c-common.c (c_build_vec_perm_expr): Likewise.
gcc/c/
* c-typeck.c (build_binary_op): Use SCALAR_TYPE_MODE.
(c_common_type): Likewise. Use as_a <scalar_mode> when setting
m1 and m2 to the signed equivalent of a fixed-point
SCALAR_TYPE_MODE.
gcc/cp/
* typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r251516
Diffstat (limited to 'gcc/tree-vect-patterns.c')
-rw-r--r-- | gcc/tree-vect-patterns.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index 6bc4f7e..4fee7a8 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -939,8 +939,8 @@ vect_recog_widen_mult_pattern (vec<gimple *> *stmts, tree itype = type; if (TYPE_PRECISION (type) > TYPE_PRECISION (half_type0) * 2) itype = build_nonstandard_integer_type - (GET_MODE_BITSIZE (TYPE_MODE (half_type0)) * 2, - TYPE_UNSIGNED (type)); + (GET_MODE_BITSIZE (SCALAR_TYPE_MODE (half_type0)) * 2, + TYPE_UNSIGNED (type)); /* Pattern detected. */ if (dump_enabled_p ()) @@ -3083,7 +3083,7 @@ vect_recog_mixed_size_cond_pattern (vec<gimple *> *stmts, tree *type_in, TYPE_UNSIGNED (type)); if (itype == NULL_TREE - || GET_MODE_BITSIZE (TYPE_MODE (itype)) != cmp_mode_size) + || GET_MODE_BITSIZE (SCALAR_TYPE_MODE (itype)) != cmp_mode_size) return NULL; vecitype = get_vectype_for_scalar_type (itype); @@ -3200,7 +3200,7 @@ check_bool_pattern (tree var, vec_info *vinfo, hash_set<gimple *> &stmts) if (TREE_CODE (TREE_TYPE (rhs1)) != INTEGER_TYPE) { - machine_mode mode = TYPE_MODE (TREE_TYPE (rhs1)); + scalar_mode mode = SCALAR_TYPE_MODE (TREE_TYPE (rhs1)); tree itype = build_nonstandard_integer_type (GET_MODE_BITSIZE (mode), 1); vecitype = get_vectype_for_scalar_type (itype); @@ -3322,7 +3322,7 @@ adjust_bool_pattern (tree var, tree out_type, irhs1 = *defs.get (rhs1); tree def_rhs1 = gimple_assign_rhs1 (def_stmt); if (TYPE_PRECISION (TREE_TYPE (irhs1)) - == GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (def_rhs1)))) + == GET_MODE_BITSIZE (SCALAR_TYPE_MODE (TREE_TYPE (def_rhs1)))) { rhs_code = def_rhs_code; rhs1 = def_rhs1; @@ -3341,7 +3341,7 @@ adjust_bool_pattern (tree var, tree out_type, irhs2 = *defs.get (rhs2); tree def_rhs1 = gimple_assign_rhs1 (def_stmt); if (TYPE_PRECISION (TREE_TYPE (irhs2)) - == GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (def_rhs1)))) + == GET_MODE_BITSIZE (SCALAR_TYPE_MODE (TREE_TYPE (def_rhs1)))) { rhs_code = def_rhs_code; rhs1 = def_rhs1; @@ -3391,7 +3391,7 @@ adjust_bool_pattern (tree var, tree out_type, || (TYPE_PRECISION (TREE_TYPE (rhs1)) != GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (rhs1))))) { - machine_mode mode = TYPE_MODE (TREE_TYPE (rhs1)); + scalar_mode mode = SCALAR_TYPE_MODE (TREE_TYPE (rhs1)); itype = build_nonstandard_integer_type (GET_MODE_BITSIZE (mode), 1); } @@ -3544,7 +3544,7 @@ search_type_for_mask_1 (tree var, vec_info *vinfo, if (TREE_CODE (TREE_TYPE (rhs1)) != INTEGER_TYPE || !TYPE_UNSIGNED (TREE_TYPE (rhs1))) { - machine_mode mode = TYPE_MODE (TREE_TYPE (rhs1)); + scalar_mode mode = SCALAR_TYPE_MODE (TREE_TYPE (rhs1)); res = build_nonstandard_integer_type (GET_MODE_BITSIZE (mode), 1); } else |