# [Solved] SSE[X] and MMX disabled by -march=native.

## Merkil

Hello all.

I'm new in the Gentoo community (I'm from Archlinux) and I discover /etc/make.conf, which is a fantastic configuration file !  :Very Happy: 

So, I chose these options :

```
CFLAGS="-march=native -O2 -fomit-frame-pointer -fprefetch-loop-arrays -fmodulo-sched -ftracer -pipe"
```

They're quite good, I think.

But I just discovered this command, which is able to tell me what CFLAGS are enabled by -march=native :

```
gcc -Q --help=target -march=native
```

And then, I saw that -msse -msse2 -msse3 -mmmx and all their friends are disabled !

But it isn't normal, they should be enabled because I'm using an Athlon64 processor which supports them !

Here is the result of cat /proc/cpuinfo | grep flags :

```
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow up rep_good extd_apicid pni cx16 lahf_lm svm extapic cr8_legacy 3dnowprefetch lbrv
```

So I decided to rebuild my entire system using theses FLAGS :

```
CFLAGS="-march=native -m3dnow -msse -msse2 -msse3 -mmmx -O2 -fomit-frame-pointer -fprefetch-loop-arras -fmodulo-sched -ftracer -pipe"

USE="mmx mmxext sse sse2 sse3 3dnow 3dnowext 3dnowprefetch [and some others]"
```

Is it useful ?

Why the hell weren't these flags enabled by default with -march=native ?

Thank you very much  :Wink: 

PS : I'm sorry for my bad English  :Embarassed: 

PS2 : And I'm sorry if I'm not in the right forum  :Smile: Last edited by Merkil on Tue Oct 19, 2010 6:36 pm; edited 1 time in total

----------

## luscinius

Hi

I ran this command, and for me it shows that -msse is on and -mmmx is not. (On core i7) Maybe some optomization are included by default in 64bit systems as all such processors support sse2 and mmx.

There is another command,

```
cc -march=native -E -v - </dev/null 2>&1 | grep cc1
```

which can determine CPU cache size. 

USE flags are also very useful. If you want to disable the gnome/kde/whatever else dependencies you can do it with some of the USE flags. This is more difficult to do in a binary distro as this would result in a combinatorially large number of packages (I mean a separate package for each USE flags set). Though these things come at the cost of compilation time.

----------

## Jaglover

We do have a thread here where this is discussed thoroughly. Stuff may break if those -m options are forced, packages that support SSE (MMX, etc) have USE flags which you should enable.

For rest of your optimization see http://www.gentoo.org/doc/en/gcc-optimization.xml.

----------

## Ant P.

Those GCC flags aren't separate because the amd64 ABI makes them mandatory. Simple as that. Similarly, using all those -m options with -march=native is redundant.

You might've noticed the USE flags for them are also disabled on a 64-bit profile - because they also don't do anything.

----------

## Merkil

Okay, I understand now  :Smile: 

Thank you very much for all your aswers.

Have a nice week,

Merkil

----------

