aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2010-07-04 22:13:09 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2010-07-04 22:13:09 +0000
commit947131ba4e351e264f3aa3a7ccd6b0c82bcc7ebd (patch)
treec58b0fad8bf6ca1d17ba2102d04c971975a84d81 /gcc/tree-vect-loop.c
parent47e5ff44ccdcf7c7936ad91d07b78cbf64d430d1 (diff)
downloadgcc-947131ba4e351e264f3aa3a7ccd6b0c82bcc7ebd.zip
gcc-947131ba4e351e264f3aa3a7ccd6b0c82bcc7ebd.tar.gz
gcc-947131ba4e351e264f3aa3a7ccd6b0c82bcc7ebd.tar.bz2
optabs.h (optab_handler, [...]): Turn into inline functions that return an insn code.
gcc/ * optabs.h (optab_handler, convert_optab_handler): Turn into inline functions that return an insn code. (set_optab_handler, set_convert_optab_handler): New functions. * builtins.c: Replace optab_handler(X)->insn_code with optab_handler or set_optab_handler thoughout. Likewise convert_optab_handler(X)->insn_code with convert_optab_handler and set_convert_optab_handler. * expmed.c, expr.c, genopinit.c, ifcvt.c, optabs.c, reload.c, reload1.c, stmt.c, targhooks.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, config/m32c/m32c.c, config/rs6000/rs6000.c, config/spu/spu.c: Likewise. From-SVN: r161808
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index ef48173..1285528 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -132,7 +132,7 @@ along with GCC; see the file COPYING3. If not see
Since we only vectorize operations which vector form can be
expressed using existing tree codes, to verify that an operation is
supported, the vectorizer checks the relevant optab at the relevant
- machine_mode (e.g, optab_handler (add_optab, V8HImode)->insn_code). If
+ machine_mode (e.g, optab_handler (add_optab, V8HImode)). If
the value found is CODE_FOR_nothing, then there's no target support, and
we can't vectorize the stmt.
@@ -2490,8 +2490,8 @@ vect_model_reduction_cost (stmt_vec_info stmt_info, enum tree_code reduc_code,
/* We have a whole vector shift available. */
if (VECTOR_MODE_P (mode)
- && optab_handler (optab, mode)->insn_code != CODE_FOR_nothing
- && optab_handler (vec_shr_optab, mode)->insn_code != CODE_FOR_nothing)
+ && optab_handler (optab, mode) != CODE_FOR_nothing
+ && optab_handler (vec_shr_optab, mode) != CODE_FOR_nothing)
/* Final reduction via vector shifts and the reduction operator. Also
requires scalar extract. */
outer_cost += ((exact_log2(nelements) * 2)
@@ -3333,7 +3333,7 @@ vect_create_epilog_for_reduction (VEC (tree, heap) *vect_defs, gimple stmt,
int vec_size_in_bits = tree_low_cst (TYPE_SIZE (vectype), 1);
tree vec_temp;
- if (optab_handler (vec_shr_optab, mode)->insn_code != CODE_FOR_nothing)
+ if (optab_handler (vec_shr_optab, mode) != CODE_FOR_nothing)
shift_code = VEC_RSHIFT_EXPR;
else
have_whole_vector_shift = false;
@@ -3349,7 +3349,7 @@ vect_create_epilog_for_reduction (VEC (tree, heap) *vect_defs, gimple stmt,
else
{
optab optab = optab_for_tree_code (code, vectype, optab_default);
- if (optab_handler (optab, mode)->insn_code == CODE_FOR_nothing)
+ if (optab_handler (optab, mode) == CODE_FOR_nothing)
have_whole_vector_shift = false;
}
@@ -4008,7 +4008,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
return false;
}
- if (optab_handler (optab, vec_mode)->insn_code == CODE_FOR_nothing)
+ if (optab_handler (optab, vec_mode) == CODE_FOR_nothing)
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "op not supported by target.");
@@ -4056,11 +4056,12 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
2. The type (mode) we use to check available target support
for the vector operation to be created in the *epilog*, is
determined by the type of the reduction variable (in the example
- above we'd check this: plus_optab[vect_int_mode]).
+ above we'd check this: optab_handler (plus_optab, vect_int_mode])).
However the type (mode) we use to check available target support
for the vector operation to be created *inside the loop*, is
determined by the type of the other arguments to STMT (in the
- example we'd check this: widen_sum_optab[vect_short_mode]).
+ example we'd check this: optab_handler (widen_sum_optab,
+ vect_short_mode)).
This is contrary to "regular" reductions, in which the types of all
the arguments are the same as the type of the reduction variable.
@@ -4113,8 +4114,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
}
if (reduc_optab
- && optab_handler (reduc_optab, vec_mode)->insn_code
- == CODE_FOR_nothing)
+ && optab_handler (reduc_optab, vec_mode) == CODE_FOR_nothing)
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "reduc op not supported by target.");