On Fri, Apr 1, 2011 at 10:30 PM, H.J. Lu <hongjiu...@intel.com> wrote:
> I checked in this patch.
>
> H.J.
> ---
> commit 230fad69a62607b1845bc04f4b33bdad398cc4e4
> Author: H.J. Lu <hjl.to...@gmail.com>
> Date:   Thu Mar 17 18:26:35 2011 -0700
>
>    Add ZERO_EXTEND PLUS base support to ix86_simplify_base_disp.
>
> diff --git a/gcc/ChangeLog.x32 b/gcc/ChangeLog.x32
> index 6d5eda6..8dd7196 100644
> --- a/gcc/ChangeLog.x32
> +++ b/gcc/ChangeLog.x32
> @@ -1,3 +1,9 @@
> +2011-03-17  H.J. Lu  <hongjiu...@intel.com>
> +
> +       PR target/47744
> +       * config/i386/i386.c (ix86_simplify_base_disp): Add ZERO_EXTEND
> +       PLUS base support.
> +
>  2011-03-16  H.J. Lu  <hongjiu...@intel.com>
>
>        PR rtl-optimization/48155

Another patch.

-- 
H.J.
---
commit 44ae6b13b2d1ce6823b470db6a484d35fbb7e8bc
Author: H.J. Lu <hjl.to...@gmail.com>
Date:   Mon Mar 28 21:18:46 2011 -0700

    Add symbol plus constant support.

diff --git a/gcc/ChangeLog.x32 b/gcc/ChangeLog.x32
index d28d87d..b75b2b5 100644
--- a/gcc/ChangeLog.x32
+++ b/gcc/ChangeLog.x32
@@ -1,5 +1,11 @@
 2011-03-28  H.J. Lu  <hongjiu...@intel.com>

+       PR target/47744
+       * config/i386/i386.c (ix86_simplify_base_disp): Add symbol plus
+       constant support.
+
+2011-03-28  H.J. Lu  <hongjiu...@intel.com>
+
        PR rtl-optimization/47958
        * reload.c (find_reloads): Don't put symbol reference in memory
        in ptr_mode.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 4b719fd..d7a5c02 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -11659,6 +11659,20 @@ ix86_live_on_entry (bitmap regs)
                                     (reg:SI 2 cx [86]))
            (const_int [CONST1 + CONST2])))

+   We also translate
+
+   (plus:SI (plus:SI (plus:SI (reg:SI 4 si [70])
+                             (reg:SI 2 cx [86]))
+                    (symbol_ref:SI ("A.193.2210")))
+           (const_int CONST))
+
+   into
+
+   (plus:SI (plus:SI (reg:SI 4 si [70])
+                    (reg:SI 2 cx [86]))
+           (const (plus:SI (symbol_ref:SI ("A.193.2210"))
+                           (const_int CONST))))
+
    If PLUS is true, we also translate

    (set (reg:SI 40 r11)
@@ -11706,12 +11720,17 @@ ix86_simplify_base_disp (rtx *base_p, rtx
*disp_p, bool plus)
               && GET_MODE (op0) == ptr_mode
               && REG_P (XEXP (op0, 0))
               && REG_P (XEXP (op0, 1))))
-         && CONST_INT_P (op1))
+         && (CONST_INT_P (op1)
+             || GET_CODE (op1) == SYMBOL_REF
+             || GET_CODE (op1) == LABEL_REF))
        {
          base = op0;
          addend = op1;
        }
-      else if (REG_P (op1) && CONST_INT_P (op0))
+      else if (REG_P (op1)
+              && (CONST_INT_P (op0)
+                  || GET_CODE (op0) == SYMBOL_REF
+                  || GET_CODE (op0) == LABEL_REF))
        {
          base = op1;
          addend = op0;
@@ -11742,7 +11761,15 @@ ix86_simplify_base_disp (rtx *base_p, rtx
*disp_p, bool plus)
       if (disp == NULL_RTX || disp == const0_rtx)
        *disp_p = addend;
       else
-       *disp_p = GEN_INT (INTVAL (disp) + INTVAL (addend));
+       {
+         if (CONST_INT_P (addend))
+           *disp_p = GEN_INT (INTVAL (disp) + INTVAL (addend));
+         else
+           {
+             disp = gen_rtx_PLUS (ptr_mode, addend, disp);
+             *disp_p = gen_rtx_CONST (ptr_mode, disp);
+           }
+       }

       if (!plus)
        {

Reply via email to