]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Temporary remove "at least 8 byte alignment" code from x86
authorDenys Vlasenko <dvlasenk@redhat.com>
Wed, 4 Jul 2018 07:35:37 +0000 (07:35 +0000)
committerMartin Liska <marxin@gcc.gnu.org>
Wed, 4 Jul 2018 07:35:37 +0000 (07:35 +0000)
2018-07-04  Denys Vlasenko  <dvlasenk@redhat.com>

* config/i386/dragonfly.h: (ASM_OUTPUT_MAX_SKIP_ALIGN):
Use a simpler align directive also if MAXSKIP = ALIGN-1.
* config/i386/gas.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise.
* config/i386/lynx.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise.
* config/i386/netbsd-elf.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise.
* config/i386/i386.h (ASM_OUTPUT_MAX_SKIP_PAD): Likewise.
* config/i386/freebsd.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Remove "If N
is large, do at least 8 byte alignment" code. Add SUBALIGN_LOG
define. Use a simpler align directive also if MAXSKIP = ALIGN-1.
* config/i386/gnu-user.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise.
* config/i386/iamcu.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise.
* config/i386/openbsdelf.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise.
* config/i386/x86-64.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise.

From-SVN: r262374

gcc/ChangeLog
gcc/config/i386/dragonfly.h
gcc/config/i386/freebsd.h
gcc/config/i386/gas.h
gcc/config/i386/gnu-user.h
gcc/config/i386/i386.h
gcc/config/i386/iamcu.h
gcc/config/i386/lynx.h
gcc/config/i386/netbsd-elf.h
gcc/config/i386/openbsdelf.h
gcc/config/i386/x86-64.h

index 3a6e9decca39c1452f9045eb3bd144ae8a89bb0d..362ef151468a211a3f466e412e951476159d62cf 100644 (file)
@@ -1,3 +1,19 @@
+2018-07-04  Denys Vlasenko  <dvlasenk@redhat.com>
+
+       * config/i386/dragonfly.h: (ASM_OUTPUT_MAX_SKIP_ALIGN):
+       Use a simpler align directive also if MAXSKIP = ALIGN-1.
+       * config/i386/gas.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise.
+       * config/i386/lynx.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise.
+       * config/i386/netbsd-elf.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise.
+       * config/i386/i386.h (ASM_OUTPUT_MAX_SKIP_PAD): Likewise.
+       * config/i386/freebsd.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Remove "If N
+       is large, do at least 8 byte alignment" code. Add SUBALIGN_LOG
+       define. Use a simpler align directive also if MAXSKIP = ALIGN-1.
+       * config/i386/gnu-user.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise.
+       * config/i386/iamcu.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise.
+       * config/i386/openbsdelf.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise.
+       * config/i386/x86-64.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise.
+
 2018-07-04  Martin Liska  <mliska@suse.cz>
             Jonathan Wakely  <jwakely@redhat.com>
 
index a05b36435de58d61a1f757c214591920c213e180..40774c0cf7a5e793d12aa60ec987d6c063684a11 100644 (file)
@@ -69,10 +69,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
 #undef  ASM_OUTPUT_MAX_SKIP_ALIGN
-#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP)                                 \
-  if ((LOG) != 0) {                                                                                                            \
-    if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG));   \
-    else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));   \
+#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP)                 \
+  if ((LOG) != 0) {                                                    \
+    if ((MAX_SKIP) == 0 || (MAX_SKIP) >= (1 << (LOG)) - 1)             \
+      fprintf ((FILE), "\t.p2align %d\n", (LOG));                      \
+    else                                                               \
+      fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));      \
   }
 #endif
 
index 0f38e6d859a6a529d36237276aa0f5fc1753abba..caac6b3857566e45ba2412f5689408eb353950ab 100644 (file)
@@ -92,25 +92,19 @@ along with GCC; see the file COPYING3.  If not see
 
 /* A C statement to output to the stdio stream FILE an assembler
    command to advance the location counter to a multiple of 1<<LOG
-   bytes if it is within MAX_SKIP bytes.
+   bytes if it is within MAX_SKIP bytes.  */
 
-   This is used to align code labels according to Intel recommendations.  */
+#define SUBALIGN_LOG 3
 
 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
 #undef  ASM_OUTPUT_MAX_SKIP_ALIGN
 #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)                   \
   do {                                                                 \
     if ((LOG) != 0) {                                                  \
-      if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
-      else {                                                           \
+      if ((MAX_SKIP) == 0 || (MAX_SKIP) >= (1 << (LOG)) - 1)           \
+       fprintf ((FILE), "\t.p2align %d\n", (LOG));                     \
+      else                                                             \
        fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));     \
-       /* Make sure that we have at least 8 byte alignment if > 8 byte \
-          alignment is preferred.  */                                  \
-       if ((LOG) > 3                                                   \
-           && (1 << (LOG)) > ((MAX_SKIP) + 1)                          \
-           && (MAX_SKIP) >= 7)                                         \
-         fputs ("\t.p2align 3\n", (FILE));                             \
-      }                                                                        \
     }                                                                  \
   } while (0)
 #endif
