This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
A Linux patch for .p2align
- To: Frank dot Heldt at t-online dot de (Frank Heldt)
- Subject: A Linux patch for .p2align
- From: hjl at lucon dot org (H.J. Lu)
- Date: Sun, 14 Jun 1998 16:43:25 -0700 (PDT)
- Cc: egcs at cygnus dot com, egcs-patches at cygnus dot com
>
> Hello everbody,
>
> although John Wehle did a great job with the new alignment stuff
> for the x86 family, it isn't active per default on linux. Is this
> intention and how do i enable this *really* usefull feature (it's
> like a "turbo" switch on some benchmarks !) ?
>
Here is a patch.
H.J.
----
Fri Jun 12 08:06:55 1998 H.J. Lu (hjl@gnu.org)
* config/i386/linux.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Defined.
Include <stdio.h>.
Index: config/i386/linux.h
===================================================================
RCS file: /home/work/cvs/gnu/egcs/gcc/config/i386/linux.h,v
retrieving revision 1.1.1.6
diff -u -p -r1.1.1.6 linux.h
--- linux.h 1998/05/22 14:05:30 1.1.1.6
+++ linux.h 1998/06/12 16:03:34
@@ -22,6 +22,9 @@ Boston, MA 02111-1307, USA. */
#define LINUX_DEFAULT_ELF
+/* To get the prototype right. */
+#include <stdio.h>
+
/* A lie, I guess, but the general idea behind linux/ELF is that we are
supposed to be outputting something that will assemble under SVr4.
This gets us pretty close. */
@@ -218,3 +221,14 @@ Boston, MA 02111-1307, USA. */
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
+
+/* 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. */
+
+#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))