linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Possibility of adding -march=native to x86
       [not found] <0EC33A59AA72084CA28B83816B40929F02682BB3@REEDXCLSXM01V03.rbsres01.net>
@ 2007-10-25 18:33 ` Michael Lothian
  2007-10-25 18:50   ` Adrian Bunk
  2007-10-26  9:16   ` Thomas Gleixner
  0 siblings, 2 replies; 19+ messages in thread
From: Michael Lothian @ 2007-10-25 18:33 UTC (permalink / raw)
  To: linux-kernel

Hi

I was wondering if it was possible to add -march=native support to the
processor options of the new x86 architecture if gcc 4.2 or greater is being
used.

I'm not suggesting this should be a default at all, merely an extra option
similar to selecting P4, Athlon or even -Os.

I've manually tried this flag at home with no ill effects.

Mike

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Possibility of adding -march=native to x86
  2007-10-25 18:33 ` Possibility of adding -march=native to x86 Michael Lothian
@ 2007-10-25 18:50   ` Adrian Bunk
  2007-10-25 19:09     ` Michael Lothian
  2007-10-26  9:16   ` Thomas Gleixner
  1 sibling, 1 reply; 19+ messages in thread
From: Adrian Bunk @ 2007-10-25 18:50 UTC (permalink / raw)
  To: Michael Lothian; +Cc: linux-kernel

On Thu, Oct 25, 2007 at 07:33:35PM +0100, Michael Lothian wrote:
> Hi
> 
> I was wondering if it was possible to add -march=native support to the
> processor options of the new x86 architecture if gcc 4.2 or greater is being
> used.
> 
> I'm not suggesting this should be a default at all, merely an extra option
> similar to selecting P4, Athlon or even -Os.
> 
> I've manually tried this flag at home with no ill effects.

Selecting your CPU in the kernel configuration has more effects than 
just setting the gcc flag, so it wouldn't gain you anything since you 
anyway have to choose the correct CPU.

> Mike

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Possibility of adding -march=native to x86
  2007-10-25 18:50   ` Adrian Bunk
@ 2007-10-25 19:09     ` Michael Lothian
  2007-10-25 19:17       ` Adrian Bunk
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Lothian @ 2007-10-25 19:09 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel

Actually I changed the Makefile.cpu and changed the -march to native
which did slightly change the size of the kernel (slightly larger I
think)

So what else does that option change?

Mike

On 25/10/2007, Adrian Bunk <bunk@kernel.org> wrote:
> On Thu, Oct 25, 2007 at 07:33:35PM +0100, Michael Lothian wrote:
> > Hi
> >
> > I was wondering if it was possible to add -march=native support to the
> > processor options of the new x86 architecture if gcc 4.2 or greater is being
> > used.
> >
> > I'm not suggesting this should be a default at all, merely an extra option
> > similar to selecting P4, Athlon or even -Os.
> >
> > I've manually tried this flag at home with no ill effects.
>
> Selecting your CPU in the kernel configuration has more effects than
> just setting the gcc flag, so it wouldn't gain you anything since you
> anyway have to choose the correct CPU.
>
> > Mike
>
> cu
> Adrian
>
> --
>
>        "Is there not promise of rain?" Ling Tan asked suddenly out
>         of the darkness. There had been need of rain for many days.
>        "Only a promise," Lao Er said.
>                                        Pearl S. Buck - Dragon Seed
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Possibility of adding -march=native to x86
  2007-10-25 19:09     ` Michael Lothian
@ 2007-10-25 19:17       ` Adrian Bunk
  2007-10-25 19:32         ` Michael Lothian
  0 siblings, 1 reply; 19+ messages in thread
From: Adrian Bunk @ 2007-10-25 19:17 UTC (permalink / raw)
  To: Michael Lothian; +Cc: linux-kernel

On Thu, Oct 25, 2007 at 08:09:56PM +0100, Michael Lothian wrote:
> Actually I changed the Makefile.cpu and changed the -march to native
> which did slightly change the size of the kernel (slightly larger I
> think)
> 
> So what else does that option change?

Look at arch/i386/Kconfig.cpu

> Mike

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Possibility of adding -march=native to x86
  2007-10-25 19:17       ` Adrian Bunk
@ 2007-10-25 19:32         ` Michael Lothian
  2007-10-25 19:50           ` Adrian Bunk
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Lothian @ 2007-10-25 19:32 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel

On 25/10/2007, Adrian Bunk <bunk@kernel.org> wrote:
> On Thu, Oct 25, 2007 at 08:09:56PM +0100, Michael Lothian wrote:
> > Actually I changed the Makefile.cpu and changed the -march to native
> > which did slightly change the size of the kernel (slightly larger I
> > think)
> >
> > So what else does that option change?
>
> Look at arch/i386/Kconfig.cpu
>

Can you be a bit more specific?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Possibility of adding -march=native to x86
  2007-10-25 19:32         ` Michael Lothian
@ 2007-10-25 19:50           ` Adrian Bunk
  2007-10-25 20:12             ` Michael Lothian
  0 siblings, 1 reply; 19+ messages in thread
From: Adrian Bunk @ 2007-10-25 19:50 UTC (permalink / raw)
  To: Michael Lothian; +Cc: linux-kernel

On Thu, Oct 25, 2007 at 08:32:51PM +0100, Michael Lothian wrote:
> On 25/10/2007, Adrian Bunk <bunk@kernel.org> wrote:
> > On Thu, Oct 25, 2007 at 08:09:56PM +0100, Michael Lothian wrote:
> > > Actually I changed the Makefile.cpu and changed the -march to native
> > > which did slightly change the size of the kernel (slightly larger I
> > > think)
> > >
> > > So what else does that option change?
> >
> > Look at arch/i386/Kconfig.cpu
> >
> 
> Can you be a bit more specific?

Let's make an example:

Consider you want to compile a kernel for your P4.

The MPENTIUM4 option does not only set -march=pentium4, it also enables 
several other options in arch/i386/Kconfig.cpu resulting in better 
performance.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Possibility of adding -march=native to x86
  2007-10-25 19:50           ` Adrian Bunk
@ 2007-10-25 20:12             ` Michael Lothian
  2007-10-25 20:20               ` Adrian Bunk
  2007-10-25 20:40               ` Gabriel C
  0 siblings, 2 replies; 19+ messages in thread
From: Michael Lothian @ 2007-10-25 20:12 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel

> The MPENTIUM4 option does not only set -march=pentium4, it also enables
> several other options in arch/i386/Kconfig.cpu resulting in better
> performance.

How about an autodetect to set the right options here too using cpuid?

With a warning of course that the code produced will be specifically
for the native cpu that it's compiled on.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Possibility of adding -march=native to x86
  2007-10-25 20:12             ` Michael Lothian
@ 2007-10-25 20:20               ` Adrian Bunk
  2007-10-25 20:20                 ` Arjan van de Ven
  2007-10-26 10:41                 ` Pádraig Brady
  2007-10-25 20:40               ` Gabriel C
  1 sibling, 2 replies; 19+ messages in thread
From: Adrian Bunk @ 2007-10-25 20:20 UTC (permalink / raw)
  To: Michael Lothian; +Cc: linux-kernel

On Thu, Oct 25, 2007 at 09:12:45PM +0100, Michael Lothian wrote:
> > The MPENTIUM4 option does not only set -march=pentium4, it also enables
> > several other options in arch/i386/Kconfig.cpu resulting in better
> > performance.
> 
> How about an autodetect to set the right options here too using cpuid?
> 
> With a warning of course that the code produced will be specifically
> for the native cpu that it's compiled on.