index 25d5f7809b5ac829a0b3b98610fbc93ee0986513..e149ab1360cae8385b23d9c77a2c9f5f376aed6f 100644 (file)
@@ -57,7 +57,7 @@ along with GCC; see the file COPYING3.  If not see
 #ifdef HAVE_GAS_BALIGN_AND_P2ALIGN 
 #undef ASM_OUTPUT_ALIGN
 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
-  if ((LOG)!=0) fprintf ((FILE), "\t.balign %d\n", 1<<(LOG))
+  if ((LOG)!=0) fprintf ((FILE), "\t.balign %d\n", 1 << (LOG))
 #endif
 
 /* A C statement to output to the stdio stream FILE an assembler
@@ -68,10 +68,12 @@ along with GCC; see the file COPYING3.  If not see
 
 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
 #  define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
-     if ((LOG) != 0) {\
-       if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
-       else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
-     }
+    if ((LOG) != 0) { \
+      if ((MAX_SKIP) == 0 || (MAX_SKIP) >= (1<<(LOG))-1)               \
+       fprintf ((FILE), "\t.p2align %d\n", (LOG));                     \
+      else                                                             \
+       fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));     \
+    }
 #endif
 \f
 /* A C statement or statements which output an assembler instruction
index 56449a5439e37322a2867dd20753ef19ac97efc7..a922c9b93fadcaac0fbb3d06b5d2388bfbf6f75b 100644 (file)
@@ -95,24 +95,18 @@ along with GCC; see the file COPYING3.  If not see
 
 /* A C statement to output to the stdio stream FILE an assembler
    command to advance the location counter to a multiple of 1<<LOG
-   bytes if it is within MAX_SKIP bytes.
+   bytes if it is within MAX_SKIP bytes.  */
 
-   This is used to align code labels according to Intel recommendations.  */
+#define SUBALIGN_LOG 3
 
 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
 #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)                   \
   do {                                                                 \
     if ((LOG) != 0) {                                                  \
-      if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
-      else {                                                           \
+      if ((MAX_SKIP) == 0 || (MAX_SKIP) >= (1 << (LOG)) - 1)           \
+       fprintf ((FILE), "\t.p2align %d\n", (LOG));                     \
+      else                                                             \
        fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));     \
-       /* Make sure that we have at least 8 byte alignment if > 8 byte \
-          alignment is preferred.  */                                  \
-       if ((LOG) > 3                                                   \
-           && (1 << (LOG)) > ((MAX_SKIP) + 1)                          \
-           && (MAX_SKIP) >= 7)                                         \
-         fputs ("\t.p2align 3\n", (FILE));                             \
-      }                                                                        \
     }                                                                  \
   } while (0)
 #endif
index 049760efe349524f815db60013f257bd8611a032..fbba598ffd5bc408ecf60cfdd6d8754fe3a5d64d 100644 (file)
@@ -2201,7 +2201,7 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
 #define ASM_OUTPUT_MAX_SKIP_PAD(FILE, LOG, MAX_SKIP)                   \
   if ((LOG) != 0)                                                      \
     {                                                                  \
-      if ((MAX_SKIP) == 0)                                             \
+      if ((MAX_SKIP) == 0 || (MAX_SKIP) >= (1 << (LOG)) - 1)           \
         fprintf ((FILE), "\t.p2align %d\n", (LOG));                    \
       else                                                             \
         fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));    \
index b30132f377a153d2c271bd6cc085fc05d00e8a8a..4e7c56967a53d459a1b41b19751cad8be7d19389 100644 (file)
@@ -62,23 +62,17 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 /* A C statement to output to the stdio stream FILE an assembler
    command to advance the location counter to a multiple of 1<<LOG
-   bytes if it is within MAX_SKIP bytes.
+   bytes if it is within MAX_SKIP bytes.  */
 
-   This is used to align code labels according to Intel recommendations.  */
+#define SUBALIGN_LOG 3
 
 #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)                   \
   do {                                                                 \
     if ((LOG) != 0) {                                                  \
-      if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
-      else {                                                           \
+      if ((MAX_SKIP) == 0 || (MAX_SKIP) >= (1 << (LOG)) - 1)           \
+       fprintf ((FILE), "\t.p2align %d\n", (LOG));                     \
+      else                                                             \
        fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));     \
-       /* Make sure that we have at least 8 byte alignment if > 8 byte \
-          alignment is preferred.  */                                  \
-       if ((LOG) > 3                                                   \
-           && (1 << (LOG)) > ((MAX_SKIP) + 1)                          \
-           && (MAX_SKIP) >= 7)                                         \
-         fputs ("\t.p2align 3\n", (FILE));                             \
-      }                                                                        \
     }                                                                  \
   } while (0)
 
