From ca15abc0ff7cb5e821a8c1d69e9b37416d5390c5 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Fri, 30 Jun 2023 16:04:02 +0200 Subject: fold-const+optabs: Change return type of predicate functions from int to bool Also change some internal variables and function argument from int to bool. gcc/ChangeLog: * fold-const.h (multiple_of_p): Change return type from int to bool. * fold-const.cc (split_tree): Change negl_p, neg_litp_p, neg_conp_p and neg_var_p variables to bool. (const_binop): Change sat_p variable to bool. (merge_ranges): Change no_overlap variable to bool. (extract_muldiv_1): Change same_p variable to bool. (tree_swap_operands_p): Update function body for bool return type. (fold_truth_andor): Change commutative variable to bool. (multiple_of_p): Change return type from int to void and adjust function body accordingly. * optabs.h (expand_twoval_unop): Change return type from int to bool. (expand_twoval_binop): Ditto. (can_compare_p): Ditto. (have_add2_insn): Ditto. (have_addptr3_insn): Ditto. (have_sub2_insn): Ditto. (have_insn_for): Ditto. * optabs.cc (add_equal_note): Ditto. (widen_operand): Change no_extend argument from int to bool. (expand_binop): Ditto. (expand_twoval_unop): Change return type from int to void and adjust function body accordingly. (expand_twoval_binop): Ditto. (can_compare_p): Ditto. (have_add2_insn): Ditto. (have_addptr3_insn): Ditto. (have_sub2_insn): Ditto. (have_insn_for): Ditto. --- gcc/optabs.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'gcc/optabs.h') diff --git a/gcc/optabs.h b/gcc/optabs.h index 29ccbe9..781d554 100644 --- a/gcc/optabs.h +++ b/gcc/optabs.h @@ -200,10 +200,10 @@ extern rtx sign_expand_binop (machine_mode, optab, optab, rtx, rtx, rtx, int, enum optab_methods); /* Generate code to perform an operation on one operand with two results. */ -extern int expand_twoval_unop (optab, rtx, rtx, rtx, int); +extern bool expand_twoval_unop (optab, rtx, rtx, rtx, int); /* Generate code to perform an operation on two operands with two results. */ -extern int expand_twoval_binop (optab, rtx, rtx, rtx, rtx, int); +extern bool expand_twoval_binop (optab, rtx, rtx, rtx, rtx, int); /* Generate code to perform an operation on two operands with two results, using a library function. */ @@ -243,8 +243,8 @@ enum can_compare_purpose /* Nonzero if a compare of mode MODE can be done straightforwardly (without splitting it into pieces). */ -extern int can_compare_p (enum rtx_code, machine_mode, - enum can_compare_purpose); +extern bool can_compare_p (enum rtx_code, machine_mode, + enum can_compare_purpose); /* Return whether the backend can emit a vector comparison (vec_cmp/vec_cmpu) for code CODE, comparing operands of mode VALUE_MODE and producing a result @@ -298,12 +298,12 @@ rtx emit_conditional_add (rtx, enum rtx_code, rtx, rtx, machine_mode, Likewise for subtraction and for just copying. */ extern rtx_insn *gen_add2_insn (rtx, rtx); extern rtx_insn *gen_add3_insn (rtx, rtx, rtx); -extern int have_add2_insn (rtx, rtx); +extern bool have_add2_insn (rtx, rtx); extern rtx_insn *gen_addptr3_insn (rtx, rtx, rtx); -extern int have_addptr3_insn (rtx, rtx, rtx); +extern bool have_addptr3_insn (rtx, rtx, rtx); extern rtx_insn *gen_sub2_insn (rtx, rtx); extern rtx_insn *gen_sub3_insn (rtx, rtx, rtx); -extern int have_sub2_insn (rtx, rtx); +extern bool have_sub2_insn (rtx, rtx); /* Generate the body of an insn to extend Y (with mode MFROM) into X (with mode MTO). Do zero-extension if UNSIGNEDP is nonzero. */ @@ -323,7 +323,7 @@ extern bool expand_sfix_optab (rtx, rtx, convert_optab); /* Report whether the machine description contains an insn which can perform the operation described by CODE and MODE. */ -extern int have_insn_for (enum rtx_code, machine_mode); +extern bool have_insn_for (enum rtx_code, machine_mode); /* Generate a conditional trap instruction. */ extern rtx_insn *gen_cond_trap (enum rtx_code, rtx, rtx, rtx); -- cgit v1.1