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

2013-07-09 Thread Graham Stott
hi Richard, I've Updated patch and added testcases basically they are the same testcase just using different constants I tried combining  them into one testcase couldn'tget the scan-assembler stuff working when multiple functions were in the assembler output I couldn't couldn't work out

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

2013-07-09 Thread Richard Sandiford
Graham Stott graham.st...@btinternet.com writes:     gcc/ChangeLog     * config/mips/mips.c (): Very slightly increase code of MUL.whren optimizing for size. * config/mips/mips.c (mips_rtx_costs): Very slightly increase the cost of MULT when optimizing for size.   

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

2013-07-09 Thread Graham Stott
Richard, I'll renumber then consecutively and fix the typo and change log entry before I commit Thanks Graham - Original Message - From: Richard Sandiford rdsandif...@googlemail.com To: Graham Stott graham.st...@btinternet.com Cc: gcc-patches@gcc.gnu.org gcc-patches@gcc.gnu.org

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

2013-07-08 Thread Graham Stott
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

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

2013-07-03 Thread Graham Stott
Hi Richard,   When -Os is used  and the multiplier is of the for 2^N +- 1 we generate a MUL instruction rather that a  shift-left   N and add-sub 1.   The problem is that rtx cost for the MUL is too cheap causing the shift-left and add-sub sequence to be  more expensive.   This patch makes the

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

2013-07-03 Thread Richard Sandiford
Graham Stott graham.st...@btinternet.com writes: When -Os is used and the multiplier is of the for 2^N +- 1 we generate a MUL instruction rather that a shift-left N and add-sub 1. The problem is that rtx cost for the MUL is too cheap causing the shift-left and add-sub sequence to be more