[patch] Remove CASE_USE_BIT_TESTS target macro

Georg-Johann Lay gjl@gcc.gnu.org
Sat Jun 30 14:58:00 GMT 2012


Steven Bosscher schrieb:
> Hello,
> 
> This patch removes the CASE_USE_BIT_TESTS target macro. The default
> value of the macro is defined in stmt.c, where the only user of the
> macro is also. No target re-defines the macro.
> 
> (I wonder if the test is necessary at all. AFAICT all targets support
> shifts in word_mode. The macro was originally written to test for
> ashlsi3, which is _not_ supported on all targets -- but word_mode
> shifts are. Oh well, another day perhaps...)

Even if a target supports ward_mode shifts with variable offsets
it might be the case that it's not appropriate to use it in switch/case
expansion because it is too expensive.

For example, avr supports word_mode shifts but because there is no
barrel shifter, a loop has to be used. Likewise for "odd" shift
offsets with const_int offsets.

Johann

> Bootstrapped and tested on powerpc64-unknown-linux-gnu. OK for trunk?
> 
> Ciao!
> Steven
> 
> 
> 	* stmt.c (CASE_USE_BIT_TESTS): Fold away into its only user ...
> 	(expand_switch_using_bit_tests_p): ...here.
> 	* doc/tm.texi.in (CASE_USE_BIT_TESTS): Remove documentation.
> 	* doc/tm.texi (CASE_USE_BIT_TESTS): Regenerate.



More information about the Gcc-patches mailing list