diff options
| author | Uros Bizjak <ubizjak@gmail.com> | 2021-07-01 15:18:50 +0200 |
|---|---|---|
| committer | Uros Bizjak <ubizjak@gmail.com> | 2021-07-01 15:19:28 +0200 |
| commit | a86b3453fc6e29cf0e19916b01c393652d838d56 (patch) | |
| tree | 235b7c2918275cc5f4f351ef824ebbd24345bb16 /gcc/genpreds.c | |
| parent | 0a77c07b9b3fe83679358c3ef57721e09e2ad5fb (diff) | |
| download | gcc-a86b3453fc6e29cf0e19916b01c393652d838d56.zip gcc-a86b3453fc6e29cf0e19916b01c393652d838d56.tar.gz gcc-a86b3453fc6e29cf0e19916b01c393652d838d56.tar.bz2 | |
Change the type of predicates to bool.
The patch was tested on many targets, but some fallout is expected.
To fix the build error, simply change the function type from int to bool,
as was done in the patch for several targets.
2021-07-01 Uroš Bizjak <ubizjak@gmail.com>
gcc/
* genpreds.c (write_predicate_subfunction):
Change the type of written subfunction to bool.
(write_one_predicate_function):
Change the type of written function to bool.
(write_tm_preds_h): Ditto.
* recog.h (*insn_operand_predicate_fn): Change the type to bool.
* recog.c (general_operand): Change the type to bool.
(address_operand): Ditto.
(register_operand): Ditto.
(pmode_register_operand): Ditto.
(scratch_operand): Ditto.
(immediate_operand): Ditto.
(const_int_operand): Ditto.
(const_scalar_int_operand): Ditto.
(const_double_operand): Ditto.
(nonimmediate_operand): Ditto.
(nonmemory_operand): Ditto.
(push_operand): Ditto.
(pop_operand): Ditto.
(memory_operand): Ditto.
(indirect_operand): Ditto.
(ordered_comparison_operator): Ditto.
(comparison_operator): Ditto.
* config/i386/i386-expand.c (ix86_expand_sse_cmp):
Change the type of indirect predicate function to bool.
* config/rs6000/rs6000.c (easy_vector_constant):
Change the type to bool.
* config/mips/mips-protos.h (m16_based_address_p):
Change the type of operand 3 to bool.
Diffstat (limited to 'gcc/genpreds.c')
| -rw-r--r-- | gcc/genpreds.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/genpreds.c b/gcc/genpreds.c index 63fac0c..9d9715f 100644 --- a/gcc/genpreds.c +++ b/gcc/genpreds.c @@ -110,7 +110,7 @@ process_define_predicate (md_rtx_info *info) becomes - static inline int basereg_operand_1(rtx op, machine_mode mode) + static inline bool basereg_operand_1(rtx op, machine_mode mode) { if (GET_CODE (op) == SUBREG) op = SUBREG_REG (op); @@ -151,7 +151,7 @@ write_predicate_subfunction (struct pred_data *p) p->exp = and_exp; - printf ("static inline int\n" + printf ("static inline bool\n" "%s_1 (rtx op ATTRIBUTE_UNUSED, machine_mode mode ATTRIBUTE_UNUSED)\n", p->name); rtx_reader_ptr->print_md_ptr_loc (p->c_block); @@ -651,7 +651,7 @@ write_one_predicate_function (struct pred_data *p) /* A normal predicate can legitimately not look at machine_mode if it accepts only CONST_INTs and/or CONST_WIDE_INT and/or CONST_DOUBLEs. */ - printf ("int\n%s (rtx op, machine_mode mode ATTRIBUTE_UNUSED)\n{\n", + printf ("bool\n%s (rtx op, machine_mode mode ATTRIBUTE_UNUSED)\n{\n", p->name); write_predicate_stmts (p->exp); fputs ("}\n\n", stdout); @@ -1416,7 +1416,7 @@ write_tm_preds_h (void) #ifdef HAVE_MACHINE_MODES"); FOR_ALL_PREDICATES (p) - printf ("extern int %s (rtx, machine_mode);\n", p->name); + printf ("extern bool %s (rtx, machine_mode);\n", p->name); puts ("#endif /* HAVE_MACHINE_MODES */\n"); |