If you don't know or can figure out yourself the CPU you have, you'd 
better not compile your own kernel...

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Possibility of adding -march=native to x86
  2007-10-25 20:20               ` Adrian Bunk
@ 2007-10-25 20:20                 ` Arjan van de Ven
  2007-10-26 10:41                 ` Pádraig Brady
  1 sibling, 0 replies; 19+ messages in thread
From: Arjan van de Ven @ 2007-10-25 20:20 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Michael Lothian, linux-kernel

On Thu, 25 Oct 2007 22:20:31 +0200
Adrian Bunk <bunk@kernel.org> wrote:

> On Thu, Oct 25, 2007 at 09:12:45PM +0100, Michael Lothian wrote:
> > > The MPENTIUM4 option does not only set -march=pentium4, it also
> > > enables several other options in arch/i386/Kconfig.cpu resulting
> > > in better performance.
> > 
> > How about an autodetect to set the right options here too using
> > cpuid?
> > 
> > With a warning of course that the code produced will be specifically
> > for the native cpu that it's compiled on.
> 
> If you don't know or can figure out yourself the CPU you have, you'd 
> better not compile your own kernel...
> 
... or if there is more than just one CPU type, you pick generic.


-- 
If you want to reach me at my work email, use arjan@linux.intel.com
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Possibility of adding -march=native to x86
  2007-10-25 20:12             ` Michael Lothian
  2007-10-25 20:20               ` Adrian Bunk
@ 2007-10-25 20:40               ` Gabriel C
  2007-10-25 21:30                 ` Michael Lothian
  1 sibling, 1 reply; 19+ messages in thread
From: Gabriel C @ 2007-10-25 20:40 UTC (permalink / raw)
  To: Michael Lothian; +Cc: Adrian Bunk, linux-kernel

Michael Lothian wrote:
>> The MPENTIUM4 option does not only set -march=pentium4, it also enables
>> several other options in arch/i386/Kconfig.cpu resulting in better
>> performance.
> 
> How about an autodetect to set the right options here too using cpuid?
> 
> With a warning of course that the code produced will be specifically
> for the native cpu that it's compiled on.

And kill off all Distro kernels right ? IMO to set that auto magically is bad.

Regards,

Gabriel 


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Possibility of adding -march=native to x86
  2007-10-25 20:40               ` Gabriel C
@ 2007-10-25 21:30                 ` Michael Lothian
  2007-10-25 21:46                   ` Adrian Bunk
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Lothian @ 2007-10-25 21:30 UTC (permalink / raw)
  To: Gabriel C; +Cc: Adrian Bunk, linux-kernel

On 25/10/2007, Gabriel C <nix.or.die@googlemail.com> wrote:
> Michael Lothian wrote:
> >> The MPENTIUM4 option does not only set -march=pentium4, it also enables
> >> several other options in arch/i386/Kconfig.cpu resulting in better
> >> performance.
> >
> > How about an autodetect to set the right options here too using cpuid?
> >
> > With a warning of course that the code produced will be specifically
> > for the native cpu that it's compiled on.
>
> And kill off all Distro kernels right ? IMO to set that auto magically is bad.
>
> Regards,
>
> Gabriel
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>
Yes for something like a distro kernel it is bad but as I said before
this isn't what this is for.

Eventually it would be nice to to a make localkernel and for a
customised kernel to be build compiling in all pci / pci express
drivers into the kernel and all usb devices as modules.

Auto magically detecting the cpu would be part of that

I hate getting a new piece of kit and then have to figure out from
lspci which options need to be turned on and the the really iritation
part of finding the option in make menuconfig

Detecting the cpu and using march=native could be all part of that

Mike

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Possibility of adding -march=native to x86
  2007-10-25 21:30                 ` Michael Lothian
@ 2007-10-25 21:46                   ` Adrian Bunk
  2007-10-25 22:04                     ` H. Peter Anvin
                                       ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Adrian Bunk @ 2007-10-25 21:46 UTC (permalink / raw)
  To: Michael Lothian; +Cc: Gabriel C, linux-kernel

On Thu, Oct 25, 2007 at 10:30:09PM +0100, Michael Lothian wrote:
> On 25/10/2007, Gabriel C <nix.or.die@googlemail.com> wrote:
> > Michael Lothian wrote:
> > >> The MPENTIUM4 option does not only set -march=pentium4, it also enables
> > >> several other options in arch/i386/Kconfig.cpu resulting in better
> > >> performance.
> > >
> > > How about an autodetect to set the right options here too using cpuid?
> > >
> > > With a warning of course that the code produced will be specifically
> > > for the native cpu that it's compiled on.
> >
> > And kill off all Distro kernels right ? IMO to set that auto magically is bad.
> >
> > Regards,
> >
> > Gabriel
> >
> Yes for something like a distro kernel it is bad but as I said before
> this isn't what this is for.
> 
> Eventually it would be nice to to a make localkernel and for a
> customised kernel to be build compiling in all pci / pci express
> drivers into the kernel and all usb devices as modules.
> 
> Auto magically detecting the cpu would be part of that
> 
> I hate getting a new piece of kit and then have to figure out from
> lspci which options need to be turned on and the the really iritation
> part of finding the option in make menuconfig

What exactly is irritating?
Please name the problems so that they can be fixed.

> Detecting the cpu and using march=native could be all part of that

You don't need march=native for this.

You have to set the right config option for your CPU and you 
automatically get the right compiler options.

> Mike

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Possibility of adding -march=native to x86
  2007-10-25 21:46                   ` Adrian Bunk
@ 2007-10-25 22:04                     ` H. Peter Anvin
  2007-10-25 22:42                     ` Michael Lothian
       [not found]                     ` <fc94aae90710251518l1cc129eahf570177e5b516197@mail.gmail.com>
  2 siblings, 0 replies; 19+ messages in thread
From: H. Peter Anvin @ 2007-10-25 22:04 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Michael Lothian, Gabriel C, linux-kernel

Adrian Bunk wrote:
>>>
>> Yes for something like a distro kernel it is bad but as I said before
>> this isn't what this is for.
>>
>> Eventually it would be nice to to a make localkernel and for a
>> customised kernel to be build compiling in all pci / pci express
>> drivers into the kernel and all usb devices as modules.
>>
>> Auto magically detecting the cpu would be part of that
>>
>> I hate getting a new piece of kit and then have to figure out from
>> lspci which options need to be turned on and the the really iritation
>> part of finding the option in make menuconfig
> 
> What exactly is irritating?
> Please name the problems so that they can be fixed.
> 
>> Detecting the cpu and using march=native could be all part of that
> 
> You don't need march=native for this.
> 
> You have to set the right config option for your CPU and you 
> automatically get the right compiler options.
> 

There was a long discussion years ago -- the infamous "Aunt Tillie" 
thread -- about automatically configuring customized kernels for 
specific hardware.

It's somewhat of an unusual thing to bother with these days, except for 
people who develop and maintain the kernel.

	-hpa

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Possibility of adding -march=native to x86
  2007-10-25 21:46                   ` Adrian Bunk
  2007-10-25 22:04                     ` H. Peter Anvin
@ 2007-10-25 22:42                     ` Michael Lothian
  2007-10-25 22:58                       ` Adrian Bunk
       [not found]                     ` <fc94aae90710251518l1cc129eahf570177e5b516197@mail.gmail.com>
  2 siblings, 1 reply; 19+ messages in thread
From: Michael Lothian @ 2007-10-25 22:42 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Gabriel C, linux-kernel

> What exactly is irritating?
> Please name the problems so that they can be fixed.
>
> > Detecting the cpu and using march=native could be all part of that
>
> You don't need march=native for this.
>
> You have to set the right config option for your CPU and you
> automatically get the right compiler options.

Well when doing a lspci here are some specific examples:



03:02.0 Multimedia controller: Philips Semiconductors SAA7146 (rev 01)

What modules would you think you'd need to compile to get this to work?

No it's not budget card os buget card ci even though the card its self
has no cam interface



00:14.2 Audio device: ATI Technologies Inc SB600 Azalia

Is there any indication from this piece of info that the intel hda
driver is required?



00:12.0 SATA controller: ATI Technologies Inc SB600 Non-Raid-5 SATA

This uses AHCI



As for the i2c and the hardware monitoring support well that's mostly guess work


Half the time it's easier doing a lsmod when booted on a livecd and
trying to figure out what options are required from the module names
which sometime can be just as tricky.

Why not auto detect the CPU the same way GCC does and automatically
set the correct CPU and then go the whole hog and let GCC use the
correct flags if it's new enough using native

I can't understand why you wouldn't find this useful when setting up a
customised kernel.

Maybe even having a make addnewhardware option to quickly add extra
devices to your config file.

Mike

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Possibility of adding -march=native to x86
  2007-10-25 22:42                     ` Michael Lothian
@ 2007-10-25 22:58                       ` Adrian Bunk
  0 siblings, 0 replies; 19+ messages in thread
