aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtlanal.c
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2006-02-28 20:32:20 +0000
committerAdam Nemet <nemet@gcc.gnu.org>2006-02-28 20:32:20 +0000
commitd3b726902460a92cefbb1be7472d2cafece201ed (patch)
treeb59a2ff0c0c65abbe656b96ae1d8a37028083f6b /gcc/rtlanal.c
parente5c7f9f582b4148974efae8c9289652601909753 (diff)
downloadgcc-d3b726902460a92cefbb1be7472d2cafece201ed.zip
gcc-d3b726902460a92cefbb1be7472d2cafece201ed.tar.gz
gcc-d3b726902460a92cefbb1be7472d2cafece201ed.tar.bz2
rtl.h (truncated_to_mode): Declare it.
* rtl.h (truncated_to_mode): Declare it. (struct rtl_hooks): Add reg_truncated_to_mode hook. * rtlhooks-def.h (RTL_HOOKS_REG_TRUNCATED_TO_MODE): New macro. (RTL_HOOKS_INITIALIZER): Include it. * rtlhooks.c (reg_truncated_to_mode_general): New function. * combine.c (RTL_HOOKS_REG_TRUNCATED_TO_MODE): Override to reg_truncated_to_mode. * rtlanal.c (truncated_to_mode): Define it. * simplify-rtx.c (simplify_unary_operation_1): Use it. Co-Authored-By: Adam Nemet <anemet@caviumnetworks.com> From-SVN: r111573
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r--gcc/rtlanal.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index d8c9fb8..bbf7e71 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -4808,6 +4808,16 @@ get_condition (rtx jump, rtx *earliest, int allow_cc_mode, int valid_at_insn_p)
allow_cc_mode, valid_at_insn_p);
}
+/* Suppose that truncation from the machine mode of X to MODE is not a
+ no-op. See if there is anything special about X so that we can
+ assume it already contains a truncated value of MODE. */
+
+bool
+truncated_to_mode (enum machine_mode mode, rtx x)
+{
+ return REG_P (x) && rtl_hooks.reg_truncated_to_mode (mode, x);
+}
+
/* Initialize non_rtx_starting_operands, which is used to speed up
for_each_rtx. */