]> gcc.gnu.org Git - gcc.git/commitdiff
i386.h (ALIGN_DFmode): Delete.
authorJohn Wehle <john@feith.com>
Sun, 17 May 1998 23:00:05 +0000 (23:00 +0000)
committerJeff Law <law@gcc.gnu.org>
Sun, 17 May 1998 23:00:05 +0000 (17:00 -0600)
        * i386.h (ALIGN_DFmode): Delete.
        (CONSTANT_ALIGNMENT): Define.
        * varasm.c (force_const_mem): Use it.

From-SVN: r19823

gcc/ChangeLog
gcc/config/i386/i386.h
gcc/varasm.c

index 07cb2379722cb180a5c89e85ee68a89b9c1c3e6a..e2cbd10b62881f9ec15b7df2cf8d973c456281fb 100644 (file)
@@ -1,3 +1,9 @@
+Sun May 17 23:59:45 1998  John Wehle  (john@feith.com)
+
+       * i386.h (ALIGN_DFmode): Delete.
+       (CONSTANT_ALIGNMENT): Define.
+       * varasm.c (force_const_mem): Use it.
+
 Sun May 17 19:31:05 1998  Richard Henderson  <rth@cygnus.com>
 
        * alpha.c (alpha_emit_conditional_branch): Clear cmp_code after
index 1053bd9c242291cef31a3028700c59ca5a6344b1..b55ffccb986e2a2a3ad2d3e3ed54ba8a4adbb78a 100644 (file)
@@ -419,8 +419,30 @@ extern int ix86_arch;
    aligned on 64 bit boundaries. */
 #define BIGGEST_ALIGNMENT (TARGET_ALIGN_DOUBLE ? 64 : 32)
 
-/* align DFmode constants and nonaggregates */
-#define ALIGN_DFmode (!TARGET_386)
+/* If defined, a C expression to compute the alignment given to a
+   constant that is being placed in memory.  CONSTANT is the constant
+   and ALIGN is the alignment that the object would ordinarily have.
+   The value of this macro is used instead of that alignment to align
+   the object.
+
+   If this macro is not defined, then ALIGN is used.
+
+   The typical use of this macro is to increase alignment for string
+   constants to be word aligned so that `strcpy' calls that copy
+   constants can be done inline.  */
+
+#define CONSTANT_ALIGNMENT(EXP, ALIGN)                                 \
+  (TREE_CODE (EXP) == REAL_CST                                         \
+    ? ((TYPE_MODE (TREE_TYPE (EXP)) == DFmode && (ALIGN) < 64)         \
+       ? 64                                                            \
+       : (TYPE_MODE (TREE_TYPE (EXP)) == XFmode && (ALIGN) < 128)      \
+       ? 128                                                           \
+       : (ALIGN))                                                      \
+    : TREE_CODE (EXP) == STRING_CST                                    \
+    ? ((TREE_STRING_LENGTH (EXP) >= 31 && (ALIGN) < 256)               \
+       ? 256                                                           \
+       : (ALIGN))                                                      \
+    : (ALIGN))
 
 /* If defined, a C expression to compute the alignment for a static
    variable.  TYPE is the data type, and ALIGN is the alignment that
index 867ae1f17131efa3698f96b4aa9fe133b8b21431..9951a50d31e7480a86a019c30a6c6bb5510ab189 100644 (file)
@@ -3417,6 +3417,10 @@ force_const_mem (mode, x)
       align = (mode == VOIDmode) ? UNITS_PER_WORD : GET_MODE_SIZE (mode);
       if (align > BIGGEST_ALIGNMENT / BITS_PER_UNIT)
        align = BIGGEST_ALIGNMENT / BITS_PER_UNIT;
+#ifdef CONSTANT_ALIGNMENT
+      align = CONSTANT_ALIGNMENT (make_tree (type_for_mode (mode, 0), x),
+                                align * BITS_PER_UNIT) / BITS_PER_UNIT;
+#endif
 
       pool_offset += align - 1;
       pool_offset &= ~ (align - 1);
This page took 0.081937 seconds and 5 git commands to generate.