From: Adrian Bunk @ 2007-10-25 22:58 UTC (permalink / raw)
  To: Michael Lothian; +Cc: Gabriel C, linux-kernel

On Thu, Oct 25, 2007 at 11:42:47PM +0100, Michael Lothian wrote:
> > What exactly is irritating?
> > Please name the problems so that they can be fixed.
> >
> > > Detecting the cpu and using march=native could be all part of that
> >
> > You don't need march=native for this.
> >
> > You have to set the right config option for your CPU and you
> > automatically get the right compiler options.
> 
> Well when doing a lspci here are some specific examples:
> 
> 
> 
> 03:02.0 Multimedia controller: Philips Semiconductors SAA7146 (rev 01)
> 
> What modules would you think you'd need to compile to get this to work?
> 
> No it's not budget card os buget card ci even though the card its self
> has no cam interface
> 
> 
> 
> 00:14.2 Audio device: ATI Technologies Inc SB600 Azalia
> 
> Is there any indication from this piece of info that the intel hda
> driver is required?
> 
> 
> 
> 00:12.0 SATA controller: ATI Technologies Inc SB600 Non-Raid-5 SATA
> 
> This uses AHCI
> 
> 
> 
> As for the i2c and the hardware monitoring support well that's mostly guess work
> 
> 
> Half the time it's easier doing a lsmod when booted on a livecd and
> trying to figure out what options are required from the module names
> which sometime can be just as tricky.

Sure, distributions already have solved this and you can use their 
work.

> Why not auto detect the CPU the same way GCC does and automatically
> set the correct CPU and then go the whole hog and let GCC use the
> correct flags if it's new enough using native
> 
> I can't understand why you wouldn't find this useful when setting up a
> customised kernel.
> 
> Maybe even having a make addnewhardware option to quickly add extra
> devices to your config file.

Knowing your CPU is much easier to figure out than to figure out the 
BIOS settings of your SATA controller that determine how to access it.

If you do not even know what CPU you have you should really not compile 
your own kernel.

> Mike

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Possibility of adding -march=native to x86
       [not found]                       ` <20071025222826.GY30533@stusta.de>
@ 2007-10-25 22:58                         ` Michael Lothian
  0 siblings, 0 replies; 19+ messages in thread
From: Michael Lothian @ 2007-10-25 22:58 UTC (permalink / raw)
  To: Adrian Bunk, linux-kernel

> > Half the time it's easier doing a lsmod when booted on a livecd and
> > trying to figure out what options are required from the module names
> > which sometime can be just as tricky.
>
> Sure, distributions already have solved this and you can use their
> work.

I like compiling my own kernel it's just a pain doing it the first
time on a new motherboard or when adding a new piece of hardware

> > Maybe even having a make addnewhardware option to quickly add extra
> > devices to your config file.
>
> Knowing your CPU is much easier to figure out than to figure out the
> BIOS settings of your SATA controller that determine how to access it.

So how do distro's figure out which driver to use? Isn't it a matter
of taking the pci-ids and selecting the correct driver?

> If you do not even know what CPU you have you should really not compile
> your own kernel.

It about ease of use, look at the new core2 architecture, if your gcc
is new enough there is a march=core2 else you use an older flag

Same with the new cell architecture you use cell if your using gcc 4.3
alpha or 930 if it's not that new.

What I'm saying is sometimes GCC or the Kernel is better at making
these decisions or at least make it easier

Mike

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Possibility of adding -march=native to x86
  2007-10-25 18:33 ` Possibility of adding -march=native to x86 Michael Lothian
  2007-10-25 18:50   ` Adrian Bunk
