# newer AMD arch in kernel section?

## _______0

hi all,

There's a section in kernel config to specify cpu arch but I don't see anywhere newer amd option:

```
Processor type and features

--> Processor family (Generic-x86-64)

----> ( ) Opteron/Athlon64/Hammer/K8

         ( ) Intel P4 / older Netburst based Xeon

         ( ) Core 2/newer Xeon

         ( ) Intel Atom

         (X) Generic-x86-64

```

Could it be that there aren't kernel optimizations for newer amd chips??

thanks.

----------

## chithanh

These options mostly affect the compiler flags. You can edit the Makefiles and use kernel CFLAGS which are more specific to your CPU, but be aware that these are not tested well and may lead to unexpected results.

----------

## aCOSwt

 *chithanh wrote:*   

> You can edit the Makefiles and use kernel CFLAGS

 

Use something like http://www.linuxforge.net/linux/kernel/kernel-33-gcc47-0.patch instead.

(Or at list as a guidance for which makefiles to modify.)

 *chithanh wrote:*   

> may lead to unexpected results.

 

Indeed, in many cases, -mtune=generic has been reported generating better code.

Of course, when kernel devs deliberatly make -march=core2 -mtune=generic, they know what they do.

BTW, as whatever you fiddle will end in ,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow... I fear that what you can expect from newer instruction sets will make the figures you obtain fall into the stdev of your benchmarks... that is to say :Un-noticeable !   :Twisted Evil: 

----------

## darklegion

 *aCOSwt wrote:*   

>  *chithanh wrote:*   You can edit the Makefiles and use kernel CFLAGS 
> 
> Use something like http://www.linuxforge.net/linux/kernel/kernel-33-gcc47-0.patch instead.
> 
> (Or at list as a guidance for which makefiles to modify.)
> ...

 

Does the kernel really disable SSE? Seems like this would be an issue with modern AMD processors at least, which don't natively support x87 instructions.

----------

## Ant P.

The kernel doesn't use floating-point, and context switches to using vector registers are risky and expensive when it's the one that has to handle saving/restoring state.

----------

## aCOSwt

 *darklegion wrote:*   

> Does the kernel really disable SSE? Seems like this would be an issue with modern AMD processors at least, which don't natively support x87 instructions.

 

It actually does : */usr/src/linux/arch/x86/Makefile wrote:*   

> # prevent gcc from generating any FP code by mistake
> 
> KBUILD_CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,)

 

As Ant P. wrote, the kernel does not like floating point, it always prefer working like this :

```
   int fref, temp, fout, mfd;

   temp = 100 * fsys / fref;

   mfd = 4 * BUSDIV * temp / 100;
```

----------

