[Bf-committers] scons OSX game engine cvs built well, question
Michael Velikanje
bf-committers@blender.org
Mon, 5 Apr 2004 13:53:57 -0800
Hi
Some info right out of the gcc man pages:
-mcpu=cpu_type
Set architecture type, register usage, choice of mnemonics,
and
instruction scheduling parameters for machine type cpu_type.
Sup-
ported values for cpu_type are rios, rios1, rsc, rios2,
rs64a, 601,
602, 603, 603e, 604, 604e, 620, 630, 740, 7400, 7450, 750,
power,
power2, powerpc, 403, 505, 801, 821, 823, and 860 and common.
-mcpu=common selects a completely generic processor. Code
gener-
ated under this option will run on any POWER or PowerPC
processor.
GCC will use only the instructions in the common subset of
both
architectures, and will not use the MQ register. GCC
assumes a
generic processor model for scheduling purposes.
-mcpu=power, -mcpu=power2, -mcpu=powerpc, and
-mcpu=powerpc64 spec-
ify generic POWER, POWER2, pure 32-bit PowerPC (i.e., not
MPC601),
and 64-bit PowerPC architecture machine types, with an
appropriate,
generic processor model assumed for scheduling purposes.
The other options specify a specific processor. Code
generated
under those options will run best on that processor, and may
not
run at all on others.
The -mcpu options automatically enable or disable other -m
options
as follows:
common
-mno-power, -mno-powerpc
power
power2
rios1
rios2
rsc -mpower, -mno-powerpc, -mno-new-mnemonics
powerpc
rs64a
602
603
603e
604
620
630
740
7400
7450
750
505 -mno-power, -mpowerpc, -mnew-mnemonics
601 -mpower, -mpowerpc, -mnew-mnemonics
403
821
860 -mno-power, -mpowerpc, -mnew-mnemonics, -msoft-float
-mtune=cpu_type
Set the instruction scheduling parameters for machine type
cpu_type, but do not set the architecture type, register
usage, or
choice of mnemonics, as -mcpu=cpu_type would. The same
values for
cpu_type are used for -mtune as for -mcpu. If both are
specified,
the code generated will use the architecture, registers, and
mnemonics set by -mcpu, but the scheduling parameters set by
-mtune.
There are some benefits to -mcpu and -mtune if you're compiling for
yourself and you know what your cpu is, as far as using them for
general distributions, unless you plan on having a different distro.
for each processor G4=ppc7450, G5=ppc970? I think that was what came
up, G3=??.
For a general distribution:
-mcpu=common selects a completely generic processor. Code
gener-
ated under this option will run on any POWER or PowerPC
processor.
GCC will use only the instructions in the common subset of
both
architectures, and will not use the MQ register. GCC
assumes a
generic processor model for scheduling purposes.
Should be safe, but not as good as specific a cpu type for performance.
-ffast-math
Sets -fno-math-errno, -funsafe-math-optimizations, -fno-trap-
ping-math, -ffinite-math-only and -fno-signaling-nans.
This option causes the preprocessor macro "__FAST_MATH__" to
be
defined.
This option should never be turned on by any -O option since
it can
result in incorrect output for programs which depend on an
exact
implementation of IEEE or ISO rules/specifications for math
func-
tions.
This may cause some problems, but I haven't had any.
Michael Velikanje
On Apr 5, 2004, at 12:38 PM, Ton Roosendaal wrote:
> Hi,
>
> Confirmed; adding -ffast-math -mcpu=7450 -mtune=7450 to the
> nan_compile.mk for OSX gives about 25% gain for raytraced images. Not
> bad!
> Using O2 or O3 doesnt give noticible difference.
>
> Can anyone tell me what this exactly means for releasing binaries for
> other cpu's, like G3 or G5?
>
> -Ton-
>
> On Sunday, Apr 4, 2004, at 21:38 Europe/Amsterdam, Michael Velikanje
> wrote:
>
>> I posted that. On my system I get approx. a 20% increase in render
>> speed and 10% in the game engine. If that's not working for you try
>> opening gcc man pages and try some of the different optimization
>> options on your system. Thats how I found the combination that
>> speeded things up on my system, that and a lot of compiling and
>> testing, if you find a combination that works for you please post it
>> so others may try it.
>> Just because I'm curious what is the result of running 'machine' on
>> your system, how much ram, cpu mhz?? I've been trying the demo-files
>> on my system and have found that everything mostly work the same as
>> they did on 2.25, with reasonable speed, (however, reasonable is
>> subjective)
>>
>> Michael Velikanje
>>
>> On Apr 4, 2004, at 10:31 AM, car wrote:
>>
>>> At .org someone posted this adjustment to speed up scons builds
>>> Though I did not get it to work yet. Can somebody help ?
>>>
>>>
>>> Optimization on the scons build method is nonexsistant for darwin. I
>>> added
>>>
>>> extra_flags = ['-pipe', '-fPIC', '-funsigned-char', '-ffast-math',
>>> '-mcpu=7450', '-mtune=7450']
>>>
>>> , '-ffast-math', '-mcpu=7450', '-mtune=7450' are the additions.
>>>
>>> and
>>>
>>> release_flags = ['-O3']
>>>
>>> to the if sys.platform =='darwin' section and it speeded things up
>>> nicely.
>>>
>>> To find the correct machine type to add to -mcpu= and -mtune= use
>>> machine at the command line:
>>> Last login: Sun Mar 28 09:38:52 on ttyp4
>>> Welcome to Darwin!
>>> [PowerBookG4 10:17:43am michaelv ] ~% machine
>>> ppc7450 you'll get something like this.
>>> Or you can just use the generic -mcpu=powerpc assuming you have a
>>> powerpc
>>>
>>> For compiling the gameengine I added this to the SConscript file in
>>> solid:
>>>
>>> elif sys.platform=='linux2' or sys.platform=='linux-i386':
>>> defines += ['NDEBUG']
>>> cflags += ['-O2']
>>> elif sys.platform == 'darwin':
>>> cflags += ['-O3', '-ffast-math', '-mcpu=7450', '-mtune=7450']
>>> This adds the same optimizations to solid as the rest of the code.
>>
>> _______________________________________________
>> Bf-committers mailing list
>> Bf-committers@blender.org
>> http://www.blender.org/mailman/listinfo/bf-committers
>>
>>
> -----------------------------------------------------------------------
> ---
> Ton Roosendaal Blender Foundation ton@blender.org
> http://www.blender.org
>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers@blender.org
> http://www.blender.org/mailman/listinfo/bf-committers
>