...));
static rtx gen_binary PROTO((enum rtx_code, enum machine_mode,
rtx, rtx));
-static rtx gen_unary PROTO((enum rtx_code, enum machine_mode, rtx));
+static rtx gen_unary PROTO((enum rtx_code, enum machine_mode,
+ enum machine_mode, rtx));
static enum rtx_code simplify_comparison PROTO((enum rtx_code, rtx *, rtx *));
static int reversible_comparison_p PROTO((rtx));
static void update_table_tick PROTO((rtx));
else if (GET_CODE (true) == CONST_INT
&& INTVAL (true) == - STORE_FLAG_VALUE
&& false == const0_rtx)
- x = gen_unary (NEG, mode,
+ x = gen_unary (NEG, mode, mode,
gen_binary (cond_code, mode, cond, cop1));
else if (GET_CODE (false) == CONST_INT
&& INTVAL (false) == - STORE_FLAG_VALUE
&& true == const0_rtx)
- x = gen_unary (NEG, mode,
+ x = gen_unary (NEG, mode, mode,
gen_binary (reverse_condition (cond_code),
mode, cond, cop1));
else
but this doesn't seem common enough to bother with. */
if (GET_CODE (XEXP (x, 0)) == ASHIFT
&& XEXP (XEXP (x, 0), 0) == const1_rtx)
- return gen_rtx (ROTATE, mode, gen_unary (NOT, mode, const1_rtx),
+ return gen_rtx (ROTATE, mode, gen_unary (NOT, mode, mode, const1_rtx),
XEXP (XEXP (x, 0), 1));
if (GET_CODE (XEXP (x, 0)) == SUBREG
enum machine_mode inner_mode = GET_MODE (SUBREG_REG (XEXP (x, 0)));
x = gen_rtx (ROTATE, inner_mode,
- gen_unary (NOT, inner_mode, const1_rtx),
+ gen_unary (NOT, inner_mode, inner_mode, const1_rtx),
XEXP (SUBREG_REG (XEXP (x, 0)), 1));
return gen_lowpart_for_combine (mode, x);
}
|| GET_CODE (XEXP (x, 0)) == NEG)
&& GET_CODE (XEXP (XEXP (x, 0), 0)) == FLOAT_EXTEND
&& GET_MODE (XEXP (XEXP (XEXP (x, 0), 0), 0)) == mode)
- return gen_unary (GET_CODE (XEXP (x, 0)),
- mode, XEXP (XEXP (XEXP (x, 0), 0), 0));
+ return gen_unary (GET_CODE (XEXP (x, 0)), mode, mode,
+ XEXP (XEXP (XEXP (x, 0), 0), 0));
break;
#ifdef HAVE_cc0
&& ((STORE_FLAG_VALUE == -1 && XEXP (x, 1) == const1_rtx)
|| (STORE_FLAG_VALUE == 1 && XEXP (x, 1) == constm1_rtx)))
return
- gen_unary (NEG, mode,
+ gen_unary (NEG, mode, mode,
gen_binary (reverse_condition (GET_CODE (XEXP (x, 0))),
mode, XEXP (XEXP (x, 0), 0),
XEXP (XEXP (x, 0), 1)));
== GET_MODE_BITSIZE (mode)))
{
op0 = expand_compound_operation (op0);
- return gen_unary (NEG, mode,
+ return gen_unary (NEG, mode, mode,
gen_lowpart_for_combine (mode, op0));
}
&& nonzero_bits (op0, mode) == 1)
{
op0 = expand_compound_operation (op0);
- return gen_unary (NEG, mode,
+ return gen_unary (NEG, mode, mode,
gen_lowpart_for_combine (mode, op0));
}
== GET_MODE_BITSIZE (mode)))
{
op0 = expand_compound_operation (op0);
- return gen_unary (NOT, mode,
+ return gen_unary (NOT, mode, mode,
gen_lowpart_for_combine (mode, op0));
}
{
case GT:
case GE:
- return gen_unary (ABS, mode, true);
+ return gen_unary (ABS, mode, mode, true);
case LT:
case LE:
- return gen_unary (NEG, mode, gen_unary (ABS, mode, true));
+ return gen_unary (NEG, mode, mode, gen_unary (ABS, mode, mode, true));
}
/* Look for MIN or MAX. */
temp = gen_binary (op, m, gen_lowpart_for_combine (m, z), temp);
if (extend_op != NIL)
- temp = gen_unary (extend_op, mode, temp);
+ temp = gen_unary (extend_op, mode, m, temp);
return temp;
}
term2 = gen_binary (AND, GET_MODE (src), XEXP (XEXP (src, 0), 0), true);
term3 = gen_binary (AND, GET_MODE (src),
- gen_unary (NOT, GET_MODE (src),
+ gen_unary (NOT, GET_MODE (src), GET_MODE (src),
XEXP (XEXP (src, 0), 0)),
false);
if (GET_CODE (op0) == XOR
&& rtx_equal_p (XEXP (op0, 0), op1)
&& ! side_effects_p (op1))
- x = gen_binary (AND, mode, gen_unary (NOT, mode, XEXP (op0, 1)), op1);
+ x = gen_binary (AND, mode,
+ gen_unary (NOT, mode, mode, XEXP (op0, 1)), op1);
if (GET_CODE (op0) == XOR
&& rtx_equal_p (XEXP (op0, 1), op1)
&& ! side_effects_p (op1))
- x = gen_binary (AND, mode, gen_unary (NOT, mode, XEXP (op0, 0)), op1);
+ x = gen_binary (AND, mode,
+ gen_unary (NOT, mode, mode, XEXP (op0, 0)), op1);
/* Similarly for (~ (A ^ B)) & A. */
if (GET_CODE (op0) == NOT
SUBST (XEXP (x, 1), op1);
}
else if (num_negated == 1)
- return gen_unary (NOT, mode, gen_binary (XOR, mode, op0, op1));
+ return gen_unary (NOT, mode, mode, gen_binary (XOR, mode, op0, op1));
}
/* Convert (xor (and A B) B) to (and (not A) B). The latter may
if (GET_CODE (op0) == AND
&& rtx_equal_p (XEXP (op0, 1), op1)
&& ! side_effects_p (op1))
- return gen_binary (AND, mode, gen_unary (NOT, mode, XEXP (op0, 0)),
+ return gen_binary (AND, mode,
+ gen_unary (NOT, mode, mode, XEXP (op0, 0)),
op1);
else if (GET_CODE (op0) == AND
&& rtx_equal_p (XEXP (op0, 0), op1)
&& ! side_effects_p (op1))
- return gen_binary (AND, mode, gen_unary (NOT, mode, XEXP (op0, 1)),
+ return gen_binary (AND, mode,
+ gen_unary (NOT, mode, mode, XEXP (op0, 1)),
op1);
#if STORE_FLAG_VALUE == 1
gen_binary (IOR, compute_mode,
gen_binary (AND, compute_mode,
gen_unary (NOT, compute_mode,
+ compute_mode,
gen_binary (ASHIFT,
compute_mode,
mask, pos)),
case NEG: case NOT:
if ((tem = extract_left_shift (XEXP (x, 0), count)) != 0)
- return gen_unary (code, mode, tem);
+ return gen_unary (code, mode, mode, tem);
break;
force_to_mode (XEXP (x, 0), mode, mask,
reg, next_select));
if (op_mode != GET_MODE (x) || op0 != XEXP (x, 0))
- x = gen_unary (code, op_mode, op0);
+ x = gen_unary (code, op_mode, op_mode, op0);
break;
case NE:
if (GET_RTX_CLASS (code) == '1'
&& (cond0 = if_then_else_cond (XEXP (x, 0), &true0, &false0)) != 0)
{
- *ptrue = gen_unary (code, mode, true0);
- *pfalse = gen_unary (code, mode, false0);
+ *ptrue = gen_unary (code, mode, GET_MODE (XEXP (x, 0)), true0);
+ *pfalse = gen_unary (code, mode, GET_MODE (XEXP (x, 0)), false0);
return cond0;
}
*ptrue = gen_binary (MULT, mode, op0, const_true_rtx);
*pfalse = gen_binary (MULT, mode,
(code == MINUS
- ? gen_unary (NEG, mode, op1) : op1),
+ ? gen_unary (NEG, mode, mode, op1) : op1),
const_true_rtx);
return cond0;
}
case GE: case GT: case EQ:
return XEXP (x, 0);
case LT: case LE:
- return gen_unary (NEG, GET_MODE (XEXP (x, 0)), XEXP (x, 0));
+ return gen_unary (NEG, GET_MODE (XEXP (x, 0)), GET_MODE (XEXP (x, 0)),
+ XEXP (x, 0));
}
/* The only other cases we handle are MIN, MAX, and comparisons if the
if (code == XOR && inner_code == IOR)
{
inner_code = AND;
- other = gen_unary (NOT, GET_MODE (x), other);
+ other = gen_unary (NOT, GET_MODE (x), GET_MODE (x), other);
}
/* We may be able to continuing distributing the result, so call
/* If COMPLEMENT_P is set, we have to complement X before doing the outer
operation. */
if (complement_p)
- x = gen_unary (NOT, result_mode, x);
+ x = gen_unary (NOT, result_mode, result_mode, x);
if (outer_op != NIL)
{
equivalent to a constant. This should be rare. */
x = GEN_INT (outer_const);
else if (GET_RTX_CLASS (outer_op) == '1')
- x = gen_unary (outer_op, result_mode, x);
+ x = gen_unary (outer_op, result_mode, result_mode, x);
else
x = gen_binary (outer_op, result_mode, x, GEN_INT (outer_const));
}
}
static rtx
-gen_unary (code, mode, op0)
+gen_unary (code, mode, op0_mode, op0)
enum rtx_code code;
- enum machine_mode mode;
+ enum machine_mode mode, op0_mode;
rtx op0;
{
- rtx result = simplify_unary_operation (code, mode, op0, mode);
+ rtx result = simplify_unary_operation (code, mode, op0, op0_mode);
if (result)
return result;