aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2007-08-09 16:01:22 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2007-08-09 14:01:22 +0000
commit166cdb08f21ed5009f1890b717a4eaf0d7f5d3a6 (patch)
treeef902503e2e5bb8764f6a2ef4dcaeff07116f6ef /gcc/expr.c
parent3eb0da77ceb36a1f43b8b12fffaf55707272736b (diff)
downloadgcc-166cdb08f21ed5009f1890b717a4eaf0d7f5d3a6.zip
gcc-166cdb08f21ed5009f1890b717a4eaf0d7f5d3a6.tar.gz
gcc-166cdb08f21ed5009f1890b717a4eaf0d7f5d3a6.tar.bz2
optabs.c (expand_widen_pattern_expr): Use optabs accestors.
* optabs.c (expand_widen_pattern_expr): Use optabs accestors. (expand_ternary_op): Likewise. (expand_vec_shift_expr): Likewise. (expand_binop_directly): Likewise. (expand_binop): Likewise. (sign_expand_binop): Likewise. (expand_twoval_unop): Likewise. (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise. (widen_clz): Likewise. (widen_bswap): Likewise. (expand_parity): Likewise. (expand_unop): Likewise. (expand_abs_nojump): Likewise. (expand_copysign): Likewise. (emit_no_conflict_block): Likewise. (emit_libcall_block): Likewise. (can_compare_p): Likewise. (prepare_cmp_insn): Likewise. (emit_cmp_and_jump_insn_1): Likewise. (prepare_float_lib_cmp): Likewise. (emit_conditional_add): Likewise. (gen_add2_insn): Likewise. (have_add2_insn): Likewise. (gen_sub2_insn): Likewise. (have_sub2_insn): Likewise. (can_extend_p): Likewise. (can_fix_p): Likewise. (can_float_p): Likewise. (expand_float): Likewise. (expand_fix): Likewise. (expand_sfix_optab): Likewise. (new_optab): Likewise. (new_convert_optab): Likewise. (init_libfuncs): Likewise. (init_interclass_conv_libfuncs): Likewise. (init_intraclass_conv_libfuncs): Likewise. (set_conv_libfunc): Likewise. (init_optabs): Likewise. (debug_optab_libfuncs): Likewise. (gen_cond_trap): Likewise. * optabs.h (optab_handler, convert_optab_hanlder): New. * genopinit.c: Update optabs generation table. * reload.c (find_reloads_address_1): Use optabs accestors. * builtins.c (expand_builtin_mathfn): Likewise. (expand_builtin_mathfn_2): Likewise. (expand_builtin_mathfn_3): Likewise. (expand_builtin_interclass_mathfn): Likewise. (expand_builtin_sincos): Likewise. (expand_builtin_cexpi): Likewise. (expand_builtin_powi): Likewise. (expand_builtin_strlen): Likewise. * dojump.c (do_jump): Likewise. * expr.c (convert_move): Likewise. (move_by_pieces): Likewise. (move_by_pieces_ninsns): Likewise. (can_store_by_pieces): Likewise. (store_by_pieces_1): Likewise. (emit_move_via_integer): Likewise. (emit_move_complex): Likewise. (emit_move_ccmode): Likewise. (emit_move_insn_1): Likewise. (emit_single_push_insn): Likewise. (store_constructor): Likewise. (expand_expr_real_1): Likewise. (do_store_flag): Likewise. * ada/misc.c (gnat_compute_largest_alignment): Likewise. (enumerate_modes): Likewise. * tree-vectorizer.c (vect_supportable_dr_alignment): Likewise. (supportable_widening_operation): Likewise. (supportable_narrowing_operation): Likewise. * expmed.c (store_bit_field_1): Likewise. (extract_bit_field_1): Likewise. (expand_mult_highpart_optab): Likewise. (expand_smod_pow2): Likewise. (expand_divmod): Likewise. (emit_store_flag): Likewise. * tree-vect-patterns.c (vect_pattern_recog_1): Likewise. * tree-ssa-loop-prefetch.c (nontemporal_store_p): Likewise. * tree-vect-transform.c (vect_model_reduction_cost): Likewise. (vect_create_epilog_for_reduction): Likewise. (vectorizable_reduction): Likewise. (vectorizable_operation): Likewise. (vect_strided_store_supported): Likewise. (vectorizable_store): Likewise. (vect_strided_load_supported): Likewise. (vectorizable_load): Likewise. * combine.c (simplify_comparison): Likewise. * tree-vect-generic.c (type_for_widest_vector_mode): Likewise. (expand_vector_operations_1): Likewise. * config/spu/spu.c (spu_expand_mov): Likewise. (spu_emit_vector_compare): Likewise. * config/rs6000/rs6000.c (rs6000_emit_vector_compare): Likewise. * stmt.c (add_case_node): Likewise. * reload1.c (gen_reload): From-SVN: r127317
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 2119ab7..a002b0d 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -426,7 +426,7 @@ convert_move (rtx to, rtx from, int unsignedp)
/* Try converting directly if the insn is supported. */
- code = tab->handlers[to_mode][from_mode].insn_code;
+ code = convert_optab_handler (tab, to_mode, from_mode)->insn_code;
if (code != CODE_FOR_nothing)
{
emit_unop_insn (code, to, from,
@@ -435,7 +435,7 @@ convert_move (rtx to, rtx from, int unsignedp)
}
/* Otherwise use a libcall. */
- libcall = tab->handlers[to_mode][from_mode].libfunc;
+ libcall = convert_optab_handler (tab, to_mode, from_mode)->libfunc;
/* Is this conversion implemented yet? */
gcc_assert (libcall);
@@ -460,12 +460,12 @@ convert_move (rtx to, rtx from, int unsignedp)
enum machine_mode full_mode
= smallest_mode_for_size (GET_MODE_BITSIZE (to_mode), MODE_INT);
- gcc_assert (trunc_optab->handlers[to_mode][full_mode].insn_code
+ gcc_assert (convert_optab_handler (trunc_optab, to_mode, full_mode)->insn_code
!= CODE_FOR_nothing);
if (full_mode != from_mode)
from = convert_to_mode (full_mode, from, unsignedp);
- emit_unop_insn (trunc_optab->handlers[to_mode][full_mode].insn_code,
+ emit_unop_insn (convert_optab_handler (trunc_optab, to_mode, full_mode)->insn_code,
to, from, UNKNOWN);
return;
}
@@ -475,18 +475,18 @@ convert_move (rtx to, rtx from, int unsignedp)
enum machine_mode full_mode
= smallest_mode_for_size (GET_MODE_BITSIZE (from_mode), MODE_INT);
- gcc_assert (sext_optab->handlers[full_mode][from_mode].insn_code
+ gcc_assert (convert_optab_handler (sext_optab, full_mode, from_mode)->insn_code
!= CODE_FOR_nothing);
if (to_mode == full_mode)
{
- emit_unop_insn (sext_optab->handlers[full_mode][from_mode].insn_code,
+ emit_unop_insn (convert_optab_handler (sext_optab, full_mode, from_mode)->insn_code,
to, from, UNKNOWN);
return;
}
new_from = gen_reg_rtx (full_mode);
- emit_unop_insn (sext_optab->handlers[full_mode][from_mode].insn_code,
+ emit_unop_insn (convert_optab_handler (sext_optab, full_mode, from_mode)->insn_code,
new_from, from, UNKNOWN);
/* else proceed to integer conversions below. */
@@ -690,9 +690,9 @@ convert_move (rtx to, rtx from, int unsignedp)
}
/* Support special truncate insns for certain modes. */
- if (trunc_optab->handlers[to_mode][from_mode].insn_code != CODE_FOR_nothing)
+ if (convert_optab_handler (trunc_optab, to_mode, from_mode)->insn_code != CODE_FOR_nothing)
{
- emit_unop_insn (trunc_optab->handlers[to_mode][from_mode].insn_code,
+ emit_unop_insn (convert_optab_handler (trunc_optab, to_mode, from_mode)->insn_code,
to, from, UNKNOWN);
return;
}
@@ -984,7 +984,7 @@ move_by_pieces (rtx to, rtx from, unsigned HOST_WIDE_INT len,
if (mode == VOIDmode)
break;
- icode = mov_optab->handlers[(int) mode].insn_code;
+ icode = optab_handler (mov_optab, mode)->insn_code;
if (icode != CODE_FOR_nothing && align >= GET_MODE_ALIGNMENT (mode))
move_by_pieces_1 (GEN_FCN (icode), mode, &data);
@@ -1064,7 +1064,7 @@ move_by_pieces_ninsns (unsigned HOST_WIDE_INT l, unsigned int align,
if (mode == VOIDmode)
break;
- icode = mov_optab->handlers[(int) mode].insn_code;
+ icode = optab_handler (mov_optab, mode)->insn_code;
if (icode != CODE_FOR_nothing && align >= GET_MODE_ALIGNMENT (mode))
n_insns += l / GET_MODE_SIZE (mode), l %= GET_MODE_SIZE (mode);
@@ -2250,7 +2250,7 @@ can_store_by_pieces (unsigned HOST_WIDE_INT len,
if (mode == VOIDmode)
break;
- icode = mov_optab->handlers[(int) mode].insn_code;
+ icode = optab_handler (mov_optab, mode)->insn_code;
if (icode != CODE_FOR_nothing
&& align >= GET_MODE_ALIGNMENT (mode))
{
@@ -2454,7 +2454,7 @@ store_by_pieces_1 (struct store_by_pieces *data ATTRIBUTE_UNUSED,
if (mode == VOIDmode)
break;
- icode = mov_optab->handlers[(int) mode].insn_code;
+ icode = optab_handler (mov_optab, mode)->insn_code;
if (icode != CODE_FOR_nothing && align >= GET_MODE_ALIGNMENT (mode))
store_by_pieces_2 (GEN_FCN (icode), mode, data);
@@ -2921,7 +2921,7 @@ emit_move_via_integer (enum machine_mode mode, rtx x, rtx y, bool force)
return NULL_RTX;
/* The target must support moves in this mode. */
- code = mov_optab->handlers[imode].insn_code;
+ code = optab_handler (mov_optab, imode)->insn_code;
if (code == CODE_FOR_nothing)
return NULL_RTX;
@@ -3071,7 +3071,7 @@ emit_move_complex (enum machine_mode mode, rtx x, rtx y)
/* Move floating point as parts. */
if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT
- && mov_optab->handlers[GET_MODE_INNER (mode)].insn_code != CODE_FOR_nothing)
+ && optab_handler (mov_optab, GET_MODE_INNER (mode))->insn_code != CODE_FOR_nothing)
try_int = false;
/* Not possible if the values are inherently not adjacent. */
else if (GET_CODE (x) == CONCAT || GET_CODE (y) == CONCAT)
@@ -3122,7 +3122,7 @@ emit_move_ccmode (enum machine_mode mode, rtx x, rtx y)
/* Assume all MODE_CC modes are equivalent; if we have movcc, use it. */
if (mode != CCmode)
{
- enum insn_code code = mov_optab->handlers[CCmode].insn_code;
+ enum insn_code code = optab_handler (mov_optab, CCmode)->insn_code;
if (code != CODE_FOR_nothing)
{
x = emit_move_change_mode (CCmode, mode, x, true);
@@ -3262,7 +3262,7 @@ emit_move_insn_1 (rtx x, rtx y)
gcc_assert ((unsigned int) mode < (unsigned int) MAX_MACHINE_MODE);
- code = mov_optab->handlers[mode].insn_code;
+ code = optab_handler (mov_optab, mode)->insn_code;
if (code != CODE_FOR_nothing)
return emit_insn (GEN_FCN (code) (x, y));
@@ -3514,7 +3514,7 @@ emit_single_push_insn (enum machine_mode mode, rtx x, tree type)
stack_pointer_delta += PUSH_ROUNDING (GET_MODE_SIZE (mode));
/* If there is push pattern, use it. Otherwise try old way of throwing
MEM representing push operation to move expander. */
- icode = push_optab->handlers[(int) mode].insn_code;
+ icode = optab_handler (push_optab, mode)->insn_code;
if (icode != CODE_FOR_nothing)
{
if (((pred = insn_data[(int) icode].operand[0].predicate)
@@ -4319,7 +4319,7 @@ static bool
emit_storent_insn (rtx to, rtx from)
{
enum machine_mode mode = GET_MODE (to), imode;
- enum insn_code code = storent_optab->handlers[mode].insn_code;
+ enum insn_code code = optab_handler (storent_optab, mode)->insn_code;
rtx pattern;
if (code == CODE_FOR_nothing)
@@ -5458,7 +5458,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
{
enum machine_mode mode = GET_MODE (target);
- icode = (int) vec_init_optab->handlers[mode].insn_code;
+ icode = (int) optab_handler (vec_init_optab, mode)->insn_code;
if (icode != CODE_FOR_nothing)
{
unsigned int i;
@@ -7394,7 +7394,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
|| modifier == EXPAND_STACK_PARM);
/* The vectorizer should have already checked the mode. */
- icode = movmisalign_optab->handlers[mode].insn_code;
+ icode = optab_handler (movmisalign_optab, mode)->insn_code;
gcc_assert (icode != CODE_FOR_nothing);
/* We've already validated the memory, and we're creating a
@@ -8107,7 +8107,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
bool zextend_p = TYPE_UNSIGNED (op0type);
this_optab = zextend_p ? umadd_widen_optab : smadd_widen_optab;
if (mode == GET_MODE_2XWIDER_MODE (innermode)
- && (this_optab->handlers[(int) mode].insn_code
+ && (optab_handler (this_optab, mode)->insn_code
!= CODE_FOR_nothing))
{
expand_operands (TREE_OPERAND (subsubexp0, 0),
@@ -8262,7 +8262,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
bool zextend_p = TYPE_UNSIGNED (op0type);
this_optab = zextend_p ? umsub_widen_optab : smsub_widen_optab;
if (mode == GET_MODE_2XWIDER_MODE (innermode)
- && (this_optab->handlers[(int) mode].insn_code
+ && (optab_handler (this_optab, mode)->insn_code
!= CODE_FOR_nothing))
{
expand_operands (TREE_OPERAND (subsubexp0, 0),
@@ -8377,7 +8377,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
this_optab = usmul_widen_optab;
if (mode == GET_MODE_WIDER_MODE (innermode))
{
- if (this_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
+ if (optab_handler (this_optab, mode)->insn_code != CODE_FOR_nothing)
{
if (TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (subexp0, 0))))
expand_operands (TREE_OPERAND (subexp0, 0),
@@ -8427,7 +8427,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
if (mode == GET_MODE_2XWIDER_MODE (innermode))
{
- if (this_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
+ if (optab_handler (this_optab, mode)->insn_code != CODE_FOR_nothing)
{
if (TREE_CODE (TREE_OPERAND (exp, 1)) == INTEGER_CST)
expand_operands (TREE_OPERAND (TREE_OPERAND (exp, 0), 0),
@@ -8439,7 +8439,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
NULL_RTX, &op0, &op1, EXPAND_NORMAL);
goto binop3;
}
- else if (other_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing
+ else if (optab_handler (other_optab, mode)->insn_code != CODE_FOR_nothing
&& innermode == word_mode)
{
rtx htem, hipart;
@@ -9552,7 +9552,7 @@ do_store_flag (tree exp, rtx target, enum machine_mode mode, int only_cheap)
for (wmode = operand_mode;
icode == CODE_FOR_nothing && wmode != VOIDmode;
wmode = GET_MODE_WIDER_MODE (wmode))
- icode = cstore_optab->handlers[(int) wmode].insn_code;
+ icode = optab_handler (cstore_optab, wmode)->insn_code;
}
if (icode == CODE_FOR_nothing
@@ -9565,9 +9565,9 @@ do_store_flag (tree exp, rtx target, enum machine_mode mode, int only_cheap)
;
else if (! only_cheap && (code == NE || code == EQ)
&& TREE_CODE (type) != REAL_TYPE
- && ((abs_optab->handlers[(int) operand_mode].insn_code
+ && ((optab_handler (abs_optab, operand_mode)->insn_code
!= CODE_FOR_nothing)
- || (ffs_optab->handlers[(int) operand_mode].insn_code
+ || (optab_handler (ffs_optab, operand_mode)->insn_code
!= CODE_FOR_nothing)))
;
else