index 404a25104f8dbcaa2244b8f782f34143a0d3ae91..6f4013eb74bdb7069bd48dff6dd08a5ec02be182 100644 (file)
@@ -61,8 +61,10 @@ along with GCC; see the file COPYING3.  If not see
 #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)                   \
   do {                                                                 \
     if ((LOG) != 0) {                                                  \
-      if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
-      else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
+      if ((MAX_SKIP) == 0 || (MAX_SKIP) >= (1 << (LOG)) - 1)           \
+       fprintf ((FILE), "\t.p2align %d\n", (LOG));                     \
+      else                                                             \
+       fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));     \
     }                                                                  \
   } while (0)
 #endif
index c1c1e0390bb88f7b93c47a1ee853c24370b83762..1aa96cd7c8931544fe7b6f2e24c0eb16f5355a84 100644 (file)
@@ -104,8 +104,10 @@ along with GCC; see the file COPYING3.  If not see
 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
 #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP)                 \
   if ((LOG) != 0) {                                                    \
-    if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG));   \
-    else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));   \
+    if ((MAX_SKIP) == 0 || (MAX_SKIP) >= (1 << (LOG)) - 1)             \
+      fprintf ((FILE), "\t.p2align %d\n", (LOG));                      \
+    else                                                               \
+      fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));      \
   }
 #endif
 
index 8de1b99653b96be9fdef22c35d75457837243320..705e904e9ab6b246dadb25874ab9be95b7a31ea6 100644 (file)
@@ -63,24 +63,18 @@ along with GCC; see the file COPYING3.  If not see
 
 /* A C statement to output to the stdio stream FILE an assembler
    command to advance the location counter to a multiple of 1<<LOG
-   bytes if it is within MAX_SKIP bytes.
+   bytes if it is within MAX_SKIP bytes.  */
 
-   This is used to align code labels according to Intel recommendations.  */
+#define SUBALIGN_LOG 3
 
 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
 #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)                   \
   do {                                                                 \
     if ((LOG) != 0) {                                                  \
-      if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
-      else {                                                           \
+      if ((MAX_SKIP) == 0 || (MAX_SKIP) >= (1 << (LOG)) - 1)           \
+       fprintf ((FILE), "\t.p2align %d\n", (LOG));                     \
+      else                                                             \
        fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));     \
-       /* Make sure that we have at least 8 byte alignment if > 8 byte \
-          alignment is preferred.  */                                  \
-       if ((LOG) > 3                                                   \
-           && (1 << (LOG)) > ((MAX_SKIP) + 1)                          \
-           && (MAX_SKIP) >= 7)                                         \
-         fputs ("\t.p2align 3\n", (FILE));                             \
-      }                                                                        \
     }                                                                  \
   } while (0)
 #endif
index e2a8306c9fa9c93b99571f6f0e2211cd1ada2d17..66bbd5edc596021954fe18d44ffe39a8ad57fb2b 100644 (file)
@@ -61,27 +61,23 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 /* This is used to align code labels according to Intel recommendations.  */
 
+#define SUBALIGN_LOG 3
+
 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
 #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)                   \
   do {                                                                 \
     if ((LOG) != 0) {                                                  \
-      if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
-      else {                                                           \
+      if ((MAX_SKIP) == 0 || (MAX_SKIP) >= (1 << (LOG)) - 1)           \
+       fprintf ((FILE), "\t.p2align %d\n", (LOG));                     \
+      else                                                             \
        fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));     \
-       /* Make sure that we have at least 8 byte alignment if > 8 byte \
-          alignment is preferred.  */                                  \
-       if ((LOG) > 3                                                   \
-           && (1 << (LOG)) > ((MAX_SKIP) + 1)                          \
-           && (MAX_SKIP) >= 7)                                         \
-         fputs ("\t.p2align 3\n", (FILE));                             \
-      }                                                                        \
     }                                                                  \
   } while (0)
 #undef  ASM_OUTPUT_MAX_SKIP_PAD
 #define ASM_OUTPUT_MAX_SKIP_PAD(FILE, LOG, MAX_SKIP)                   \
   if ((LOG) != 0)                                                      \
     {                                                                  \
-      if ((MAX_SKIP) == 0)                                             \
+      if ((MAX_SKIP) == 0 || (MAX_SKIP) >= (1<<(LOG))-1)               \
         fprintf ((FILE), "\t.p2align %d\n", (LOG));                    \
       else                                                             \
         fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));    \