This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH: PR target/40697] Use shifts to extract most or least significant bits
Steven Bosscher <stevenb.gcc@gmail.com> writes:
> On Tue, Jul 14, 2009 at 9:36 AM, Carrot Wei<carrot@google.com> wrote:
>> ? ? ? ?PR target/40416
>> ? ? ? ?* config/arm/arm.c (all_ones_in_most_significant_bits): New function.
>> ? ? ? ?(all_ones_in_least_significant_bits): New function.
>> ? ? ? ?* config/arm/arm-protos.h (all_ones_in_most_significant_bits):
>> ? ? ? ? ? ? ? ?Declare it.
>> ? ? ? ? ? ? ? ?(all_ones_in_least_significant_bits): Declare it.
>> ? ? ? ?* config/arm/arm.md: Add peephole2 rules to do the optimization.
>
> I still don't see why this can't be done in the middle-end instead of
> as a peephole...
Why can't this be handled in the ARM "and" expander; also accept
bitmasks in the const operand and emit the two shifts instead?
This is at least how I am planning to handle emitting bit-extraction for
AND in MIPS if the constant is too big but a bitmask.
Adam