https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87763

--- Comment #29 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Richard Earnshaw from comment #28)
> Yes, it's always possible to write patterns for this, but as you point out,
> we end up with many variants: insert in bottom (no left shift), insert in
> top (left shift then doesn't need an additional AND mask because there are
> no top bits to remove) and insert in middle.

It is some work, sure, but I'd say not that hard and now that we have various
code/mode iterators even needs less writing.
You can have a C function used as a predicate that can also give you the right
arguments for the bfi, and I'd expect it can optimize much more than what it
could handle in the past without generic combine.c/simplify-rtx.c changes.
The problem is that if those are changed, one needs to adjust all the targets
that have carefully written patterns for this that will now no longer match and
one will need to start from scratch on all of those.  So in the end, changing
that can be much more work for many backend maintainers.
I think it is better to use define_insn_and_split and split those into the
zero_extract patterns you have when reload_completed.  rs6000 shows it can be
done.

Reply via email to