Richi has asked the we break the wide-int patch so that the individual port and 
front end maintainers can review their parts without have to go through the 
entire patch.    This patch covers the i386 port.

Ok?

        * config/i386/i386.c: Include wide-int.h.
        (ix86_data_alignment): Use wide-int interfaces.
        (ix86_local_alignment): Likewise.
        (ix86_emit_swsqrtsf): Update real_from_integer.


diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 459281e..bdde693 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -67,6 +67,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "diagnostic.h"
 #include "dumpfile.h"
 #include "tree-pass.h"
+#include "wide-int.h"
 #include "context.h"
 #include "pass_manager.h"
 
@@ -26176,8 +26177,7 @@ ix86_data_alignment (tree type, int align, bool opt)
       && AGGREGATE_TYPE_P (type)
       && TYPE_SIZE (type)
       && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
-      && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= (unsigned) max_align
-         || TREE_INT_CST_HIGH (TYPE_SIZE (type)))
+      && wi::geu_p (TYPE_SIZE (type), max_align)
       && align < max_align)
     align = max_align;
 
@@ -26188,8 +26188,8 @@ ix86_data_alignment (tree type, int align, bool opt)
       if ((opt ? AGGREGATE_TYPE_P (type) : TREE_CODE (type) == ARRAY_TYPE)
          && TYPE_SIZE (type)
          && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
-         && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 128
-             || TREE_INT_CST_HIGH (TYPE_SIZE (type))) && align < 128)
+         && wi::geu_p (TYPE_SIZE (type), 128)
+         && align < 128)
        return 128;
     }
 
@@ -26298,13 +26298,13 @@ ix86_local_alignment (tree exp, enum machine_mode 
mode,
       && TARGET_SSE)
     {
       if (AGGREGATE_TYPE_P (type)
-          && (va_list_type_node == NULL_TREE
-              || (TYPE_MAIN_VARIANT (type)
-                  != TYPE_MAIN_VARIANT (va_list_type_node)))
-          && TYPE_SIZE (type)
-          && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
-          && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 16
-              || TREE_INT_CST_HIGH (TYPE_SIZE (type))) && align < 128)
+         && (va_list_type_node == NULL_TREE
+             || (TYPE_MAIN_VARIANT (type)
+                 != TYPE_MAIN_VARIANT (va_list_type_node)))
+         && TYPE_SIZE (type)
+         && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
+         && wi::geu_p (TYPE_SIZE (type), 16)
+         && align < 128)
        return 128;
     }
   if (TREE_CODE (type) == ARRAY_TYPE)
@@ -38736,7 +38736,7 @@ void ix86_emit_swsqrtsf (rtx res, rtx a, enum 
machine_mode mode,
   e2 = gen_reg_rtx (mode);
   e3 = gen_reg_rtx (mode);
 
-  real_from_integer (&r, VOIDmode, -3, -1, 0);
+  real_from_integer (&r, VOIDmode, -3, SIGNED);
   mthree = CONST_DOUBLE_FROM_REAL_VALUE (r, SFmode);
 
   real_arithmetic (&r, NEGATE_EXPR, &dconsthalf, NULL);

Reply via email to