Commit a475bff7 by Richard Henderson Committed by Richard Henderson

combine.c (SHIFT_COUNT_TRUNCATED): Provide default value.

        * combine.c (SHIFT_COUNT_TRUNCATED): Provide default value.
        (simplify_comparison): Don't simplify (eq (zero_extract c 1 r) 0)
        if SHIFT_COUNT_TRUNCATED is set.

From-SVN: r76461
parent 3712281f
2004-01-23 Richard Henderson <rth@redhat.com>
PR opt/12941
* combine.c (SHIFT_COUNT_TRUNCATED): Provide default value.
(simplify_comparison): Don't simplify (eq (zero_extract c 1 r) 0)
if SHIFT_COUNT_TRUNCATED is set.
2004-01-23 Bob Wilson <bob.wilson@acm.org> 2004-01-23 Bob Wilson <bob.wilson@acm.org>
* config/xtensa/xtensa.c (xtensa_va_arg): Handle complex values as * config/xtensa/xtensa.c (xtensa_va_arg): Handle complex values as
......
...@@ -91,6 +91,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -91,6 +91,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "toplev.h" #include "toplev.h"
#include "target.h" #include "target.h"
#ifndef SHIFT_COUNT_TRUNCATED
#define SHIFT_COUNT_TRUNCATED 0
#endif
/* It is not safe to use ordinary gen_lowpart in combine. /* It is not safe to use ordinary gen_lowpart in combine.
Use gen_lowpart_for_combine instead. See comments there. */ Use gen_lowpart_for_combine instead. See comments there. */
#define gen_lowpart dont_use_gen_lowpart_you_dummy #define gen_lowpart dont_use_gen_lowpart_you_dummy
...@@ -4545,7 +4549,6 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, ...@@ -4545,7 +4549,6 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last,
return simplify_shift_const (x, code, mode, XEXP (x, 0), return simplify_shift_const (x, code, mode, XEXP (x, 0),
INTVAL (XEXP (x, 1))); INTVAL (XEXP (x, 1)));
#ifdef SHIFT_COUNT_TRUNCATED
else if (SHIFT_COUNT_TRUNCATED && GET_CODE (XEXP (x, 1)) != REG) else if (SHIFT_COUNT_TRUNCATED && GET_CODE (XEXP (x, 1)) != REG)
SUBST (XEXP (x, 1), SUBST (XEXP (x, 1),
force_to_mode (XEXP (x, 1), GET_MODE (XEXP (x, 1)), force_to_mode (XEXP (x, 1), GET_MODE (XEXP (x, 1)),
...@@ -4553,8 +4556,6 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last, ...@@ -4553,8 +4556,6 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last,
<< exact_log2 (GET_MODE_BITSIZE (GET_MODE (x)))) << exact_log2 (GET_MODE_BITSIZE (GET_MODE (x))))
- 1, - 1,
NULL_RTX, 0)); NULL_RTX, 0));
#endif
break; break;
case VEC_SELECT: case VEC_SELECT:
...@@ -9124,10 +9125,8 @@ simplify_shift_const (rtx x, enum rtx_code code, ...@@ -9124,10 +9125,8 @@ simplify_shift_const (rtx x, enum rtx_code code,
/* Make sure and truncate the "natural" shift on the way in. We don't /* Make sure and truncate the "natural" shift on the way in. We don't
want to do this inside the loop as it makes it more difficult to want to do this inside the loop as it makes it more difficult to
combine shifts. */ combine shifts. */
#ifdef SHIFT_COUNT_TRUNCATED
if (SHIFT_COUNT_TRUNCATED) if (SHIFT_COUNT_TRUNCATED)
orig_count &= GET_MODE_BITSIZE (mode) - 1; orig_count &= GET_MODE_BITSIZE (mode) - 1;
#endif
/* If we were given an invalid count, don't do anything except exactly /* If we were given an invalid count, don't do anything except exactly
what was requested. */ what was requested. */
...@@ -10523,8 +10522,10 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) ...@@ -10523,8 +10522,10 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
a constant that has only a single bit set and are comparing it a constant that has only a single bit set and are comparing it
with zero, we can convert this into an equality comparison with zero, we can convert this into an equality comparison
between the position and the location of the single bit. */ between the position and the location of the single bit. */
/* Except we can't if SHIFT_COUNT_TRUNCATED is set, since we might
if (GET_CODE (XEXP (op0, 0)) == CONST_INT have already reduced the shift count modulo the word size. */
if (!SHIFT_COUNT_TRUNCATED
&& GET_CODE (XEXP (op0, 0)) == CONST_INT
&& XEXP (op0, 1) == const1_rtx && XEXP (op0, 1) == const1_rtx
&& equality_comparison_p && const_op == 0 && equality_comparison_p && const_op == 0
&& (i = exact_log2 (INTVAL (XEXP (op0, 0)))) >= 0) && (i = exact_log2 (INTVAL (XEXP (op0, 0)))) >= 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment