Optimization question

Art Berggreen art@acc.com
Wed Aug 23 20:34:00 GMT 2000


I'm using an arm-elf cross compiler built from 2.95.2 for a device with
a StrongARM CPU core.  I've noticed that the compiler tries to avoid
multiply instructions by transforming a 32 bit multiply by a constant
into a sequence of adds and subtracts with shifts.  This is probably
desirable if the processor has a slow multiply instruction, but the
StrongARM core I'm using has a fast multiply (1 clock issue, 1-3 clock
result delay depending on early termination).  So I'd really prefer for
the compiler to use the multiply instruction.  A quick glance through
arm.c in the GCC sources indicate that when -mcpu=strongarm is used,
then a flag (arm_fast_multiply) gets set.  Should this cause the use of
the multiply instructions (or at least make them more favorable)?  Any
hints on how to get the compiler to cooperate?

Art Berggreen
Ericsson IPNA
art@acc.com

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com



More information about the crossgcc mailing list