Re: mcpu options for AMCC440 with fpu

2 messages, 2 authors, 2007-02-24 · open the first message on its own page

Re: mcpu options for AMCC440 with fpu

From: Wolfgang Denk <hidden>
Date: 2007-02-23 22:58:21

In message [off-list ref] you wrote:
   I was searching for the best mcpu option for amcc440, compiling and running a small program you can find here: 
http://magnux.free.fr/gcc/mandelbrot.c. My distro is a ppc fedora core 6, and results are obviously the same using DENX4.0.
In general, you should need to meddle much with such options; the ELDK
default settings are usually OK.
--------------------
-bash-3.00# gcc -O2 ./mandelbrot.c -o ./mandelbrot && time ./mandelbrot && rm -f ./mandelbrot

real    1m15.059s
user    1m14.996s
sys     0m0.060s
-bash-3.00# gcc -O2 -mcpu=440 ./mandelbrot.c -o ./mandelbrot && time ./mandelbrot && rm -f ./mandelbrot

real    0m39.606s
user    0m39.552s
sys     0m0.028s
-bash-3.00# gcc -O2 -mcpu=440fp ./mandelbrot.c -o ./mandelbrot && time ./mandelbrot && rm -f ./mandelbrot

real    1m15.016s
user    1m14.988s
sys     0m0.024s
-bash-3.00# gcc -O2 -msoft-float ./mandelbrot.c -o ./mandelbrot && time ./mandelbrot && rm -f ./mandelbrot

real    0m39.577s
user    0m39.544s
sys     0m0.032s
This looks to me as if you have been runing all these  tests  in  the
SAME  environment,  probably  the /opt/eldk/ppc_4xx root file system,
which is soft-float based. You must not do this.

For tests with FP instructions, you MUST use the  /opt/eldk/ppc_4xxFP
root  file  system.  For  tests  with  soft-float,  you  MUST use the
/opt/eldk/ppc_4xx root file system.

You CANNOT link  an  application  build  with  one  settings  against
libraries using other settings, or you will run into trouble. You
would probably have seen the problems if you had used any test where
the results of the calculations would have been visible.

* I do not explain why not using FPU gives better results ?
Because you did not run the tests you thought yoiu were running.
* mcpu option seems to not have any effect ?
Use "gcc -v" to see exactly which options get passed to the  compiler
stages.
*  My third test was to compile and run mplayer.
- With default options (no mcpu specified), my test mpeg was smooth.
- With mcpu=440fp, my test mpeg was not smooth.

 Can anybody bring me some lights about the right gcc mcpu option for amcc440 ?
Just use the  defaults, unless you know exactly what you are doing.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk
Office:  Kirchenstr. 5,       D-82194 Groebenzell,            Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
If there was anything that depressed him more than his own  cynicism,
it was that quite often it still wasn't as cynical as real life.
                                 - Terry Pratchett, _Guards! Guards!_

Re: mcpu options for AMCC440 with fpu

From: Patrice Bouchand <hidden>
Date: 2007-02-24 07:03:40

 
Indeed ! I was waiting for warnings or errors while compiling to tell me
I was doing something wrong but I should not.

 Thanks for your time.

   Patrice

In message [off-list ref] you wrote:
quoted
   I was searching for the best mcpu option for amcc440, compiling and running a small program you can find here: 
http://magnux.free.fr/gcc/mandelbrot.c. My distro is a ppc fedora core 6, and results are obviously the same using DENX4.0.
In general, you should need to meddle much with such options; the ELDK
default settings are usually OK.
quoted
--------------------
-bash-3.00# gcc -O2 ./mandelbrot.c -o ./mandelbrot && time ./mandelbrot && rm -f ./mandelbrot

real    1m15.059s
user    1m14.996s
sys     0m0.060s
-bash-3.00# gcc -O2 -mcpu=440 ./mandelbrot.c -o ./mandelbrot && time ./mandelbrot && rm -f ./mandelbrot

real    0m39.606s
user    0m39.552s
sys     0m0.028s
-bash-3.00# gcc -O2 -mcpu=440fp ./mandelbrot.c -o ./mandelbrot && time ./mandelbrot && rm -f ./mandelbrot

real    1m15.016s
user    1m14.988s
sys     0m0.024s
-bash-3.00# gcc -O2 -msoft-float ./mandelbrot.c -o ./mandelbrot && time ./mandelbrot && rm -f ./mandelbrot

real    0m39.577s
user    0m39.544s
sys     0m0.032s
This looks to me as if you have been runing all these  tests  in  the
SAME  environment,  probably  the /opt/eldk/ppc_4xx root file system,
which is soft-float based. You must not do this.

For tests with FP instructions, you MUST use the  /opt/eldk/ppc_4xxFP
root  file  system.  For  tests  with  soft-float,  you  MUST use the
/opt/eldk/ppc_4xx root file system.

You CANNOT link  an  application  build  with  one  settings  against
libraries using other settings, or you will run into trouble. You
would probably have seen the problems if you had used any test where
the results of the calculations would have been visible.

quoted
* I do not explain why not using FPU gives better results ?
Because you did not run the tests you thought yoiu were running.
quoted
* mcpu option seems to not have any effect ?
Use "gcc -v" to see exactly which options get passed to the  compiler
stages.
quoted
*  My third test was to compile and run mplayer.
- With default options (no mcpu specified), my test mpeg was smooth.
- With mcpu=440fp, my test mpeg was not smooth.

 Can anybody bring me some lights about the right gcc mcpu option for amcc440 ?
Just use the  defaults, unless you know exactly what you are doing.

Best regards,

Wolfgang Denk
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help