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]

Re: SH: remove -mbigtable option (PR c/4516)


> 2001-10-11  NIIBE Yutaka  <gniibe@m17n.org>
> 
> 	* doc/invoke.texi (Option Summary: SH Options): Remove -mbigtable.
> 
> 	* config/sh/sh.md (*casesi_worker): Handle 0..65535.
> 
> 	* config/sh/sh.h (BIGTABLE_BIT, TARGET_BIGTABLE): Removed.
> 	(TARGET_SWITCHES): Remove -mbigtable option.
> 	(CASE_VECTOR_MODE): Always SImode.
> 	(ASM_OUTPUT_ADDR_VEC_ELT): Always emit .long.
> 	(CASE_VECTOR_SHORTEN_MODE): Handle 0..65535.

This changes quite a bit more than the -O0 default.  And in two places,
you can cause slower programs to be generated.

- The initial setting of CASE_VECTOR_MODE can cause a switch table to
  be stuck in SImode because it's size causes branches to get out of medium
  range, and these, plus the table size, cause some offset in the table to
  get out of range for HImode.
  When optimizing, it is safe, and better, to start with a smaller mode.
  I suggest you use QImode when optimizing.

- A 32 bit load is faster than a 16 load followed by a zero extension,
  therefore the 16 bit unsigned variant should only be generated with -Os.
  Or if there is a good reason why you sometimes need this even for -O2,
  this should be controlled by a separate switch.

Finally, the 16 bit unsigned variant of casesi_worker has an actual length
of 6.  This has to be reflected in the length attribute.  You can use
(ne (symbol_ref "some_expression (insn)") (const_int 0)) as a condition
for a cond or if_then_else for your length attribute.


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