extern const char * output_probe_stack_range (rtx, rtx, rtx);
extern void rs6000_emit_dot_insn (rtx dst, rtx src, int dot, rtx ccreg);
extern bool rs6000_emit_set_const (rtx, rtx);
-extern int rs6000_emit_cmove (rtx, rtx, rtx, rtx);
-extern int rs6000_emit_int_cmove (rtx, rtx, rtx, rtx);
+extern bool rs6000_emit_cmove (rtx, rtx, rtx, rtx);
+extern bool rs6000_emit_int_cmove (rtx, rtx, rtx, rtx);
extern int rs6000_emit_vector_cond_expr (rtx, rtx, rtx, rtx, rtx, rtx);
extern void rs6000_emit_minmax (rtx, enum rtx_code, rtx, rtx);
extern void rs6000_expand_atomic_compare_and_swap (rtx op[]);
operands of the last comparison is nonzero/true, FALSE_COND if it
is zero/false. Return 0 if the hardware has no such operation. */
-int
+bool
rs6000_emit_cmove (rtx dest, rtx op, rtx true_cond, rtx false_cond)
{
enum rtx_code code = GET_CODE (op);
/* In the isel case however, we can use a compare immediate, so
op1 may be a small constant. */
&& (!TARGET_ISEL || !short_cint_operand (op1, VOIDmode)))
- return 0;
+ return false;
if (GET_MODE (true_cond) != result_mode)
- return 0;
+ return false;
if (GET_MODE (false_cond) != result_mode)
- return 0;
+ return false;
/* See if we can use the ISA 3.0 (power9) min/max/compare functions. */
if (TARGET_P9_MINMAX
&& (result_mode == SFmode || result_mode == DFmode))
{
if (rs6000_emit_p9_fp_minmax (dest, op, true_cond, false_cond))
- return 1;
+ return true;
if (rs6000_emit_p9_fp_cmove (dest, op, true_cond, false_cond))
- return 1;
+ return true;
}
/* Don't allow using floating point comparisons for integer results for
now. */
if (FLOAT_MODE_P (compare_mode) && !FLOAT_MODE_P (result_mode))
- return 0;
+ return false;
/* First, work out if the hardware can do this at all, or
if it's too slow.... */
{
if (TARGET_ISEL)
return rs6000_emit_int_cmove (dest, op, true_cond, false_cond);
- return 0;
+ return false;
}
is_against_zero = op1 == CONST0_RTX (compare_mode);
generated. */
if (SCALAR_FLOAT_MODE_P (compare_mode)
&& flag_trapping_math && ! is_against_zero)
- return 0;
+ return false;
/* Eliminate half of the comparisons by switching operands, this
makes the remaining code simpler. */
/* UNEQ and LTGT take four instructions for a comparison with zero,
it'll probably be faster to use a branch here too. */
if (code == UNEQ && HONOR_NANS (compare_mode))
- return 0;
+ return false;
/* We're going to try to implement comparisons by performing
a subtract, then comparing against zero. Unfortunately,
&& ((! rtx_equal_p (op0, false_cond) && ! rtx_equal_p (op1, false_cond))
|| (! rtx_equal_p (op0, true_cond)
&& ! rtx_equal_p (op1, true_cond))))
- return 0;
+ return false;
/* At this point we know we can use fsel. */
/* Don't allow compare_mode other than SFmode or DFmode, for others there
is no fsel instruction. */
if (compare_mode != SFmode && compare_mode != DFmode)
- return 0;
+ return false;
/* Reduce the comparison to a comparison against zero. */
if (! is_against_zero)
gen_rtx_GE (VOIDmode,
op0, op1),
true_cond, false_cond)));
- return 1;
+ return true;
}
/* Same as above, but for ints (isel). */
-int
+bool
rs6000_emit_int_cmove (rtx dest, rtx op, rtx true_cond, rtx false_cond)
{
rtx condition_rtx, cr;
bool signedp;
if (mode != SImode && (!TARGET_POWERPC64 || mode != DImode))
- return 0;
+ return false;
/* We still have to do the compare, because isel doesn't do a
compare, it just looks at the CRx bits set by a previous compare
emit_insn (isel_func (dest, condition_rtx, true_cond, false_cond, cr));
- return 1;
+ return true;
}
void