# compiling in 3dnow, mmx, sse, sse2, sse3 support



## deuce63 (Apr 23, 2009)

I had a question, when compiling a new kernel... I'm quite new at this so bear with me.

I noticed the flags said no support for mmx, 3D now, sse, sse2 and sse3.

How would I get the compiler to build in support for these?


----------



## Maledictus (Apr 23, 2009)

The kernel can't use this stuff so don't try to compile it with this stuff enabled. You can still use it in normal userland binaries.


----------



## fabiokaminski (Jul 8, 2010)

*no floating math?*

so all floating math of the kernel is software emulated...

i hope it doesnt do it frequently... :s

but if it uses floats intensely , why  not use it?!

ss2 is veeery old already.. why not use it?


----------



## phoenix (Jul 8, 2010)

Floating point is very, very, very, very rarely (if ever) used inside the kernel itself.

Userspace apps use floating point a lot, and those instructions are enabled for userspace apps.  You'll see these enabled for applications that actually make use of them.  Watch the output from compiling ports, you'll see them enabled in there.


----------



## fronclynne (Jul 9, 2010)

*MMX is like a horse, in that it is evil and it eventually tries to kill you*

If you set [red]CPUTYPE?= [/red] to one of " opteron, athlon64, nocona, prescott, core2" in /etc/make.conf (depending of course on what you have) the system should automatically use those SIMD extensions when compiling (in places where it is appropriate (which won't be within the kernel)).

You can, of course, use lang/gcc44 (or lang/gcc45) when compiling applications from ports(7)*, and use slightly better flags there, too.


* with [thread=7454]caveats[/thread]


----------



## Alt (Jul 9, 2010)

FPU its not same as mmx.. mmx can give good benefit even if your prog dont use floating numbers..

I think setting CPUTYPE should automatically detect all cpu extesions an use them (compiler does that)


----------



## phoenix (Jul 9, 2010)

Which is does.

But everything floating-point related is disabled when compiling the kernel, as the kernel does not use FP.

This is a non-discussion.  Setting CPUTYPE will "do the right thing" for everything.


----------



## fabiokaminski (Jul 10, 2010)

point for Bsd kernel .. for easily deploy in diferents arquitectures 

im hacking a little of it.. and im very impressed ... unlike linux , it has a concise architecture
and i think it has less degradation..

anyway.. nice.


----------

