]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
add ASM_OUTPUT_MAX_SKIP_ALIGN to i386.h
authorAlexandre Oliva <oliva@adacore.com>
Thu, 29 Apr 2021 22:31:30 +0000 (19:31 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Thu, 29 Apr 2021 22:31:30 +0000 (19:31 -0300)
Several i386 align tests expect p2align to be used, but not all
configurations define ASM_OUTPUT_MAX_SKIP_ALIGN, even when
HAVE_GAS_MAX_SKIP_P2ALIGN.

i386.h had an equivalent ASM_OUTPUT_MAX_SKIP_PAD.  I've renamed it and
its uses to the documented _ALIGN spelling, and dropped all redundant
defines elsewhere in gcc/config/i386/.

for  gcc/ChangeLog

* config/i386/i386.h (ASM_OUTPUT_MAX_SKIP_PAD): Rename to...
(ASM_OUTPUT_MAX_SKIP_ALIGN): ... this.  Enclose in do/while(0).
* config/i386/i386.c: Adjust.
* config/i386/i386.md: Adjust.
* config/i386/darwin.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Drop.
* config/i386/dragonfly.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise.
* config/i386/freebsd.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise.
* config/i386/gas.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise.
* config/i386/gnu-user.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise.
* config/i386/iamcu.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/openbsdelf.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise.
* config/i386/x86-64.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Likewise.
(ASM_OUTPUT_MAX_SKIP_PAD): Likewise.

13 files changed:
gcc/config/i386/darwin.h
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.c
gcc/config/i386/i386.h
gcc/config/i386/i386.md
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 2657dfe266e92765825e1a857623f09e68dbbc3f..afa9f1bb1a65cb8e363cc2b6d5fcd84887ccbc2c 100644 (file)
@@ -217,18 +217,6 @@ along with GCC; see the file COPYING3.  If not see
       }                                                                   \
   } while (0)
 
-#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
-#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)                    \
-  do {                                                                  \
-    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));     \
-    }                                                                   \
-  } while (0)
-#endif
-
 /* Darwin x86 assemblers support the .ident directive.  */
 
 #undef TARGET_ASM_OUTPUT_IDENT
index ab8a269620fa71527ed703bb7b59ecfc981277fb..62fac8805c814f58f3ef09f828230c62303e877e 100644 (file)
@@ -61,23 +61,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define SUBTARGET_EXTRA_SPECS \
   { "dfbsd_dynamic_linker", DFBSD_DYNAMIC_LINKER }
 
-/* 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.
-
-   This is used to align code labels according to Intel recommendations.  */
-
-#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 || (MAX_SKIP) >= (1 << (LOG)) - 1)             \
-      fprintf ((FILE), "\t.p2align %d\n", (LOG));                      \
-    else                                                               \
-      fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));      \
-  }
-#endif
-
 /* Don't default to pcc-struct-return, we want to retain compatibility with
    older gcc versions AND pcc-struct-return is nonreentrant.
    (even though the SVR4 ABI for the i386 says that records and unions are
index b1b3bb34cc0df82645cf9b43f5ae9eaf14215426..00df79a7f574dc6fd20841469b9d776f7f08c946 100644 (file)
@@ -96,19 +96,6 @@ along with GCC; see the file COPYING3.  If not see
 
 #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 || (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
-
 /* Don't default to pcc-struct-return, we want to retain compatibility with
    older gcc versions AND pcc-struct-return is nonreentrant.
    (even though the SVR4 ABI for the i386 says that records and unions are
index f76a2835fca61532cf6235522fbbed51560b30d2..d3cfd61cf19fa09da34765b5abc6d34c5bfd4ceb 100644 (file)
@@ -59,22 +59,6 @@ along with GCC; see the file COPYING3.  If not see
 #define ASM_OUTPUT_ALIGN(FILE,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
-   command to advance the location counter to a multiple of 1<<LOG
-   bytes if it is within MAX_SKIP bytes.
-
-   This is used to align code labels according to Intel recommendations.  */
-
-#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
-#  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
 \f
 /* A C statement or statements which output an assembler instruction
    opcode to the stdio stream STREAM.  The macro-operand PTR is a
index a23e7ab3eb791a72a8516d228d05e5c75d4df881..57d678136279465d86bfe6372175ef12b8f09708 100644 (file)
@@ -93,18 +93,6 @@ along with GCC; see the file COPYING3.  If not see
 
 #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 || (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
-
 /* Handle special EH pointer encodings.  Absolute, pc-relative, and
    indirect are handled automatically.  */
 #define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
index 68f33f96f5aa72745a0c531782273acd44272377..48079c8cffac99668d89d132cd184f95f68213f5 100644 (file)
@@ -20946,7 +20946,7 @@ ix86_min_insn_size (rtx_insn *insn)
     return 2;
 }
 
-#ifdef ASM_OUTPUT_MAX_SKIP_PAD
+#ifdef ASM_OUTPUT_MAX_SKIP_ALIGN
 
 /* AMD K8 core mispredicts jumps when there are more than 3 jumps in 16 byte
    window.  */
