/* In IEEE floating point, x+0 is not the same as x. Similarly
for the other optimizations below. */
if (TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT
- && GET_MODE_CLASS (mode) != MODE_INT)
+ && FLOAT_MODE_P (mode))
break;
if (op1 == CONST0_RTX (mode))
The inaccuracy makes it nonassociative,
and subtle programs can break if operations are associated. */
- if ((GET_MODE_CLASS (mode) == MODE_INT
- || GET_MODE_CLASS (mode) == MODE_PARTIAL_INT)
+ if (INTEGRAL_MODE_P (mode)
&& (GET_CODE (op0) == PLUS || GET_CODE (op0) == MINUS
|| GET_CODE (op1) == PLUS || GET_CODE (op1) == MINUS)
&& (tem = simplify_plus_minus (code, mode, op0, op1)) != 0)
In IEEE floating point, x-0 is not the same as x. */
if ((TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
- || GET_MODE_CLASS (mode) == MODE_INT)
+ || ! FLOAT_MODE_P (mode))
&& op1 == CONST0_RTX (mode))
return op0;
#else
/* None of these optimizations can be done for IEEE
floating point. */
if (TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT
- && GET_MODE_CLASS (mode) != MODE_INT
- && GET_MODE_CLASS (mode) != MODE_PARTIAL_INT)
+ && ! FLOAT_MODE_P (mode))
break;
/* We can't assume x-x is 0 even with non-IEEE floating point. */
if (rtx_equal_p (op0, op1)
&& ! side_effects_p (op0)
- && GET_MODE_CLASS (mode) != MODE_FLOAT
- && GET_MODE_CLASS (mode) != MODE_COMPLEX_FLOAT)
+ && ! FLOAT_MODE_P (mode))
return const0_rtx;
/* Change subtraction from zero into negation. */
The inaccuracy makes it nonassociative,
and subtle programs can break if operations are associated. */
- if ((GET_MODE_CLASS (mode) == MODE_INT
- || GET_MODE_CLASS (mode) == MODE_PARTIAL_INT)
+ if (INTEGRAL_MODE_P (mode)
&& (GET_CODE (op0) == PLUS || GET_CODE (op0) == MINUS
|| GET_CODE (op1) == PLUS || GET_CODE (op1) == MINUS)
&& (tem = simplify_plus_minus (code, mode, op0, op1)) != 0)
/* In IEEE floating point, x*0 is not always 0. */
if ((TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
- || GET_MODE_CLASS (mode) == MODE_INT)
+ && ! FLOAT_MODE_P (mode))
&& op1 == CONST0_RTX (mode)
&& ! side_effects_p (op0))
return op1;
/* In IEEE floating point, 0/x is not always 0. */
if ((TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
- || GET_MODE_CLASS (mode) == MODE_INT)
+ || ! FLOAT_MODE_P (mode))
&& op0 == CONST0_RTX (mode)
&& ! side_effects_p (op1))
return op0;
the result. */
if (rtx_equal_p (op0, op1)
&& (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
- || GET_MODE_CLASS (GET_MODE (op0)) != MODE_FLOAT))
+ || ! FLOAT_MODE_P (GET_MODE (op0))))
return (code == EQ || code == GE || code == LE || code == LEU
|| code == GEU) ? const_true_rtx : const0_rtx;
case GEU:
/* Unsigned values are never negative, but we must be sure we are
actually comparing a value, not a CC operand. */
- if (op1 == const0_rtx
- && GET_MODE_CLASS (mode) == MODE_INT)
+ if (op1 == const0_rtx && INTEGRAL_MODE_P (mode))
return const_true_rtx;
break;
case LTU:
- if (op1 == const0_rtx
- && GET_MODE_CLASS (mode) == MODE_INT)
+ if (op1 == const0_rtx && INTEGRAL_MODE_P (mode))
return const0_rtx;
break;
unsigned value. */
if (GET_CODE (op1) == CONST_INT
&& INTVAL (op1) == GET_MODE_MASK (mode)
- && GET_MODE_CLASS (mode) == MODE_INT)
+ && INTEGRAL_MODE_P (mode))
return const_true_rtx;
break;
case GTU:
if (GET_CODE (op1) == CONST_INT
&& INTVAL (op1) == GET_MODE_MASK (mode)
- && GET_MODE_CLASS (mode) == MODE_INT)
+ && INTEGRAL_MODE_P (mode))
return const0_rtx;
break;
}
since x might be a NaN. */
if ((TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
- || GET_MODE_CLASS (mode_arg0) != MODE_FLOAT)
+ || ! FLOAT_MODE_P (mode_arg0))
&& (folded_arg0 == folded_arg1
|| (GET_CODE (folded_arg0) == REG
&& GET_CODE (folded_arg1) == REG
&& (comparison_dominates_p (qty_comparison_code[qty], code)
|| (comparison_dominates_p (qty_comparison_code[qty],
reverse_condition (code))
- && GET_MODE_CLASS (mode_arg0) == MODE_INT))
+ && ! FLOAT_MODE_P (mode_arg0)))
&& (rtx_equal_p (qty_comparison_const[qty], folded_arg1)
|| (const_arg1
&& rtx_equal_p (qty_comparison_const[qty],
If we record the equality, we might inadvertently delete code
whose intent was to change -0 to +0. */
- if (code != EQ || GET_MODE_CLASS (GET_MODE (op0)) == MODE_FLOAT)
+ if (code != EQ || FLOAT_MODE_P (GET_MODE (op0)))
{
/* If we reversed a floating-point comparison, if OP0 is not a
register, or if OP1 is neither a register or constant, we can't
if (GET_CODE (op1) != REG)
op1 = equiv_constant (op1);
- if ((reversed_nonequality && GET_MODE_CLASS (mode) != MODE_INT)
+ if ((reversed_nonequality && FLOAT_MODE_P (mode))
|| GET_CODE (op0) != REG || op1 == 0)
return;
{
this_insn_cc0 = src_const && mode != VOIDmode ? src_const : src;
this_insn_cc0_mode = mode;
- if (GET_MODE_CLASS (mode) == MODE_FLOAT)
+ if (FLOAT_MODE_P (mode))
this_insn_cc0 = gen_rtx (COMPARE, VOIDmode, this_insn_cc0,
CONST0_RTX (mode));
}
memory. */
if ((flag_float_store
&& GET_CODE (dest) == MEM
- && GET_MODE_CLASS (GET_MODE (dest)) == MODE_FLOAT)
+ && FLOAT_MODE_P (GET_MODE (dest)))
/* Don't record values of destinations set inside a libcall block
since we might delete the libcall. Things should have been set
up so we won't want to reuse such a value, but we play it safe