From 8e16ab99953149a0936735618e6d26b79651a1b3 Mon Sep 17 00:00:00 2001 From: Samuel Figueroa Date: Tue, 17 Sep 2002 21:36:29 +0000 Subject: [PATCH] Sam Figueroa's change to add ASM_OUTPUT_ALIGN_WITH_NOP. From-SVN: r57261 --- gcc/ChangeLog | 5 +++++ gcc/config/sparc/sparc.h | 7 +++++++ gcc/doc/tm.texi | 5 +++++ gcc/final.c | 4 ++++ 4 files changed, 21 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 472a9b8af60..1aef739a5aa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-09-17 Samuel Figueroa + * final.c (final_scan_insn): Use new macro ASM_OUTPUT_ALIGN_WITH_NOP. + * config/sparc/sparc.h (ASM_OUTPUT_ALIGN_WITH_NOP) New macro. + * doc/tm.texi (ASM_OUTPUT_ALIGN_WITH_NOP) New description. + 2002-09-17 Dale Johannesen * cfgcleanup.c (try_forward_edges): Do not forward a branch to just after a loop exit before loop optimization; diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index d294a07910b..aa7c23af4d9 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -2812,6 +2812,13 @@ do { \ if ((LOG) != 0) \ fprintf (FILE, "\t.align %d\n", (1<<(LOG))) +/* This is how to output an assembler line that says to advance + the location counter to a multiple of 2**LOG bytes using the + "nop" instruction as padding. */ +#define ASM_OUTPUT_ALIGN_WITH_NOP(FILE,LOG) \ + if ((LOG) != 0) \ + fprintf (FILE, "\t.align %d,0x1000000\n", (1<<(LOG))) + #define ASM_OUTPUT_SKIP(FILE,SIZE) \ fprintf (FILE, "\t.skip %u\n", (SIZE)) diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index b4a808b10de..ebc242fdbc0 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -7577,6 +7577,11 @@ A C statement to output to the stdio stream @var{stream} an assembler command to advance the location counter to a multiple of 2 to the @var{power} bytes. @var{power} will be a C expression of type @code{int}. +@findex ASM_OUTPUT_ALIGN_WITH_NOP +@item ASM_OUTPUT_ALIGN_WITH_NOP (@var{stream}, @var{power}) +Like @code{ASM_OUTPUT_ALIGN}, except that the ``nop'' instruction is used +for padding, if necessary. + @findex ASM_OUTPUT_MAX_SKIP_ALIGN @item ASM_OUTPUT_MAX_SKIP_ALIGN (@var{stream}, @var{power}, @var{max_skip}) A C statement to output to the stdio stream @var{stream} an assembler diff --git a/gcc/final.c b/gcc/final.c index 9d2c42632b5..0ff3c3a249c 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -2184,8 +2184,12 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) { #ifdef ASM_OUTPUT_MAX_SKIP_ALIGN ASM_OUTPUT_MAX_SKIP_ALIGN (file, align, max_skip); +#else +#ifdef ASM_OUTPUT_ALIGN_WITH_NOP + ASM_OUTPUT_ALIGN_WITH_NOP (file, align); #else ASM_OUTPUT_ALIGN (file, align); +#endif #endif } } -- 2.30.2