[patch, mips] Size savings for MIPS16 switch statements

Maciej W. Rozycki macro@codesourcery.com
Tue Jul 30 11:41:00 GMT 2013


On Tue, 23 Jul 2013, Steve Ellcey  wrote:

> While doing some space optimization work with mips16 I found that using a
> larger case threshold value could shrink the code.  I did testing on some
> libraries like libpng and libjpeg as well as some test cases I wrote and
> came up with 10 as the best value for space savings in mips16 mode.  I did
> some testing of mips32 code as well and found that this change did not
> help with that code so I restricted the change to mips16 only.
> 
> Tested on mips-mti-elf target, OK for checkin?
> 
> 2013-07-23  Steve Ellcey  <sellcey@mips.com>
> 
> 	* config/mips/mips.c (mips_case_values_threshold): New.
> 	(TARGET_CASE_VALUES_THRESHOLD): Define.

 This change has caused regressions I believe, with the mips-linux-gnu 
target and the MIPS32/o32 multilib:

FAIL: gcc.target/mips/code-readable-1.c  -Os   scan-assembler \tla\t
FAIL: gcc.target/mips/code-readable-1.c  -Os   scan-assembler \t\\.half\t
FAIL: gcc.target/mips/code-readable-2.c  -Os   scan-assembler \t\\.word\t[^\n]*L
FAIL: gcc.target/mips/code-readable-3.c  -Os   scan-assembler %hi\\([^)]*L
FAIL: gcc.target/mips/code-readable-3.c  -Os   scan-assembler %lo\\([^)]*L
FAIL: gcc.target/mips/code-readable-4.c  -Os   scan-assembler \t\\.half\t
FAIL: gcc.target/mips/code-readable-4.c  -Os   scan-assembler \tla\t

-- it may be that the tests have to be disabled at -Os just like e.g. 
code-readable-1.c already is at -O0.

  Maciej



More information about the Gcc-patches mailing list