Carlos E. R. wrote:
The Sunday 2006-02-19 at 19:27 -0500, ken wrote:
"-mcpu=pentium4m" in CFLAGS. Makes smaller and faster code. I think you would get better perfomance with "-march=pentium4m" instead. Actually, I have both set the same. (I set it in some config file a long time ago and don't even remember anymore where I did it.)
Yeah, according to the gcc manpage, it's redundant this way:
Not really.
-march=cpu-type Generate instructions for the machine type cpu-type. The choices for cpu-type are the same as for -mcpu. Moreover, spec- ifying -march=cpu-type implies -mcpu=cpu-type.
but it doesn't give a non-redundant way to specify it. :/
I'm going by memory, no, it is not redundant, both options are... hold on... but... heck, they have changed the options again. -mcpu was what -mtune is now. Obsserve, for an old gcc-2.95.3:
`-mcpu=CPU TYPE' Assume the defaults for the machine type CPU TYPE when scheduling instructions. The choices for CPU TYPE are:
`-march=CPU TYPE' Generate instructions for the machine type CPU TYPE. The choices for CPU TYPE are the same as for `-mcpu'. Moreover, specifying `-march=CPU TYPE' implies `-mcpu=CPU TYPE'.
In gcc 3.3.5 it says instead:
`-mtune=CPU_TYPE' Set only the instruction scheduling parameters for machine type CPU_TYPE. The instruction set is not changed.
`-mcpu=CPU-TYPE' Tune to CPU-TYPE everything applicable about the generated code, except for the ABI and the set of available instructions. The choices for CPU-TYPE are:
`-march=CPU-TYPE' Generate instructions for the machine type CPU-TYPE. The choices for CPU-TYPE are the same as for `-mcpu'. Moreover, specifying `-march=CPU-TYPE' implies `-mcpu=CPU-TYPE'.
Things have changed... I didn't notice this before :-(
Anyway, "march" is the "boss" option, it seems. As it was time ago.
Good, at least we're running the same version of gcc. Taking another look, I see it says that "-mtune" is a machine-dependent option, i.e., it's available only for some machines-- e.g., Sparc, RS/6000 and PowerPC, MIPS, DEC Alpha. The "-mtune" option isn't listed in the gcc manpage as being an option for i386 or x86-64 and other machines. I'm sure we can't assume that everyone on this list is running on x86s, but I guess I was doing that for you, the OP, and myself. :) When I think about it, "-mcpu" is a rather strange option. You tell gcc what kind of processor you have but gcc doesn't use (all of) that cpu's available instructions?? I'm sure the uebergeeks who wrote gcc had some reason for this, but I don't see it. -- "This world ain't big enough for the both of us," said the big noema to the little noema.