This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MIPS don't gererate MUL when muliplying by constant of for 2^N +/- 1 optimizing for size


Hi Richard,

The problem was with adjusting to be more expansive the load imm + mul sequence and
the shift + add sequence were the smake cost when optimizing for size so the code in expmed.c
choose the MUL.

I also considered this  version  also I couldn't decide which was better just went with the other
version on a toss of a coin.

I submit again with mips target testcase which use scan assember technique to check that
we use the shift+add/sub sequence.

A simple testcase compiled with -Os

int foo(int x)
{
  return x * 17;
}

will demonstrate that we currently use "LI + MUL" and after the patch we will use "SLL + ADDU".

Gtraham


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]