diff options
-rw-r--r-- | share/mk/bsd.kern.mk | 13 | ||||
-rw-r--r-- | sys/conf/kern.mk | 13 |
2 files changed, 26 insertions, 0 deletions
diff --git a/share/mk/bsd.kern.mk b/share/mk/bsd.kern.mk index b4bd9de..595bc2e 100644 --- a/share/mk/bsd.kern.mk +++ b/share/mk/bsd.kern.mk @@ -19,6 +19,19 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ # # +# On the i386, do not align the stack to 16-byte boundaries. Otherwise GCC +# 2.95 adds code to the entry and exit point of every function to align the +# stack to 16-byte boundaries -- thus wasting approximately 12 bytes of stack +# per function call. While the 16-byte alignment may benefit micro benchmarks, +# it is probably an overall loose as it makes the code bigger (less efficient +# use of code cache tag lines) and uses more stack (less efficient use of data +# cache tag lines) +# +.if ${MACHINE_ARCH} == "i386" +CFLAGS+= -mpreferred-stack-boundary=2 +.endif + +# # On the alpha, make sure that we don't use floating-point registers and # allow the use of EV56 instructions (only needed for low-level i/o). # diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index b4bd9de..595bc2e 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -19,6 +19,19 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ # # +# On the i386, do not align the stack to 16-byte boundaries. Otherwise GCC +# 2.95 adds code to the entry and exit point of every function to align the +# stack to 16-byte boundaries -- thus wasting approximately 12 bytes of stack +# per function call. While the 16-byte alignment may benefit micro benchmarks, +# it is probably an overall loose as it makes the code bigger (less efficient +# use of code cache tag lines) and uses more stack (less efficient use of data +# cache tag lines) +# +.if ${MACHINE_ARCH} == "i386" +CFLAGS+= -mpreferred-stack-boundary=2 +.endif + +# # On the alpha, make sure that we don't use floating-point registers and # allow the use of EV56 instructions (only needed for low-level i/o). # |