ARM gcc's soft-float softvfp patch I modified N. Pitre's soft-float gcc patch to work more like the official gcc in a sense of what processors' the code will be generated, but it still defaults to softvfp soft-float. This gives a 10x speedup in floating point code and 1.2x speedup in integer code (by default gcc "uses" non existent coprocessor's registers). I propose the use of nofpu USE flag (like mmx/sse/.. on x86) for gcc and uclibc to be added, and in case they are set, the patches to be applied. Also, it is worth noting that code generated with this soft-float patch runs very well on softgun (an ARM emulator), which may be very useful for Gentoo/ARM development. And all the attached benchmarks were made on a Sharp Zaurus SL-5500, form a fresh boot to openzaurus 3.3.5 with a 64-0 kernel. Yuri. Reproducible: Always Steps to Reproduce:
Created attachment 46814 [details, diff] gcc-3.3.4-3.3.5-softvfp.patch
Created attachment 46815 [details, diff] uclibc-softvfp-gentoo.patch
Created attachment 46816 [details, diff] uclibc-0.9.26-r7.ebuild.patch Patch for latest arm and ~arm ebuild.
Created attachment 46817 [details, diff] gcc-3.3.4-r1.ebuild.patch Patch for latest arm ebuild.
Created attachment 46818 [details, diff] gcc-3.3.5-r1.ebuild.patch Patch for latest ~arm ebuild.
Created attachment 46820 [details] nbench.nwfpemu.Os.out Kernel's floating point emulation CFLAGS="-Os -pipe -static"
Created attachment 46821 [details] nbench.nwfpemu.O3.out Kernel's floating point emulation CFLAGS="-O3 -pipe -static"
Created attachment 46822 [details] nbench.softvfp.Os.out softvfp floating point emulation CFLAGS="-Os -pipe -static"
Created attachment 46823 [details] nbench.softvfp.O3.out softvfp floating point emulation CFLAGS="-O3 -pipe -static"
Created attachment 46824 [details] nbench.libfloat.Os.out uClibc libfloat's floating point emulation CFLAGS="-Os -pipe -static"
Created attachment 46825 [details] nbench.libfloat.O3.out uClibc libfloat's floating point emulation CFLAGS="-O3 -pipe -static"
Created attachment 62359 [details, diff] gcc-3.4.4.ebuild.patch
Created attachment 62360 [details, diff] gcc-3.4.4-softvfp.patch
Created attachment 62680 [details, diff] softvfp-profile.patch Portage profile for softvfp arm systems.
stages can be found at: http://yvasilev.main.hsphere.com/zentoo/stages/ Yuri.
After modified some lines, Patch seems to work well. But gcc stage2 (of crossdev) compile failes if have cxx support. Are there any patches for compile cxx support on toolchains ?
I have found that this patches need EXTRA_ECONF="--with-float=soft" when use crossdev stage 1 (and others) that build gcc from http://www.mail-archive.com/gentoo-embedded@lists.gentoo.org/msg00048.html
Comment on attachment 46815 [details, diff] uclibc-softvfp-gentoo.patch merged upstream uClibc svn and in portage
Comment on attachment 62680 [details, diff] softvfp-profile.patch no need for this if we're going to use CHOST encoding ...
ive committed the softfloat configure check to toolchain.eclass ... only thing left is the softvfp patch ... the only problem is the hunk against gcc/config/arm/t-linux ... is that needed ? reviewing the gcc mailing lists, that hunk seems like a bad idea ...
This my modified by hand I think it needed to prevents linking with libfloat. diff -Naur gcc-3.4.4-orig/gcc/config/arm/t-linux gcc-3.4.4/gcc/config/arm/t-linux --- gcc-3.4.4-orig/gcc/config/arm/t-linux 2003-09-20 15:09:07 -0600 +++ gcc-3.4.4/gcc/config/arm/t-linux 2005-06-28 13:09:46 -0600 @@ -4,7 +4,10 @@ LIBGCC2_DEBUG_CFLAGS = -g0 LIB1ASMSRC = arm/lib1funcs.asm -LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx +LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \ + _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \ + _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \ + _fixsfsi _fixunssfsi # MULTILIB_OPTIONS = mhard-float/msoft-float # MULTILIB_DIRNAMES = hard-float soft-float diff -Naur gcc-3.4.4-orig/gcc/config/arm/unknown-elf.h gcc-3.4.4/gcc/config/arm/unknown-elf.h --- gcc-3.4.4-orig/gcc/config/arm/unknown-elf.h 2004-02-24 07:25:22 -0700 +++ gcc-3.4.4/gcc/config/arm/unknown-elf.h 2005-06-28 13:13:09 -0600 @@ -30,7 +30,12 @@ /* Default to using APCS-32 and software floating point. */ #ifndef TARGET_DEFAULT -#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS) +#define TARGET_DEFAULT \ + ( ARM_FLAG_SOFT_FLOAT \ + | ARM_FLAG_VFP \ + | ARM_FLAG_APCS_32 \ + | ARM_FLAG_APCS_FRAME \ + | ARM_FLAG_MMU_TRAPS ) #endif
(In reply to comment #20) > the only problem is the hunk against gcc/config/arm/t-linux ... is that needed ? > reviewing the gcc mailing lists, that hunk seems like a bad idea ... As far as I understand this, the patch to t-linux is harmful in case we are doing a mix of hard and soft float (use soft-float routines only to complete the functionality of an incomplete floating point coprocessor). As in this case softvfp may not be compatible with the hard fp coprocessor that will do some fp operations. But in this case as we are doing a softfloat system, t-linux needs to (Comment #21) and it is safe to be patched. As the hard-float and ``mix
(In reply to comment #20) > the only problem is the hunk against gcc/config/arm/t-linux ... is that needed ? > reviewing the gcc mailing lists, that hunk seems like a bad idea ... As far as I understand this, the patch to t-linux is harmful in case we are doing a mix of hard and soft float (use soft-float routines only to complete the functionality of an incomplete floating point coprocessor). As in this case softvfp may not be compatible with the hard fp coprocessor that will do some fp operations. But in this case as we are doing a softfloat system, t-linux needs to (Comment #21) and it is safe to be patched. As the hard-float and ``mix´´-float cases are covered by the default toolchain.
ok, everything is merged now in portage if you could rebuild the arm softfloat stages with CHOST=arm-softfloat-linux-uclibc we can probably move on to the next stage of getting them onto our mirrors for wider testing :) i'll try to get armeb-softfloat-linux-uclibc going on my slug ...
CHOST=arm-softfloat-linux-uclibc stages are available at http://yvasilev.main.hsphere.com/zentoo/stages/