This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Res: Performance Issues and processor arquitecture!


Yes, I was talking to Ian! But unfortunately the issue persists! Understand that 

I am not a programmer, I'm just an enthusiast about the kernel and GCC!

Why using an old architecture for my modern processor I have more performance 
than using the correct architecture?

I discovered that I can change the kernel Makefile and put specific options for 
the processor!

But I would change the HOSTCFLAGS the HOSTCC, CC and CFLAGS!

Now how and where to change all that?

I also read that when using the Pentium 4 processor architecture instead of 
Core2, opcodes are used with smarter pipelines!


My tests are done in a subjective manner, as this video of my current system at 
work:

http://www.youtube.com/watch?v=YTTfglL-2KA



----- Mensagem original ----
De: Jonathan Wakely <jwakely.gcc@gmail.com>
Para: Marcelo Pugliesi <mpugliesi2@yahoo.com.br>
Cc: GCC Help <gcc-help@gcc.gnu.org>
Enviadas: Sexta-feira, 14 de Janeiro de 2011 5:56:27
Assunto: Re: Performance Issues and processor arquitecture!

On 14 January 2011 04:06, Marcelo Pugliesi wrote:
> Hello everybody, I will try to explain as best as possible to make my 
question!
>
> Well, I'm compiling the kernel 2.6.34 or 2.6.36 for Ubuntu 10.10 64bits. I 
have
> a core i7 860 processor, accessing the menuconfig, right at processor family, 
>if
> I check the family Core2/Xeon I have less performance from my kernel than if I
> use the option Pentium 4! No matter if I use the GCC version 4.4.4 or 4.5.1!
> My question then is simple, Why I have a superior performance when using 
>Pentium
> 4 architecture if the GCC documentation tells me I should use the Core2/Xeon 
>for
> a better result?
>
> I found this topic : [GCC] Compiling for a generic x86 architecture
>(http://cboard.cprogramming.com/c-programming/127502-%5Bgcc%5D-compiling-generic-x86-architecture-2.html)
>)
>
>
> Where cyberfish said:
>
> "mtune=... does NOT affect the instruction sets used, or machines the 
>executable
> is run on.
>
> For that (eg, enabling SSE), you'll need march=....
>
> If you do march=core2 for example (on a new GCC), it will use all the
> instruction sets available to Core 2 CPUs. march=x also sets mtune=x. The
> executable won't run on older CPUs.
>
> If you ONLY use mtune=core2, it will generate code that runs the best on a 
Core
> 2, but will still only use instructions available to all x86 CPUs (eg, no 
SSE),
> hence it will still run on old CPUs, just a little slower.
>
> As a real world example, I think a few years ago some Linux distribution 
>decides
> to use -march=pentium3 -mtune=pentium4, or something like that. That means, 
the
> code is guaranteed to run on a P3, but optimized for a P4, since they predict
> most people will be running for a P4.
>
> If you don't use any flag, GCC will assume -march=i386 (lowest x86).
>
> If you want GCC to use all instruction sets on your CPU, and optimize for your
> CPU (because, for example, the code will only be run on your machine), you can
> do -march=native (which also sets mtune=native). Only available in newer GCC 
>(it
> was introduced in 4.3 or 4.4 I THINK).
>
> -m32 and -m64 are only for generating 32-bit code on a 64-bit machine, or
> generating 64-bit code on a 32-bit machine, respectively. GCC defaults to 
>32-bit
> on 32-bit, and 64-bit on 64-bit."
>
> So, the menuconfig processor family just change de mtune flag, and doesn't
> affect the march flag?
>
> Can someone please give me an answer about this, please?

Someone already did
http://gcc.gnu.org/ml/gcc-help/2011-01/msg00125.html





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]