On Tue, Mar 29, 2011 at 5:40 PM, Barry Song 21cnbao@gmail.com wrote:
2011/3/24 Michael Hope michael.hope@linaro.org:
Hi Barry. The short answer is 'it depends' :)
GCC is more than a compiler and includes other things such as a runtime library (libgcc) and hooks into the libc for features like thread local storage. These are built for the architecture and floating point unit options you pass to GCC's configure, so if you want one toolchain that runs everywhere then you need to configure it for the lowest common denominator (normally a ARMv5T in ARM mode with no FPU). A similar argument applies to GLIBC.
The next question is, does this matter for your application? What workload will your product run and will it be meaningfully affected by this lowest common denominator build? * If your application uses a lot of floating point, then the lack of FPU support in GLIBC matters
Completely right. I got a linaro 4.5 by:
sudo add-apt-repository ppa:linaro-maintainers/toolchain sudo apt-get update sudo apt-get install gcc-4.5-arm-linux-gnueabi
Then I did WHETSTONE benchmark on a low-frequency cortex A9 FPGA with vfpv3.
Result showed linaro by apt-get is using generic glibc in fact. its gave only 3.3 WHETSTONE MIPS. Then i compiled a glibc with vfpv3 support to replace the glibc by apt-get, the new toolchain gave 16.7 WHETSTONE MIPS, 400% improvement in WHETSTONE.
Whetstone is a floating point benchmark, so I'd expect this type of improvement.
* If your product has limited memory, then the smaller code size of Thumb-2 is worthwhile * If you need to squeeze out another 5 % in performance, then using ARMv7 instead of ARMv5 will help
Completely right. I did a edn benchmark from http://www.mrtc.mdh.se/projects/wcet/wcet_bench/edn/edn.c. EDN can show memory and fixed-point performance. My testing result shows edn has a 5-10% performance improvement by linaro 4.5 with armv7_a option.
Nice :) This matches what I've seen.
Then my conclusion is that the best choice for cortex A9 with vfpv3 is
- using linaro gcc 4.4/4.5 with ARMV7 optimization
- using glibc compiled with vfpv3 supporting
A strange phenomenon i found was nbench would enter dead loop in ASSIGNMENT case. It could finish ASSIGNMENT case forever. nbench can be downloaded from http://www.tux.org/~mayer/linux/nbench-byte-2.2.3.tar.gz. I haven't time to figure out whether it is a linaro gcc bug. Then i just ignore this case by writing NBENCH.CONF like the following: CUSTOMRUN=T DONUMSORT=T DOLU=T DOSTRINGSORT=T DOBITFIELD=T DOEMF=T DOFOUR=T DOASSIGN=F ASSIGNMINSECONDS=1 DOHUFF=T DOIDEA=T
If you have time, may you help to check the reason?
I couldn't reproduce this, sorry. I built nbench using gcc-linaro-4.5-2011.03-0 using both -O3 -mtune=cortex-a9 -mfpu=vfpv3-d16 and -O3 -mtune=cortex-a9 -mfpu=neon and in both cases ASSIGNMENT completes.
-- Michael