This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Remove CASE_USE_BIT_TESTS target macro
- From: Georg-Johann Lay <gjl at gcc dot gnu dot org>
- To: Steven Bosscher <stevenb dot gcc at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 30 Jun 2012 10:58:39 +0200
- Subject: Re: [patch] Remove CASE_USE_BIT_TESTS target macro
- References: <CABu31nNHZKdm98XCwT8ULBgyaE0s7WsPCuqt3ueZpm5AGJaE4w@mail.gmail.com>
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.