mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-01-26 11:34:19 +08:00
optabs.c (gen_condiational_trap): Remove #define.
* optabs.c (gen_condiational_trap): Remove #define. (add_equal_note): Assertify. Remove explicit indirection from call via function pointer. (expand_ternary_op, expand_simple_binop, expand_binop, expand_twoval_unop, expand_twoval_binop, expand_twoval_binop_libfunc, expand_simple_unop expand_unop, emit_unop_insn, emit_no_conflict_block, prepare_cmp_insn, prepare_operand emit_cmp_and_jump_insn_1, emit_cmp_and_jump_insns, prepare_float_lib_cmp, emit_conditional_move, emit_conditional_add, gen_add2_insn, gen_add3_insn, have_add2_insn, gen_sub2_insn, gen_sub3_insn, have_sub2_insn, expand_float, expand_fix, debug_optab_libfuncs, gen_cond_trap, vector_compare_rtx, expand_vec_cond_expr): Likewise. From-SVN: r98499
This commit is contained in:
parent
d4e6fecb8f
commit
e3feb57152
@ -1,3 +1,19 @@
|
|||||||
|
2005-04-21 Nathan Sidwell <nathan@codesourcery.com>
|
||||||
|
|
||||||
|
* optabs.c (gen_condiational_trap): Remove #define.
|
||||||
|
(add_equal_note): Assertify. Remove explicit indirection from
|
||||||
|
call via function pointer.
|
||||||
|
(expand_ternary_op, expand_simple_binop, expand_binop,
|
||||||
|
expand_twoval_unop, expand_twoval_binop,
|
||||||
|
expand_twoval_binop_libfunc, expand_simple_unop expand_unop,
|
||||||
|
emit_unop_insn, emit_no_conflict_block, prepare_cmp_insn,
|
||||||
|
prepare_operand emit_cmp_and_jump_insn_1, emit_cmp_and_jump_insns,
|
||||||
|
prepare_float_lib_cmp, emit_conditional_move,
|
||||||
|
emit_conditional_add, gen_add2_insn, gen_add3_insn,
|
||||||
|
have_add2_insn, gen_sub2_insn, gen_sub3_insn, have_sub2_insn,
|
||||||
|
expand_float, expand_fix, debug_optab_libfuncs, gen_cond_trap,
|
||||||
|
vector_compare_rtx, expand_vec_cond_expr): Likewise.
|
||||||
|
|
||||||
2005-04-21 Nathan Sidwell <nathan@codesourcery.com>
|
2005-04-21 Nathan Sidwell <nathan@codesourcery.com>
|
||||||
|
|
||||||
* vec.h: Update API to separate allocation mechanism from type.
|
* vec.h: Update API to separate allocation mechanism from type.
|
||||||
|
242
gcc/optabs.c
242
gcc/optabs.c
@ -127,7 +127,6 @@ static rtx vector_compare_rtx (tree, bool, enum insn_code);
|
|||||||
|
|
||||||
#ifndef HAVE_conditional_trap
|
#ifndef HAVE_conditional_trap
|
||||||
#define HAVE_conditional_trap 0
|
#define HAVE_conditional_trap 0
|
||||||
#define gen_conditional_trap(a,b) (abort (), NULL_RTX)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Add a REG_EQUAL note to the last insn in INSNS. TARGET is being set to
|
/* Add a REG_EQUAL note to the last insn in INSNS. TARGET is being set to
|
||||||
@ -146,10 +145,7 @@ add_equal_note (rtx insns, rtx target, enum rtx_code code, rtx op0, rtx op1)
|
|||||||
rtx last_insn, insn, set;
|
rtx last_insn, insn, set;
|
||||||
rtx note;
|
rtx note;
|
||||||
|
|
||||||
if (! insns
|
gcc_assert (insns && INSN_P (insns) && NEXT_INSN (insns));
|
||||||
|| ! INSN_P (insns)
|
|
||||||
|| NEXT_INSN (insns) == NULL_RTX)
|
|
||||||
abort ();
|
|
||||||
|
|
||||||
if (GET_RTX_CLASS (code) != RTX_COMM_ARITH
|
if (GET_RTX_CLASS (code) != RTX_COMM_ARITH
|
||||||
&& GET_RTX_CLASS (code) != RTX_BIN_ARITH
|
&& GET_RTX_CLASS (code) != RTX_BIN_ARITH
|
||||||
@ -348,11 +344,10 @@ expand_ternary_op (enum machine_mode mode, optab ternary_optab, rtx op0,
|
|||||||
rtx pat;
|
rtx pat;
|
||||||
rtx xop0 = op0, xop1 = op1, xop2 = op2;
|
rtx xop0 = op0, xop1 = op1, xop2 = op2;
|
||||||
|
|
||||||
if (ternary_optab->handlers[(int) mode].insn_code == CODE_FOR_nothing)
|
gcc_assert (ternary_optab->handlers[(int) mode].insn_code
|
||||||
abort ();
|
!= CODE_FOR_nothing);
|
||||||
|
|
||||||
if (!target
|
if (!target || !insn_data[icode].operand[0].predicate (target, mode))
|
||||||
|| ! (*insn_data[icode].operand[0].predicate) (target, mode))
|
|
||||||
temp = gen_reg_rtx (mode);
|
temp = gen_reg_rtx (mode);
|
||||||
else
|
else
|
||||||
temp = target;
|
temp = target;
|
||||||
@ -387,15 +382,15 @@ expand_ternary_op (enum machine_mode mode, optab ternary_optab, rtx op0,
|
|||||||
/* Now, if insn's predicates don't allow our operands, put them into
|
/* Now, if insn's predicates don't allow our operands, put them into
|
||||||
pseudo regs. */
|
pseudo regs. */
|
||||||
|
|
||||||
if (! (*insn_data[icode].operand[1].predicate) (xop0, mode0)
|
if (!insn_data[icode].operand[1].predicate (xop0, mode0)
|
||||||
&& mode0 != VOIDmode)
|
&& mode0 != VOIDmode)
|
||||||
xop0 = copy_to_mode_reg (mode0, xop0);
|
xop0 = copy_to_mode_reg (mode0, xop0);
|
||||||
|
|
||||||
if (! (*insn_data[icode].operand[2].predicate) (xop1, mode1)
|
if (!insn_data[icode].operand[2].predicate (xop1, mode1)
|
||||||
&& mode1 != VOIDmode)
|
&& mode1 != VOIDmode)
|
||||||
xop1 = copy_to_mode_reg (mode1, xop1);
|
xop1 = copy_to_mode_reg (mode1, xop1);
|
||||||
|
|
||||||
if (! (*insn_data[icode].operand[3].predicate) (xop2, mode2)
|
if (!insn_data[icode].operand[3].predicate (xop2, mode2)
|
||||||
&& mode2 != VOIDmode)
|
&& mode2 != VOIDmode)
|
||||||
xop2 = copy_to_mode_reg (mode2, xop2);
|
xop2 = copy_to_mode_reg (mode2, xop2);
|
||||||
|
|
||||||
@ -927,8 +922,7 @@ expand_simple_binop (enum machine_mode mode, enum rtx_code code, rtx op0,
|
|||||||
enum optab_methods methods)
|
enum optab_methods methods)
|
||||||
{
|
{
|
||||||
optab binop = code_to_optab[(int) code];
|
optab binop = code_to_optab[(int) code];
|
||||||
if (binop == 0)
|
gcc_assert (binop);
|
||||||
abort ();
|
|
||||||
|
|
||||||
return expand_binop (mode, binop, op0, op1, target, unsignedp, methods);
|
return expand_binop (mode, binop, op0, op1, target, unsignedp, methods);
|
||||||
}
|
}
|
||||||
@ -1088,15 +1082,15 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
|
|||||||
/* Now, if insn's predicates don't allow our operands, put them into
|
/* Now, if insn's predicates don't allow our operands, put them into
|
||||||
pseudo regs. */
|
pseudo regs. */
|
||||||
|
|
||||||
if (! (*insn_data[icode].operand[1].predicate) (xop0, mode0)
|
if (!insn_data[icode].operand[1].predicate (xop0, mode0)
|
||||||
&& mode0 != VOIDmode)
|
&& mode0 != VOIDmode)
|
||||||
xop0 = copy_to_mode_reg (mode0, xop0);
|
xop0 = copy_to_mode_reg (mode0, xop0);
|
||||||
|
|
||||||
if (! (*insn_data[icode].operand[2].predicate) (xop1, mode1)
|
if (!insn_data[icode].operand[2].predicate (xop1, mode1)
|
||||||
&& mode1 != VOIDmode)
|
&& mode1 != VOIDmode)
|
||||||
xop1 = copy_to_mode_reg (mode1, xop1);
|
xop1 = copy_to_mode_reg (mode1, xop1);
|
||||||
|
|
||||||
if (! (*insn_data[icode].operand[0].predicate) (temp, mode))
|
if (!insn_data[icode].operand[0].predicate (temp, mode))
|
||||||
temp = gen_reg_rtx (mode);
|
temp = gen_reg_rtx (mode);
|
||||||
|
|
||||||
pat = GEN_FCN (icode) (temp, xop0, xop1);
|
pat = GEN_FCN (icode) (temp, xop0, xop1);
|
||||||
@ -1829,14 +1823,13 @@ expand_twoval_unop (optab unoptab, rtx op0, rtx targ0, rtx targ1,
|
|||||||
xop0 = convert_to_mode (mode0, xop0, unsignedp);
|
xop0 = convert_to_mode (mode0, xop0, unsignedp);
|
||||||
|
|
||||||
/* Now, if insn doesn't accept these operands, put them into pseudos. */
|
/* Now, if insn doesn't accept these operands, put them into pseudos. */
|
||||||
if (! (*insn_data[icode].operand[2].predicate) (xop0, mode0))
|
if (!insn_data[icode].operand[2].predicate (xop0, mode0))
|
||||||
xop0 = copy_to_mode_reg (mode0, xop0);
|
xop0 = copy_to_mode_reg (mode0, xop0);
|
||||||
|
|
||||||
/* We could handle this, but we should always be called with a pseudo
|
/* We could handle this, but we should always be called with a pseudo
|
||||||
for our targets and all insns should take them as outputs. */
|
for our targets and all insns should take them as outputs. */
|
||||||
if (! (*insn_data[icode].operand[0].predicate) (targ0, mode)
|
gcc_assert (insn_data[icode].operand[0].predicate (targ0, mode));
|
||||||
|| ! (*insn_data[icode].operand[1].predicate) (targ1, mode))
|
gcc_assert (insn_data[icode].operand[1].predicate (targ1, mode));
|
||||||
abort ();
|
|
||||||
|
|
||||||
pat = GEN_FCN (icode) (targ0, targ1, xop0);
|
pat = GEN_FCN (icode) (targ0, targ1, xop0);
|
||||||
if (pat)
|
if (pat)
|
||||||
@ -1955,17 +1948,16 @@ expand_twoval_binop (optab binoptab, rtx op0, rtx op1, rtx targ0, rtx targ1,
|
|||||||
xop1, unsignedp);
|
xop1, unsignedp);
|
||||||
|
|
||||||
/* Now, if insn doesn't accept these operands, put them into pseudos. */
|
/* Now, if insn doesn't accept these operands, put them into pseudos. */
|
||||||
if (! (*insn_data[icode].operand[1].predicate) (xop0, mode0))
|
if (!insn_data[icode].operand[1].predicate (xop0, mode0))
|
||||||
xop0 = copy_to_mode_reg (mode0, xop0);
|
xop0 = copy_to_mode_reg (mode0, xop0);
|
||||||
|
|
||||||
if (! (*insn_data[icode].operand[2].predicate) (xop1, mode1))
|
if (!insn_data[icode].operand[2].predicate (xop1, mode1))
|
||||||
xop1 = copy_to_mode_reg (mode1, xop1);
|
xop1 = copy_to_mode_reg (mode1, xop1);
|
||||||
|
|
||||||
/* We could handle this, but we should always be called with a pseudo
|
/* We could handle this, but we should always be called with a pseudo
|
||||||
for our targets and all insns should take them as outputs. */
|
for our targets and all insns should take them as outputs. */
|
||||||
if (! (*insn_data[icode].operand[0].predicate) (targ0, mode)
|
gcc_assert (insn_data[icode].operand[0].predicate (targ0, mode));
|
||||||
|| ! (*insn_data[icode].operand[3].predicate) (targ1, mode))
|
gcc_assert (insn_data[icode].operand[3].predicate (targ1, mode));
|
||||||
abort ();
|
|
||||||
|
|
||||||
pat = GEN_FCN (icode) (targ0, xop0, xop1, targ1);
|
pat = GEN_FCN (icode) (targ0, xop0, xop1, targ1);
|
||||||
if (pat)
|
if (pat)
|
||||||
@ -2028,8 +2020,7 @@ expand_twoval_binop_libfunc (optab binoptab, rtx op0, rtx op1,
|
|||||||
rtx insns;
|
rtx insns;
|
||||||
|
|
||||||
/* Exactly one of TARG0 or TARG1 should be non-NULL. */
|
/* Exactly one of TARG0 or TARG1 should be non-NULL. */
|
||||||
if (!((targ0 != NULL_RTX) ^ (targ1 != NULL_RTX)))
|
gcc_assert (!targ0 != !targ1);
|
||||||
abort ();
|
|
||||||
|
|
||||||
mode = GET_MODE (op0);
|
mode = GET_MODE (op0);
|
||||||
if (!binoptab->handlers[(int) mode].libfunc)
|
if (!binoptab->handlers[(int) mode].libfunc)
|
||||||
@ -2066,8 +2057,7 @@ expand_simple_unop (enum machine_mode mode, enum rtx_code code, rtx op0,
|
|||||||
rtx target, int unsignedp)
|
rtx target, int unsignedp)
|
||||||
{
|
{
|
||||||
optab unop = code_to_optab[(int) code];
|
optab unop = code_to_optab[(int) code];
|
||||||
if (unop == 0)
|
gcc_assert (unop);
|
||||||
abort ();
|
|
||||||
|
|
||||||
return expand_unop (mode, unop, op0, target, unsignedp);
|
return expand_unop (mode, unop, op0, target, unsignedp);
|
||||||
}
|
}
|
||||||
@ -2317,10 +2307,10 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target,
|
|||||||
|
|
||||||
/* Now, if insn doesn't accept our operand, put it into a pseudo. */
|
/* Now, if insn doesn't accept our operand, put it into a pseudo. */
|
||||||
|
|
||||||
if (! (*insn_data[icode].operand[1].predicate) (xop0, mode0))
|
if (!insn_data[icode].operand[1].predicate (xop0, mode0))
|
||||||
xop0 = copy_to_mode_reg (mode0, xop0);
|
xop0 = copy_to_mode_reg (mode0, xop0);
|
||||||
|
|
||||||
if (! (*insn_data[icode].operand[0].predicate) (temp, mode))
|
if (!insn_data[icode].operand[0].predicate (temp, mode))
|
||||||
temp = gen_reg_rtx (mode);
|
temp = gen_reg_rtx (mode);
|
||||||
|
|
||||||
pat = GEN_FCN (icode) (temp, xop0);
|
pat = GEN_FCN (icode) (temp, xop0);
|
||||||
@ -2934,10 +2924,10 @@ emit_unop_insn (int icode, rtx target, rtx op0, enum rtx_code code)
|
|||||||
|
|
||||||
/* Now, if insn does not accept our operands, put them into pseudos. */
|
/* Now, if insn does not accept our operands, put them into pseudos. */
|
||||||
|
|
||||||
if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
|
if (!insn_data[icode].operand[1].predicate (op0, mode0))
|
||||||
op0 = copy_to_mode_reg (mode0, op0);
|
op0 = copy_to_mode_reg (mode0, op0);
|
||||||
|
|
||||||
if (! (*insn_data[icode].operand[0].predicate) (temp, GET_MODE (temp))
|
if (!insn_data[icode].operand[0].predicate (temp, GET_MODE (temp))
|
||||||
|| (flag_force_mem && MEM_P (temp)))
|
|| (flag_force_mem && MEM_P (temp)))
|
||||||
temp = gen_reg_rtx (GET_MODE (temp));
|
temp = gen_reg_rtx (GET_MODE (temp));
|
||||||
|
|
||||||
@ -3022,8 +3012,7 @@ emit_no_conflict_block (rtx insns, rtx target, rtx op0, rtx op1, rtx equiv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (set == 0)
|
gcc_assert (set);
|
||||||
abort ();
|
|
||||||
|
|
||||||
if (! reg_overlap_mentioned_p (target, SET_DEST (set)))
|
if (! reg_overlap_mentioned_p (target, SET_DEST (set)))
|
||||||
{
|
{
|
||||||
@ -3365,8 +3354,7 @@ prepare_cmp_insn (rtx *px, rtx *py, enum rtx_code *pcomparison, rtx size,
|
|||||||
/* Abort if we have a non-canonical comparison. The RTL documentation
|
/* Abort if we have a non-canonical comparison. The RTL documentation
|
||||||
states that canonical comparisons are required only for targets which
|
states that canonical comparisons are required only for targets which
|
||||||
have cc0. */
|
have cc0. */
|
||||||
if (CONSTANT_P (x) && ! CONSTANT_P (y))
|
gcc_assert (!CONSTANT_P (x) || CONSTANT_P (y));
|
||||||
abort ();
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Don't let both operands fail to indicate the mode. */
|
/* Don't let both operands fail to indicate the mode. */
|
||||||
@ -3385,8 +3373,7 @@ prepare_cmp_insn (rtx *px, rtx *py, enum rtx_code *pcomparison, rtx size,
|
|||||||
rtx opalign
|
rtx opalign
|
||||||
= GEN_INT (MIN (MEM_ALIGN (x), MEM_ALIGN (y)) / BITS_PER_UNIT);
|
= GEN_INT (MIN (MEM_ALIGN (x), MEM_ALIGN (y)) / BITS_PER_UNIT);
|
||||||
|
|
||||||
if (size == 0)
|
gcc_assert (size);
|
||||||
abort ();
|
|
||||||
|
|
||||||
/* Try to use a memory block compare insn - either cmpstr
|
/* Try to use a memory block compare insn - either cmpstr
|
||||||
or cmpmem will do. */
|
or cmpmem will do. */
|
||||||
@ -3483,11 +3470,8 @@ prepare_cmp_insn (rtx *px, rtx *py, enum rtx_code *pcomparison, rtx size,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (class == MODE_FLOAT)
|
gcc_assert (class == MODE_FLOAT);
|
||||||
prepare_float_lib_cmp (px, py, pcomparison, pmode, punsignedp);
|
prepare_float_lib_cmp (px, py, pcomparison, pmode, punsignedp);
|
||||||
|
|
||||||
else
|
|
||||||
abort ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Before emitting an insn with code ICODE, make sure that X, which is going
|
/* Before emitting an insn with code ICODE, make sure that X, which is going
|
||||||
@ -3502,7 +3486,7 @@ prepare_operand (int icode, rtx x, int opnum, enum machine_mode mode,
|
|||||||
if (mode != wider_mode)
|
if (mode != wider_mode)
|
||||||
x = convert_modes (wider_mode, mode, x, unsignedp);
|
x = convert_modes (wider_mode, mode, x, unsignedp);
|
||||||
|
|
||||||
if (! (*insn_data[icode].operand[opnum].predicate)
|
if (!insn_data[icode].operand[opnum].predicate
|
||||||
(x, insn_data[icode].operand[opnum].mode))
|
(x, insn_data[icode].operand[opnum].mode))
|
||||||
{
|
{
|
||||||
if (no_new_pseudos)
|
if (no_new_pseudos)
|
||||||
@ -3537,7 +3521,7 @@ emit_cmp_and_jump_insn_1 (rtx x, rtx y, enum machine_mode mode,
|
|||||||
icode = cbranch_optab->handlers[(int) wider_mode].insn_code;
|
icode = cbranch_optab->handlers[(int) wider_mode].insn_code;
|
||||||
|
|
||||||
if (icode != CODE_FOR_nothing
|
if (icode != CODE_FOR_nothing
|
||||||
&& (*insn_data[icode].operand[0].predicate) (test, wider_mode))
|
&& insn_data[icode].operand[0].predicate (test, wider_mode))
|
||||||
{
|
{
|
||||||
x = prepare_operand (icode, x, 1, mode, wider_mode, unsignedp);
|
x = prepare_operand (icode, x, 1, mode, wider_mode, unsignedp);
|
||||||
y = prepare_operand (icode, y, 2, mode, wider_mode, unsignedp);
|
y = prepare_operand (icode, y, 2, mode, wider_mode, unsignedp);
|
||||||
@ -3553,7 +3537,7 @@ emit_cmp_and_jump_insn_1 (rtx x, rtx y, enum machine_mode mode,
|
|||||||
x = prepare_operand (icode, x, 0, mode, wider_mode, unsignedp);
|
x = prepare_operand (icode, x, 0, mode, wider_mode, unsignedp);
|
||||||
emit_insn (GEN_FCN (icode) (x));
|
emit_insn (GEN_FCN (icode) (x));
|
||||||
if (label)
|
if (label)
|
||||||
emit_jump_insn ((*bcc_gen_fctn[(int) comparison]) (label));
|
emit_jump_insn (bcc_gen_fctn[(int) comparison] (label));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3566,7 +3550,7 @@ emit_cmp_and_jump_insn_1 (rtx x, rtx y, enum machine_mode mode,
|
|||||||
y = prepare_operand (icode, y, 1, mode, wider_mode, unsignedp);
|
y = prepare_operand (icode, y, 1, mode, wider_mode, unsignedp);
|
||||||
emit_insn (GEN_FCN (icode) (x, y));
|
emit_insn (GEN_FCN (icode) (x, y));
|
||||||
if (label)
|
if (label)
|
||||||
emit_jump_insn ((*bcc_gen_fctn[(int) comparison]) (label));
|
emit_jump_insn (bcc_gen_fctn[(int) comparison] (label));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3578,7 +3562,7 @@ emit_cmp_and_jump_insn_1 (rtx x, rtx y, enum machine_mode mode,
|
|||||||
}
|
}
|
||||||
while (wider_mode != VOIDmode);
|
while (wider_mode != VOIDmode);
|
||||||
|
|
||||||
abort ();
|
gcc_unreachable ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Generate code to compare X with Y so that the condition codes are
|
/* Generate code to compare X with Y so that the condition codes are
|
||||||
@ -3609,8 +3593,7 @@ emit_cmp_and_jump_insns (rtx x, rtx y, enum rtx_code comparison, rtx size,
|
|||||||
{
|
{
|
||||||
/* If we're not emitting a branch, this means some caller
|
/* If we're not emitting a branch, this means some caller
|
||||||
is out of sync. */
|
is out of sync. */
|
||||||
if (! label)
|
gcc_assert (label);
|
||||||
abort ();
|
|
||||||
|
|
||||||
op0 = y, op1 = x;
|
op0 = y, op1 = x;
|
||||||
comparison = swap_condition (comparison);
|
comparison = swap_condition (comparison);
|
||||||
@ -3681,8 +3664,7 @@ prepare_float_lib_cmp (rtx *px, rtx *py, enum rtx_code *pcomparison,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode == VOIDmode)
|
gcc_assert (mode != VOIDmode);
|
||||||
abort ();
|
|
||||||
|
|
||||||
if (mode != orig_mode)
|
if (mode != orig_mode)
|
||||||
{
|
{
|
||||||
@ -3740,7 +3722,7 @@ prepare_float_lib_cmp (rtx *px, rtx *py, enum rtx_code *pcomparison,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
abort ();
|
gcc_unreachable ();
|
||||||
}
|
}
|
||||||
equiv = simplify_gen_ternary (IF_THEN_ELSE, word_mode, word_mode,
|
equiv = simplify_gen_ternary (IF_THEN_ELSE, word_mode, word_mode,
|
||||||
equiv, true_rtx, false_rtx);
|
equiv, true_rtx, false_rtx);
|
||||||
@ -3772,8 +3754,8 @@ prepare_float_lib_cmp (rtx *px, rtx *py, enum rtx_code *pcomparison,
|
|||||||
void
|
void
|
||||||
emit_indirect_jump (rtx loc)
|
emit_indirect_jump (rtx loc)
|
||||||
{
|
{
|
||||||
if (! ((*insn_data[(int) CODE_FOR_indirect_jump].operand[0].predicate)
|
if (!insn_data[(int) CODE_FOR_indirect_jump].operand[0].predicate
|
||||||
(loc, Pmode)))
|
(loc, Pmode))
|
||||||
loc = copy_to_mode_reg (Pmode, loc);
|
loc = copy_to_mode_reg (Pmode, loc);
|
||||||
|
|
||||||
emit_jump_insn (gen_indirect_jump (loc));
|
emit_jump_insn (gen_indirect_jump (loc));
|
||||||
@ -3858,15 +3840,15 @@ emit_conditional_move (rtx target, enum rtx_code code, rtx op0, rtx op1,
|
|||||||
|
|
||||||
/* If the insn doesn't accept these operands, put them in pseudos. */
|
/* If the insn doesn't accept these operands, put them in pseudos. */
|
||||||
|
|
||||||
if (! (*insn_data[icode].operand[0].predicate)
|
if (!insn_data[icode].operand[0].predicate
|
||||||
(subtarget, insn_data[icode].operand[0].mode))
|
(subtarget, insn_data[icode].operand[0].mode))
|
||||||
subtarget = gen_reg_rtx (insn_data[icode].operand[0].mode);
|
subtarget = gen_reg_rtx (insn_data[icode].operand[0].mode);
|
||||||
|
|
||||||
if (! (*insn_data[icode].operand[2].predicate)
|
if (!insn_data[icode].operand[2].predicate
|
||||||
(op2, insn_data[icode].operand[2].mode))
|
(op2, insn_data[icode].operand[2].mode))
|
||||||
op2 = copy_to_mode_reg (insn_data[icode].operand[2].mode, op2);
|
op2 = copy_to_mode_reg (insn_data[icode].operand[2].mode, op2);
|
||||||
|
|
||||||
if (! (*insn_data[icode].operand[3].predicate)
|
if (!insn_data[icode].operand[3].predicate
|
||||||
(op3, insn_data[icode].operand[3].mode))
|
(op3, insn_data[icode].operand[3].mode))
|
||||||
op3 = copy_to_mode_reg (insn_data[icode].operand[3].mode, op3);
|
op3 = copy_to_mode_reg (insn_data[icode].operand[3].mode, op3);
|
||||||
|
|
||||||
@ -3990,17 +3972,17 @@ emit_conditional_add (rtx target, enum rtx_code code, rtx op0, rtx op1,
|
|||||||
|
|
||||||
/* If the insn doesn't accept these operands, put them in pseudos. */
|
/* If the insn doesn't accept these operands, put them in pseudos. */
|
||||||
|
|
||||||
if (! (*insn_data[icode].operand[0].predicate)
|
if (!insn_data[icode].operand[0].predicate
|
||||||
(target, insn_data[icode].operand[0].mode))
|
(target, insn_data[icode].operand[0].mode))
|
||||||
subtarget = gen_reg_rtx (insn_data[icode].operand[0].mode);
|
subtarget = gen_reg_rtx (insn_data[icode].operand[0].mode);
|
||||||
else
|
else
|
||||||
subtarget = target;
|
subtarget = target;
|
||||||
|
|
||||||
if (! (*insn_data[icode].operand[2].predicate)
|
if (!insn_data[icode].operand[2].predicate
|
||||||
(op2, insn_data[icode].operand[2].mode))
|
(op2, insn_data[icode].operand[2].mode))
|
||||||
op2 = copy_to_mode_reg (insn_data[icode].operand[2].mode, op2);
|
op2 = copy_to_mode_reg (insn_data[icode].operand[2].mode, op2);
|
||||||
|
|
||||||
if (! (*insn_data[icode].operand[3].predicate)
|
if (!insn_data[icode].operand[3].predicate
|
||||||
(op3, insn_data[icode].operand[3].mode))
|
(op3, insn_data[icode].operand[3].mode))
|
||||||
op3 = copy_to_mode_reg (insn_data[icode].operand[3].mode, op3);
|
op3 = copy_to_mode_reg (insn_data[icode].operand[3].mode, op3);
|
||||||
|
|
||||||
@ -4042,15 +4024,14 @@ gen_add2_insn (rtx x, rtx y)
|
|||||||
{
|
{
|
||||||
int icode = (int) add_optab->handlers[(int) GET_MODE (x)].insn_code;
|
int icode = (int) add_optab->handlers[(int) GET_MODE (x)].insn_code;
|
||||||
|
|
||||||
if (! ((*insn_data[icode].operand[0].predicate)
|
gcc_assert (insn_data[icode].operand[0].predicate
|
||||||
(x, insn_data[icode].operand[0].mode))
|
(x, insn_data[icode].operand[0].mode));
|
||||||
|| ! ((*insn_data[icode].operand[1].predicate)
|
gcc_assert (insn_data[icode].operand[1].predicate
|
||||||
(x, insn_data[icode].operand[1].mode))
|
(x, insn_data[icode].operand[1].mode));
|
||||||
|| ! ((*insn_data[icode].operand[2].predicate)
|
gcc_assert (insn_data[icode].operand[2].predicate
|
||||||
(y, insn_data[icode].operand[2].mode)))
|
(y, insn_data[icode].operand[2].mode));
|
||||||
abort ();
|
|
||||||
|
|
||||||
return (GEN_FCN (icode) (x, x, y));
|
return GEN_FCN (icode) (x, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Generate and return an insn body to add r1 and c,
|
/* Generate and return an insn body to add r1 and c,
|
||||||
@ -4061,15 +4042,15 @@ gen_add3_insn (rtx r0, rtx r1, rtx c)
|
|||||||
int icode = (int) add_optab->handlers[(int) GET_MODE (r0)].insn_code;
|
int icode = (int) add_optab->handlers[(int) GET_MODE (r0)].insn_code;
|
||||||
|
|
||||||
if (icode == CODE_FOR_nothing
|
if (icode == CODE_FOR_nothing
|
||||||
|| ! ((*insn_data[icode].operand[0].predicate)
|
|| !(insn_data[icode].operand[0].predicate
|
||||||
(r0, insn_data[icode].operand[0].mode))
|
(r0, insn_data[icode].operand[0].mode))
|
||||||
|| ! ((*insn_data[icode].operand[1].predicate)
|
|| !(insn_data[icode].operand[1].predicate
|
||||||
(r1, insn_data[icode].operand[1].mode))
|
(r1, insn_data[icode].operand[1].mode))
|
||||||
|| ! ((*insn_data[icode].operand[2].predicate)
|
|| !(insn_data[icode].operand[2].predicate
|
||||||
(c, insn_data[icode].operand[2].mode)))
|
(c, insn_data[icode].operand[2].mode)))
|
||||||
return NULL_RTX;
|
return NULL_RTX;
|
||||||
|
|
||||||
return (GEN_FCN (icode) (r0, r1, c));
|
return GEN_FCN (icode) (r0, r1, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -4077,20 +4058,19 @@ have_add2_insn (rtx x, rtx y)
|
|||||||
{
|
{
|
||||||
int icode;
|
int icode;
|
||||||
|
|
||||||
if (GET_MODE (x) == VOIDmode)
|
gcc_assert (GET_MODE (x) != VOIDmode);
|
||||||
abort ();
|
|
||||||
|
|
||||||
icode = (int) add_optab->handlers[(int) GET_MODE (x)].insn_code;
|
icode = (int) add_optab->handlers[(int) GET_MODE (x)].insn_code;
|
||||||
|
|
||||||
if (icode == CODE_FOR_nothing)
|
if (icode == CODE_FOR_nothing)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (! ((*insn_data[icode].operand[0].predicate)
|
if (!(insn_data[icode].operand[0].predicate
|
||||||
(x, insn_data[icode].operand[0].mode))
|
(x, insn_data[icode].operand[0].mode))
|
||||||
|| ! ((*insn_data[icode].operand[1].predicate)
|
|| !(insn_data[icode].operand[1].predicate
|
||||||
(x, insn_data[icode].operand[1].mode))
|
(x, insn_data[icode].operand[1].mode))
|
||||||
|| ! ((*insn_data[icode].operand[2].predicate)
|
|| !(insn_data[icode].operand[2].predicate
|
||||||
(y, insn_data[icode].operand[2].mode)))
|
(y, insn_data[icode].operand[2].mode)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -4103,15 +4083,14 @@ gen_sub2_insn (rtx x, rtx y)
|
|||||||
{
|
{
|
||||||
int icode = (int) sub_optab->handlers[(int) GET_MODE (x)].insn_code;
|
int icode = (int) sub_optab->handlers[(int) GET_MODE (x)].insn_code;
|
||||||
|
|
||||||
if (! ((*insn_data[icode].operand[0].predicate)
|
gcc_assert (insn_data[icode].operand[0].predicate
|
||||||
(x, insn_data[icode].operand[0].mode))
|
(x, insn_data[icode].operand[0].mode));
|
||||||
|| ! ((*insn_data[icode].operand[1].predicate)
|
gcc_assert (insn_data[icode].operand[1].predicate
|
||||||
(x, insn_data[icode].operand[1].mode))
|
(x, insn_data[icode].operand[1].mode));
|
||||||
|| ! ((*insn_data[icode].operand[2].predicate)
|
gcc_assert (insn_data[icode].operand[2].predicate
|
||||||
(y, insn_data[icode].operand[2].mode)))
|
(y, insn_data[icode].operand[2].mode));
|
||||||
abort ();
|
|
||||||
|
|
||||||
return (GEN_FCN (icode) (x, x, y));
|
return GEN_FCN (icode) (x, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Generate and return an insn body to subtract r1 and c,
|
/* Generate and return an insn body to subtract r1 and c,
|
||||||
@ -4122,15 +4101,15 @@ gen_sub3_insn (rtx r0, rtx r1, rtx c)
|
|||||||
int icode = (int) sub_optab->handlers[(int) GET_MODE (r0)].insn_code;
|
int icode = (int) sub_optab->handlers[(int) GET_MODE (r0)].insn_code;
|
||||||
|
|
||||||
if (icode == CODE_FOR_nothing
|
if (icode == CODE_FOR_nothing
|
||||||
|| ! ((*insn_data[icode].operand[0].predicate)
|
|| !(insn_data[icode].operand[0].predicate
|
||||||
(r0, insn_data[icode].operand[0].mode))
|
(r0, insn_data[icode].operand[0].mode))
|
||||||
|| ! ((*insn_data[icode].operand[1].predicate)
|
|| !(insn_data[icode].operand[1].predicate
|
||||||
(r1, insn_data[icode].operand[1].mode))
|
(r1, insn_data[icode].operand[1].mode))
|
||||||
|| ! ((*insn_data[icode].operand[2].predicate)
|
|| !(insn_data[icode].operand[2].predicate
|
||||||
(c, insn_data[icode].operand[2].mode)))
|
(c, insn_data[icode].operand[2].mode)))
|
||||||
return NULL_RTX;
|
return NULL_RTX;
|
||||||
|
|
||||||
return (GEN_FCN (icode) (r0, r1, c));
|
return GEN_FCN (icode) (r0, r1, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -4138,20 +4117,19 @@ have_sub2_insn (rtx x, rtx y)
|
|||||||
{
|
{
|
||||||
int icode;
|
int icode;
|
||||||
|
|
||||||
if (GET_MODE (x) == VOIDmode)
|
gcc_assert (GET_MODE (x) != VOIDmode);
|
||||||
abort ();
|
|
||||||
|
|
||||||
icode = (int) sub_optab->handlers[(int) GET_MODE (x)].insn_code;
|
icode = (int) sub_optab->handlers[(int) GET_MODE (x)].insn_code;
|
||||||
|
|
||||||
if (icode == CODE_FOR_nothing)
|
if (icode == CODE_FOR_nothing)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (! ((*insn_data[icode].operand[0].predicate)
|
if (!(insn_data[icode].operand[0].predicate
|
||||||
(x, insn_data[icode].operand[0].mode))
|
(x, insn_data[icode].operand[0].mode))
|
||||||
|| ! ((*insn_data[icode].operand[1].predicate)
|
|| !(insn_data[icode].operand[1].predicate
|
||||||
(x, insn_data[icode].operand[1].mode))
|
(x, insn_data[icode].operand[1].mode))
|
||||||
|| ! ((*insn_data[icode].operand[2].predicate)
|
|| !(insn_data[icode].operand[2].predicate
|
||||||
(y, insn_data[icode].operand[2].mode)))
|
(y, insn_data[icode].operand[2].mode)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -4265,8 +4243,7 @@ expand_float (rtx to, rtx from, int unsignedp)
|
|||||||
enum machine_mode fmode, imode;
|
enum machine_mode fmode, imode;
|
||||||
|
|
||||||
/* Crash now, because we won't be able to decide which mode to use. */
|
/* Crash now, because we won't be able to decide which mode to use. */
|
||||||
if (GET_MODE (from) == VOIDmode)
|
gcc_assert (GET_MODE (from) != VOIDmode);
|
||||||
abort ();
|
|
||||||
|
|
||||||
/* Look for an insn to do the conversion. Do it in the specified
|
/* Look for an insn to do the conversion. Do it in the specified
|
||||||
modes if possible; otherwise convert either input, output or both to
|
modes if possible; otherwise convert either input, output or both to
|
||||||
@ -4427,8 +4404,7 @@ expand_float (rtx to, rtx from, int unsignedp)
|
|||||||
from = force_not_mem (from);
|
from = force_not_mem (from);
|
||||||
|
|
||||||
libfunc = tab->handlers[GET_MODE (to)][GET_MODE (from)].libfunc;
|
libfunc = tab->handlers[GET_MODE (to)][GET_MODE (from)].libfunc;
|
||||||
if (!libfunc)
|
gcc_assert (libfunc);
|
||||||
abort ();
|
|
||||||
|
|
||||||
start_sequence ();
|
start_sequence ();
|
||||||
|
|
||||||
@ -4611,8 +4587,7 @@ expand_fix (rtx to, rtx from, int unsignedp)
|
|||||||
|
|
||||||
convert_optab tab = unsignedp ? ufix_optab : sfix_optab;
|
convert_optab tab = unsignedp ? ufix_optab : sfix_optab;
|
||||||
libfunc = tab->handlers[GET_MODE (to)][GET_MODE (from)].libfunc;
|
libfunc = tab->handlers[GET_MODE (to)][GET_MODE (from)].libfunc;
|
||||||
if (!libfunc)
|
gcc_assert (libfunc);
|
||||||
abort ();
|
|
||||||
|
|
||||||
if (flag_force_mem)
|
if (flag_force_mem)
|
||||||
from = force_not_mem (from);
|
from = force_not_mem (from);
|
||||||
@ -5267,8 +5242,7 @@ debug_optab_libfuncs (void)
|
|||||||
h = &o->handlers[j];
|
h = &o->handlers[j];
|
||||||
if (h->libfunc)
|
if (h->libfunc)
|
||||||
{
|
{
|
||||||
if (GET_CODE (h->libfunc) != SYMBOL_REF)
|
gcc_assert (GET_CODE (h->libfunc) = SYMBOL_REF);
|
||||||
abort ();
|
|
||||||
fprintf (stderr, "%s\t%s:\t%s\n",
|
fprintf (stderr, "%s\t%s:\t%s\n",
|
||||||
GET_RTX_NAME (o->code),
|
GET_RTX_NAME (o->code),
|
||||||
GET_MODE_NAME (j),
|
GET_MODE_NAME (j),
|
||||||
@ -5288,8 +5262,7 @@ debug_optab_libfuncs (void)
|
|||||||
h = &o->handlers[j][k];
|
h = &o->handlers[j][k];
|
||||||
if (h->libfunc)
|
if (h->libfunc)
|
||||||
{
|
{
|
||||||
if (GET_CODE (h->libfunc) != SYMBOL_REF)
|
gcc_assert (GET_CODE (h->libfunc) = SYMBOL_REF);
|
||||||
abort ();
|
|
||||||
fprintf (stderr, "%s\t%s\t%s:\t%s\n",
|
fprintf (stderr, "%s\t%s\t%s:\t%s\n",
|
||||||
GET_RTX_NAME (o->code),
|
GET_RTX_NAME (o->code),
|
||||||
GET_MODE_NAME (j),
|
GET_MODE_NAME (j),
|
||||||
@ -5334,6 +5307,7 @@ gen_cond_trap (enum rtx_code code ATTRIBUTE_UNUSED, rtx op1,
|
|||||||
emit_insn (GEN_FCN (icode) (op1, op2));
|
emit_insn (GEN_FCN (icode) (op1, op2));
|
||||||
|
|
||||||
PUT_CODE (trap_rtx, code);
|
PUT_CODE (trap_rtx, code);
|
||||||
|
gcc_assert (HAVE_conditional_trap);
|
||||||
insn = gen_conditional_trap (trap_rtx, tcode);
|
insn = gen_conditional_trap (trap_rtx, tcode);
|
||||||
if (insn)
|
if (insn)
|
||||||
{
|
{
|
||||||
@ -5399,7 +5373,7 @@ get_rtx_code (enum tree_code tcode, bool unsignedp)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
abort ();
|
gcc_unreachable ();
|
||||||
}
|
}
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
@ -5414,29 +5388,23 @@ vector_compare_rtx (tree cond, bool unsignedp, enum insn_code icode)
|
|||||||
tree t_op0, t_op1;
|
tree t_op0, t_op1;
|
||||||
rtx rtx_op0, rtx_op1;
|
rtx rtx_op0, rtx_op1;
|
||||||
|
|
||||||
if (!COMPARISON_CLASS_P (cond))
|
/* This is unlikely. While generating VEC_COND_EXPR, auto vectorizer
|
||||||
{
|
ensures that condition is a relational operation. */
|
||||||
/* This is unlikely. While generating VEC_COND_EXPR,
|
gcc_assert (COMPARISON_CLASS_P (cond));
|
||||||
auto vectorizer ensures that condition is a relational
|
|
||||||
operation. */
|
|
||||||
abort ();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
rcode = get_rtx_code (TREE_CODE (cond), unsignedp);
|
|
||||||
t_op0 = TREE_OPERAND (cond, 0);
|
|
||||||
t_op1 = TREE_OPERAND (cond, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
rcode = get_rtx_code (TREE_CODE (cond), unsignedp);
|
||||||
|
t_op0 = TREE_OPERAND (cond, 0);
|
||||||
|
t_op1 = TREE_OPERAND (cond, 1);
|
||||||
|
|
||||||
/* Expand operands. */
|
/* Expand operands. */
|
||||||
rtx_op0 = expand_expr (t_op0, NULL_RTX, TYPE_MODE (TREE_TYPE (t_op0)), 1);
|
rtx_op0 = expand_expr (t_op0, NULL_RTX, TYPE_MODE (TREE_TYPE (t_op0)), 1);
|
||||||
rtx_op1 = expand_expr (t_op1, NULL_RTX, TYPE_MODE (TREE_TYPE (t_op1)), 1);
|
rtx_op1 = expand_expr (t_op1, NULL_RTX, TYPE_MODE (TREE_TYPE (t_op1)), 1);
|
||||||
|
|
||||||
if (!(*insn_data[icode].operand[4].predicate) (rtx_op0, GET_MODE (rtx_op0))
|
if (!insn_data[icode].operand[4].predicate (rtx_op0, GET_MODE (rtx_op0))
|
||||||
&& GET_MODE (rtx_op0) != VOIDmode)
|
&& GET_MODE (rtx_op0) != VOIDmode)
|
||||||
rtx_op0 = force_reg (GET_MODE (rtx_op0), rtx_op0);
|
rtx_op0 = force_reg (GET_MODE (rtx_op0), rtx_op0);
|
||||||
|
|
||||||
if (!(*insn_data[icode].operand[5].predicate) (rtx_op1, GET_MODE (rtx_op1))
|
if (!insn_data[icode].operand[5].predicate (rtx_op1, GET_MODE (rtx_op1))
|
||||||
&& GET_MODE (rtx_op1) != VOIDmode)
|
&& GET_MODE (rtx_op1) != VOIDmode)
|
||||||
rtx_op1 = force_reg (GET_MODE (rtx_op1), rtx_op1);
|
rtx_op1 = force_reg (GET_MODE (rtx_op1), rtx_op1);
|
||||||
|
|
||||||
@ -5493,13 +5461,13 @@ expand_vec_cond_expr (tree vec_cond_expr, rtx target)
|
|||||||
/* Expand both operands and force them in reg, if required. */
|
/* Expand both operands and force them in reg, if required. */
|
||||||
rtx_op1 = expand_expr (TREE_OPERAND (vec_cond_expr, 1),
|
rtx_op1 = expand_expr (TREE_OPERAND (vec_cond_expr, 1),
|
||||||
NULL_RTX, VOIDmode, 1);
|
NULL_RTX, VOIDmode, 1);
|
||||||
if (!(*insn_data[icode].operand[1].predicate) (rtx_op1, mode)
|
if (!insn_data[icode].operand[1].predicate (rtx_op1, mode)
|
||||||
&& mode != VOIDmode)
|
&& mode != VOIDmode)
|
||||||
rtx_op1 = force_reg (mode, rtx_op1);
|
rtx_op1 = force_reg (mode, rtx_op1);
|
||||||
|
|
||||||
rtx_op2 = expand_expr (TREE_OPERAND (vec_cond_expr, 2),
|
rtx_op2 = expand_expr (TREE_OPERAND (vec_cond_expr, 2),
|
||||||
NULL_RTX, VOIDmode, 1);
|
NULL_RTX, VOIDmode, 1);
|
||||||
if (!(*insn_data[icode].operand[2].predicate) (rtx_op2, mode)
|
if (!insn_data[icode].operand[2].predicate (rtx_op2, mode)
|
||||||
&& mode != VOIDmode)
|
&& mode != VOIDmode)
|
||||||
rtx_op2 = force_reg (mode, rtx_op2);
|
rtx_op2 = force_reg (mode, rtx_op2);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user