aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtl.h
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2004-05-25 12:04:17 +0000
committerPaolo Bonzini <bonzini@gcc.gnu.org>2004-05-25 12:04:17 +0000
commit2f93eea8612d4ced2eeee52db5ce66bd75303455 (patch)
tree0fecbc9fb7d6fe74247aea9809ba392638ca87c6 /gcc/rtl.h
parent11338cda74ae54f5f8a86a271bcd04cb604ec806 (diff)
downloadgcc-2f93eea8612d4ced2eeee52db5ce66bd75303455.zip
gcc-2f93eea8612d4ced2eeee52db5ce66bd75303455.tar.gz
gcc-2f93eea8612d4ced2eeee52db5ce66bd75303455.tar.bz2
Makefile.in (OBJS): Add rtlhooks.o.
2004-05-25 Paolo Bonzini <bonzini@gnu.org> * Makefile.in (OBJS): Add rtlhooks.o. (rtlanal.o): Depend on function.h. (cse.o): Depend on rtlhooks-def.h. (combine.o): Depend on rtlhooks-def.h. (rtlhooks.o): New rule. * combine.c: Include rtlhooks-def.h. (nonzero_bits, cached_nonzero_bits, nonzero_bits1, num_sign_bit_copies, cached_num_sign_bit_copies, num_sign_bit_copies1): Move most of the code to rtlanal.c. (reg_nonzero_bits_for_combine, reg_num_sign_bit_copies_for_combine): New functions holding the remnants of the above. (combine_rtl_hooks): New. (combine_instructions): Set rtl_hooks instead of gen_lowpart. * cse.c: Include rtlhooks-def.h. (cse_rtl_hooks): New. (cse_main): Set rtl_hooks instead of gen_lowpart. * emit-rtl.c (gen_lowpart): Remove. (gen_lowpart_general): Move to rtlhooks.c. * rtl.h (nonzero_bits, num_sign_bit_copies, struct rtl_hooks, rtl_hooks, general_rtl_hooks): New. (gen_lowpart_general): Remove. (gen_lowpart): Temporarily redefine as a macro. * rtlanal.c: Include function.h. (nonzero_bits, cached_nonzero_bits, nonzero_bits1, num_sign_bit_copies, cached_num_sign_bit_copies, num_sign_bit_copies1): New, from combine.c. * rtlhooks.c: New file. From-SVN: r82234
Diffstat (limited to 'gcc/rtl.h')
-rw-r--r--gcc/rtl.h27
1 files changed, 24 insertions, 3 deletions
diff --git a/gcc/rtl.h b/gcc/rtl.h
index cb6850a..65f68d8 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1195,6 +1195,9 @@ extern unsigned int subreg_regno_offset (unsigned int, enum machine_mode,
extern bool subreg_offset_representable_p (unsigned int, enum machine_mode,
unsigned int, enum machine_mode);
extern unsigned int subreg_regno (rtx);
+extern unsigned HOST_WIDE_INT nonzero_bits (rtx, enum machine_mode);
+extern unsigned int num_sign_bit_copies (rtx, enum machine_mode);
+
/* 1 if RTX is a subreg containing a reg that is already known to be
sign- or zero-extended from the mode of the subreg to the mode of
@@ -1598,9 +1601,6 @@ extern rtx gen_rtx_REG_offset (rtx, enum machine_mode, unsigned int, int);
extern rtx gen_label_rtx (void);
extern int subreg_hard_regno (rtx, int);
extern rtx gen_lowpart_common (enum machine_mode, rtx);
-extern rtx gen_lowpart_general (enum machine_mode, rtx);
-extern rtx (*gen_lowpart) (enum machine_mode mode, rtx x);
-
/* In cse.c */
extern rtx gen_lowpart_if_possible (enum machine_mode, rtx);
@@ -2461,4 +2461,25 @@ extern void simplify_using_condition (rtx, rtx *, struct bitmap_head_def *);
/* In ra.c. */
extern void reg_alloc (void);
+
+struct rtl_hooks
+{
+ rtx (*gen_lowpart) (enum machine_mode, rtx);
+ rtx (*reg_nonzero_bits) (rtx, enum machine_mode, rtx, enum machine_mode,
+ unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT *);
+ rtx (*reg_num_sign_bit_copies) (rtx, enum machine_mode, rtx, enum machine_mode,
+ unsigned int, unsigned int *);
+
+ /* Whenever you add entries here, make sure you adjust hosthooks-def.h. */
+};
+
+/* Each pass can provide its own. */
+extern struct rtl_hooks rtl_hooks;
+
+/* ... but then it has to restore these. */
+extern const struct rtl_hooks general_rtl_hooks;
+
+/* Keep this for the nonce. */
+#define gen_lowpart rtl_hooks.gen_lowpart
+
#endif /* ! GCC_RTL_H */