From e129d93a7b1eda6ee734fff7aa1f8bc60e5ba7e2 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 23 Jan 2004 21:05:21 +0000 Subject: re PR target/1532 (-O3 generates (obviously) redundant tests and jumps) PR gcc/1532 * cse.c (cse_change_cc_mode): New static function. (cse_change_cc_mode_insns, cse_cc_succs): Likewise. (cse_condition_code_reg): New function. * rtl.h (cse_condition_code_reg): Declare. * toplev.c (rest_of_handle_cse2): Call cse_condition_code_reg. * target.h (struct gcc_target): Add fixed_condition_code_regs and cc_modes_compatible. * target-def.h (TARGET_FIXED_CONDITION_CODE_REGS): Define. (TARGET_CC_MODES_COMPATIBLE): Define. (TARGET_INITIALIZER): Add new initializers. * targhooks.c (default_cc_modes_compatible): New function. * targhooks.c (default_cc_modes_compatible): Declare. * hooks.c (hook_bool_intp_intp_false): New function. * hooks.h (hook_bool_intp_intp_false): Declare. * config/i386/i386.c (TARGET_FIXED_CONDITION_CODE_REGS): Define. (TARGET_CC_MODES_COMPATIBLE): Define. (ix86_fixed_condition_code_regs): New static function. (ix86_cc_modes_compatible): Likewise. * doc/tm.texi (Condition Code): Document new hooks. From-SVN: r76454 --- gcc/target.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'gcc/target.h') diff --git a/gcc/target.h b/gcc/target.h index 787d203..21a12f0 100644 --- a/gcc/target.h +++ b/gcc/target.h @@ -377,6 +377,23 @@ struct gcc_target hook should return NULL_RTX. */ rtx (* dwarf_register_span) (rtx); + /* Fetch the fixed register(s) which hold condition codes, for + targets where it makes sense to look for duplicate assignments to + the condition codes. This should return true if there is such a + register, false otherwise. The arguments should be set to the + fixed register numbers. Up to two condition code registers are + supported. If there is only one for this target, the int pointed + at by the second argument should be set to -1. */ + bool (* fixed_condition_code_regs) (unsigned int *, unsigned int *); + + /* If two condition code modes are compatible, return a condition + code mode which is compatible with both, such that a comparison + done in the returned mode will work for both of the original + modes. If the condition code modes are not compatible, return + VOIDmode. */ + enum machine_mode (* cc_modes_compatible) (enum machine_mode, + enum machine_mode); + /* Do machine-dependent code transformations. Called just before delayed-branch scheduling. */ void (* machine_dependent_reorg) (void); -- cgit v1.1