Compiler Options

Michael Proto mproto at
Fri Nov 10 22:09:11 UTC 2006

>From /usr/src/sys/conf/

# 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
# per function call.  While the 16-byte alignment may benefit micro
# it is probably an overall loss 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).  Explicitly prohibit the use of SSE and other SIMD
# operations inside the kernel itself.  These operations are exclusively
# reserved for user applications.
.if ${MACHINE_ARCH} == "i386" && ${CC} != "icc"
CFLAGS+=        -mno-align-long-strings -mpreferred-stack-boundary=2 \
                -mno-mmx -mno-3dnow -mno-sse -mno-sse2


Jason C. Wells wrote:
> I have set CPUTYPE=p3 in make.conf.  When I compile my kernel I see
> -march=pentium3 as I expect.  I also see -mno-mmx and -mno-sse are set
> which I do not expect given that -march=pentium3 is used.  I presume
> that I want MMX and SSE since my processor supports it.  What options do
> I set and where do I set them to get a kernel properly tuned for pentium3?
> Thanks,
> Jason C. Wells
> _______________________________________________
> freebsd-stable at mailing list
> To unsubscribe, send any mail to "freebsd-stable-unsubscribe at"

Michael Proto            | SecureWorks
Unix Administrator       |
PGP ID: 5D575BBE         | mproto at

More information about the freebsd-stable mailing list