@@ -21274,7 +21274,7 @@ ix86_reorg (void)
        ix86_pad_short_function ();
       else if (TARGET_PAD_RETURNS)
        ix86_pad_returns ();
-#ifdef ASM_OUTPUT_MAX_SKIP_PAD
+#ifdef ASM_OUTPUT_MAX_SKIP_ALIGN
       if (TARGET_FOUR_JUMP_LIMIT)
        ix86_avoid_jump_mispredicts ();
 #endif
index 96b46bac23858fed50a3a7e369d0cd9fd821d1c6..97d6f3863cb292ae0e4b86a7762133ceebecce63 100644 (file)
@@ -2068,15 +2068,15 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
    bytes if it is within MAX_SKIP bytes.  */
 
 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
-#undef  ASM_OUTPUT_MAX_SKIP_PAD
-#define ASM_OUTPUT_MAX_SKIP_PAD(FILE, LOG, MAX_SKIP)                   \
-  if ((LOG) != 0)                                                      \
-    {                                                                  \
+# define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)                  \
+  do {                                                                 \
+    if ((LOG) != 0) {                                                  \
       if ((MAX_SKIP) == 0 || (MAX_SKIP) >= (1 << (LOG)) - 1)           \
-        fprintf ((FILE), "\t.p2align %d\n", (LOG));                    \
+       fprintf ((FILE), "\t.p2align %d\n", (LOG));                     \
       else                                                             \
-        fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));    \
-    }
+       fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));     \
+    }                                                                  \
+  } while (0)
 #endif
 
 /* Write the extra assembler code needed to declare a function
index b7f3e36a70cbbc4de856810779ffd52ec096fd93..70ff29b3afaa39b36e0f2b927beee994789209f2 100644 (file)
   [(unspec_volatile [(match_operand 0)] UNSPECV_ALIGN)]
   ""
 {
-#ifdef ASM_OUTPUT_MAX_SKIP_PAD
-  ASM_OUTPUT_MAX_SKIP_PAD (asm_out_file, 4, (int)INTVAL (operands[0]));
+#ifdef ASM_OUTPUT_MAX_SKIP_ALIGN
+  ASM_OUTPUT_MAX_SKIP_ALIGN (asm_out_file, 4, (int)INTVAL (operands[0]));
 #else
   /* It is tempting to use ASM_OUTPUT_ALIGN here, but we don't want to do that.
      The align insn is used to avoid 3 jump instructions in the row to improve
index be99406b3b748800d664c9fc42455a5216d4baca..33012b2526dab3cd30afcba3a5399ff2ffc24f3d 100644 (file)
@@ -66,16 +66,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #define SUBALIGN_LOG 3
 
-#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)                   \
-  do {                                                                 \
-    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));     \
-    }                                                                  \
-  } while (0)
-
 /* Handle special EH pointer encodings.  Absolute, pc-relative, and
    indirect are handled automatically.  */
 #define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
index 480401688436e8d214c82a3dfd57c612a150f7b7..70b2587e6cbf33a07c94939a65383d9b2d51a249 100644 (file)
@@ -50,24 +50,6 @@ along with GCC; see the file COPYING3.  If not see
    : (n) == 7 ? 4                                                      \
    : ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (int) (n) + 8 \
    : (-1))
-  
-/* 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.
-
-   This is used to align code labels according to Intel recommendations.  */
-
-#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
-#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)                   \
-  do {                                                                 \
-    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));     \
-    }                                                                  \
-  } while (0)
-#endif
 
 /* Undefine SUBTARGET_EXTRA_SPECS it is empty anyway.  We define it in
    config/lynx.h.  */
index a0bbfd0ef405e2aab93ef26af6acb960c6453f6b..66cd192cf8a197b95904c9942ce42d2aebfd5319 100644 (file)
@@ -95,22 +95,6 @@ along with GCC; see the file COPYING3.  If not see
        assemble_name(FILE, NAME2);      \
        fputc('\n', FILE); } while (0)
 
-/* 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.
-
-   This is used to align code labels according to Intel recommendations.  */
-
-#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
-#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
-
 /* We always use gas here, so we don't worry about ECOFF assembler
    problems.  */
 #undef TARGET_GAS
index c411ff5309a072afecc9034766961581c281c550..862ba12583f5c89b072cd072c43ae8c20f9827c9 100644 (file)
@@ -61,24 +61,8 @@ along with GCC; see the file COPYING3.  If not see
 #undef ASM_APP_OFF
 #define ASM_APP_OFF "#NO_APP\n"
 
-/* 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.  */
-
 #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 || (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
-
 /* OpenBSD's profiler recovers all information from the stack pointer.
    The icky part is not here, but in <machine/profile.h>.  */
 #undef FUNCTION_PROFILER
index 0cdd980f48105cf07a08fa645844e88ebc959f4c..ea872a487216ce7ba74cc47227816a44c43a0acd 100644 (file)
@@ -70,32 +70,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
     }                                                                \
   while (0)
 
-/* 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 || (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)
-#undef  ASM_OUTPUT_MAX_SKIP_PAD
-#define ASM_OUTPUT_MAX_SKIP_PAD(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
-
-
 /* i386 System V Release 4 uses DWARF debugging info.
    x86-64 ABI specifies DWARF2.  */