On Fri, 2007-04-20 at 10:24 +0200, Victor Librado wrote: > Hello all, > I`m working with an arm core 9260EJ-S under Linux (Linux kernel 2.6.15; > armv5l-linux toolchain with compiler gnu gcc 3.4.2). I would like to > take advantage of the asm DSP like functions the core provides. I > compile this way: > > arm-linux-gnu -msoft-float -mtune=arm926ejs -S mul.c > > Code generated uses these assembly dsp instructions sometimes (I think > critical parts should be assembly written), but it exists any kind of > patch or derivative to "tell" gcc to improve the code generated using > these kind of 1 cycle instructions more offently? >
You should really be asking this sort of question on gcc-help... As Eric has already pointed out, -mtune does not affect the set of available instructions that the compiler can choose from, it just adjusts the preference tables that are used for making a choice. To change the available instructions for the arm926ej-s you need to use -march=armv5tej. However, the flag -mcpu=arm926ejs-s is short-hand for setting both the -mtune and the -march flags appropriately: in your case, I think you should use that. Given the above, will GCC emit any of the DSP instructions available on that core? Answer: not many. It does occasionally use the additional multiply instructions, but the saturating operations do not map onto normal C constructs and so aren't used. There's a current development project for the compiler to add support for fixed-point arithmetic (http://gcc.gnu.org/wiki/FixedPointArithmetic). Once that project is integrated, gcc could be adapted to use the 926's dsp instructions in some cases. R.