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
>From /usr/src/sys/conf/kern.mk:# 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 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 INLINE_LIMIT?= 8000 .endif -Proto 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@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"-- Michael Proto | SecureWorks Unix Administrator | PGP ID: 5D575BBE | mproto@secureworks.com *******************************************************
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. WellsIf i recall correctly, instructions taking advantage of sse, mmx etc. are purposefully disabled in the kernel via the mentioned options. I can not at the moment recall why though. Ordinary userland applications and ports are usually compiled to take advantage of those instructions if the CPU supports them. Regards! //Niclas --
On Fri, 10 Nov 2006 11:34:22 -0800 "Jason C. Wells" <jcw@highperformance.net> 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?The FreeBSD kernel does not use MMX and SSE registers. That is why they are disabled, regardless of the chosen CPUTYPE. Joerg -- | /"\ ASCII ribbon | GnuPG Key ID | e86d b753 3deb e749 6c3a | | \ / campaign against | 0xbbcaad24 | 5706 1f7d 6cfd bbca ad24 | | X HTML in email | .the next sentence is true. | | / \ and news | .the previous sentence was a lie. | -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20061110/ab393bb6/signature.pgp
On Fri, Nov 10, 2006 at 11:34:22AM -0800, 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?The kernel will "support" MMX and SSE -- that is, any programs (root or userland) which use MMX/SSE will work just fine. That is: any programs built with gcc can indeed support MMX and SSE operations. The kernel itself _will not_ use any SSE or MMX operations when built. This is because these optimisations are known to break the FreeBSD kernel. This applies to all i386 architectures, and probably 64-bit architectures too (not sure). CPUTYPE=p3 (or pentium4, or any other type) will not change this behaviour. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |