aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtlanal.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2015-07-28 19:59:40 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2015-07-28 19:59:40 +0000
commit2a870875df5b51ff8803dc0062fdcb02d15b364d (patch)
tree89bfddfae877a517ba1a218ff9c9be07f1e81d11 /gcc/rtlanal.c
parent3b0b0013f6dbe34d2e1ddeacd7e7c26752575680 (diff)
downloadgcc-2a870875df5b51ff8803dc0062fdcb02d15b364d.zip
gcc-2a870875df5b51ff8803dc0062fdcb02d15b364d.tar.gz
gcc-2a870875df5b51ff8803dc0062fdcb02d15b364d.tar.bz2
target-insns.def (can_extend, ptr_extend): New targetm instruction patterns.
gcc/ * target-insns.def (can_extend, ptr_extend): New targetm instruction patterns. * optabs.c (can_extend_p): Use them instead of HAVE_*/gen_* interface. * simplify-rtx.c (simplify_unary_operation_1): Likewise. * emit-rtl.c (set_reg_attrs_from_value): Likewise. * rtlanal.c (nonzero_bits1): Likewise. (num_sign_bit_copies1): Likewise. From-SVN: r226324
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r--gcc/rtlanal.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 0bba878..a9246fa 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -4278,7 +4278,7 @@ nonzero_bits1 (const_rtx x, machine_mode mode, const_rtx known_x,
switch (code)
{
case REG:
-#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
+#if defined(POINTERS_EXTEND_UNSIGNED)
/* If pointers extend unsigned and this is a pointer in Pmode, say that
all the bits above ptr_mode are known to be zero. */
/* As we do not know which address space the pointer is referring to,
@@ -4286,7 +4286,8 @@ nonzero_bits1 (const_rtx x, machine_mode mode, const_rtx known_x,
or address modes depending on the address space. */
if (target_default_pointer_address_modes_p ()
&& POINTERS_EXTEND_UNSIGNED && GET_MODE (x) == Pmode
- && REG_POINTER (x))
+ && REG_POINTER (x)
+ && !targetm.have_ptr_extend ())
nonzero &= GET_MODE_MASK (ptr_mode);
#endif
@@ -4785,7 +4786,7 @@ num_sign_bit_copies1 (const_rtx x, machine_mode mode, const_rtx known_x,
{
case REG:
-#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
+#if defined(POINTERS_EXTEND_UNSIGNED)
/* If pointers extend signed and this is a pointer in Pmode, say that
all the bits above ptr_mode are known to be sign bit copies. */
/* As we do not know which address space the pointer is referring to,
@@ -4793,7 +4794,8 @@ num_sign_bit_copies1 (const_rtx x, machine_mode mode, const_rtx known_x,
or address modes depending on the address space. */
if (target_default_pointer_address_modes_p ()
&& ! POINTERS_EXTEND_UNSIGNED && GET_MODE (x) == Pmode
- && mode == Pmode && REG_POINTER (x))
+ && mode == Pmode && REG_POINTER (x)
+ && !targetm.have_ptr_extend ())
return GET_MODE_PRECISION (Pmode) - GET_MODE_PRECISION (ptr_mode) + 1;
#endif