View previous topic :: View next topic |
Author |
Message |
planetsheinker Guru


Joined: 26 Feb 2004 Posts: 403 Location: Israel
|
Posted: Thu Dec 30, 2004 2:07 pm Post subject: I am confused... What's better:-march=i686 or -mcpu=i686? |
|
|
I am confused... What's better:
-march=i686 or -mcpu=i686? |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 54928 Location: 56N 3W
|
Posted: Thu Dec 30, 2004 2:20 pm Post subject: |
|
|
planetsheinker,
says Code: | -march=cpu-type
Generate instructions for the machine type cpu-type. The choices
for cpu-type are the same as for -mtune. Moreover, specifying
-march=cpu-type implies -mtune=cpu-type.
-mcpu=cpu-type
A deprecated synonym for -mtune. |
-march=cpu-type may produce code that will not run on earlier processors.
-mcpu=cpu-type and -mtune=cpu-type optimise for the selected CPU without destrying backwards compatabity. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
planetsheinker Guru


Joined: 26 Feb 2004 Posts: 403 Location: Israel
|
Posted: Thu Dec 30, 2004 2:50 pm Post subject: |
|
|
NeddySeagoon wrote: | planetsheinker,
says Code: | -march=cpu-type
Generate instructions for the machine type cpu-type. The choices
for cpu-type are the same as for -mtune. Moreover, specifying
-march=cpu-type implies -mtune=cpu-type.
-mcpu=cpu-type
A deprecated synonym for -mtune. |
-march=cpu-type may produce code that will not run on earlier processors.
-mcpu=cpu-type and -mtune=cpu-type optimise for the selected CPU without destrying backwards compatabity. |
Thanks,
let me see if I got that right: so -march=cpu-type will result in a faster binarys (i dont care that it brakes compatability with older cpu)? |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 54928 Location: 56N 3W
|
Posted: Thu Dec 30, 2004 3:00 pm Post subject: |
|
|
planetsheinker.
-march=cpu-type *may* result in faster binaries. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
planetsheinker Guru


Joined: 26 Feb 2004 Posts: 403 Location: Israel
|
Posted: Thu Dec 30, 2004 3:50 pm Post subject: |
|
|
NeddySeagoon wrote: | planetsheinker.
-march=cpu-type *may* result in faster binaries. |
Why do you say *may*?
As far as I understand, it will defenetly result in a faster system, cuz' the code is compiled with
your CPU in mind. Correct me if I am wrong, yes? |
|
Back to top |
|
 |
hjnenc Veteran


Joined: 15 Aug 2004 Posts: 1599 Location: Vienna, Austria
|
Posted: Thu Dec 30, 2004 5:24 pm Post subject: |
|
|
The average program will run faster but there may be also programs that actually run slower. Keep in mind that most optimizations are based on assumptions of typical program behaviour. |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 54928 Location: 56N 3W
|
Posted: Thu Dec 30, 2004 7:43 pm Post subject: |
|
|
planetsheinker,
What hjnenc says is quite valid but what I had in mind was that not all programs will use the new instructions on later CPUs anyway.
It is quite possible that you can use Code: | -march=pentium7 [1] | and still find your program runs on a 386. It will vary from program to program.
[1] I know there is no pentium7 yet. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
|