@ 2007-10-26  9:16   ` Thomas Gleixner
  1 sibling, 0 replies; 19+ messages in thread
From: Thomas Gleixner @ 2007-10-26  9:16 UTC (permalink / raw)
  To: Michael Lothian; +Cc: linux-kernel


On Thu, 25 Oct 2007, Michael Lothian wrote:

> Hi
> 
> I was wondering if it was possible to add -march=native support to the
> processor options of the new x86 architecture if gcc 4.2 or greater is being
> used.
> 
> I'm not suggesting this should be a default at all, merely an extra option
> similar to selecting P4, Athlon or even -Os.
> 
> I've manually tried this flag at home with no ill effects.

It works for your specific setup, but it will kill distro compiles as
well as cross compiling.

     tglx

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Possibility of adding -march=native to x86
  2007-10-25 20:20               ` Adrian Bunk
  2007-10-25 20:20                 ` Arjan van de Ven
@ 2007-10-26 10:41                 ` Pádraig Brady
  2007-10-26 11:45                   ` Adrian Bunk
  1 sibling, 1 reply; 19+ messages in thread
From: Pádraig Brady @ 2007-10-26 10:41 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Michael Lothian, linux-kernel

Adrian Bunk wrote:
> On Thu, Oct 25, 2007 at 09:12:45PM +0100, Michael Lothian wrote:
>>> The MPENTIUM4 option does not only set -march=pentium4, it also enables
>>> several other options in arch/i386/Kconfig.cpu resulting in better
>>> performance.
>> How about an autodetect to set the right options here too using cpuid?
>>
>> With a warning of course that the code produced will be specifically
>> for the native cpu that it's compiled on.
> 
> If you don't know or can figure out yourself the CPU you have, you'd 
> better not compile your own kernel...

There also is the added variable of what your version of gcc supports.
The kernel gcc options would have to be the highest common factor.
See also http://www.pixelbeat.org/scripts/gcccpuopt

Pádraig.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Possibility of adding -march=native to x86
  2007-10-26 10:41                 ` Pádraig Brady
@ 2007-10-26 11:45                   ` Adrian Bunk
  0 siblings, 0 replies; 19+ messages in thread
From: Adrian Bunk @ 2007-10-26 11:45 UTC (permalink / raw)
  To: Pádraig Brady; +Cc: Michael Lothian, linux-kernel

On Fri, Oct 26, 2007 at 11:41:18AM +0100, Pádraig Brady wrote:
> Adrian Bunk wrote:
> > On Thu, Oct 25, 2007 at 09:12:45PM +0100, Michael Lothian wrote:
> >>> The MPENTIUM4 option does not only set -march=pentium4, it also enables
> >>> several other options in arch/i386/Kconfig.cpu resulting in better
> >>> performance.
> >> How about an autodetect to set the right options here too using cpuid?
> >>
> >> With a warning of course that the code produced will be specifically
> >> for the native cpu that it's compiled on.
> > 
> > If you don't know or can figure out yourself the CPU you have, you'd 
> > better not compile your own kernel...
> 
> There also is the added variable of what your version of gcc supports.
> The kernel gcc options would have to be the highest common factor.
> See also http://www.pixelbeat.org/scripts/gcccpuopt

arch/i386/Makefile.cpu already does more or less the same.

> Pádraig.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2007-10-26 11:45 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <0EC33A59AA72084CA28B83816B40929F02682BB3@REEDXCLSXM01V03.rbsres01.net>
2007-10-25 18:33 ` Possibility of adding -march=native to x86 Michael Lothian
2007-10-25 18:50   ` Adrian Bunk
2007-10-25 19:09     ` Michael Lothian
2007-10-25 19:17       ` Adrian Bunk
2007-10-25 19:32         ` Michael Lothian
2007-10-25 19:50           ` Adrian Bunk
2007-10-25 20:12             ` Michael Lothian
2007-10-25 20:20               ` Adrian Bunk
2007-10-25 20:20                 ` Arjan van de Ven
2007-10-26 10:41                 ` Pádraig Brady
2007-10-26 11:45                   ` Adrian Bunk
2007-10-25 20:40               ` Gabriel C
2007-10-25 21:30                 ` Michael Lothian
2007-10-25 21:46                   ` Adrian Bunk
2007-10-25 22:04                     ` H. Peter Anvin
2007-10-25 22:42                     ` Michael Lothian
2007-10-25 22:58                       ` Adrian Bunk
     [not found]                     ` <fc94aae90710251518l1cc129eahf570177e5b516197@mail.gmail.com>
     [not found]                       ` <20071025222826.GY30533@stusta.de>
2007-10-25 22:58                         ` Michael Lothian
2007-10-26  9:16   ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).