[Bug target/105991] [12 Regression] rldicl+sldi+add generated instead of rldimi

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jul 4 13:03:12 GMT 2022


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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Roger Sayle <sayle@gcc.gnu.org>:

https://gcc.gnu.org/g:6c175b3d170de2bb02b7bd45b3348eec05d28451

commit r12-8547-g6c175b3d170de2bb02b7bd45b3348eec05d28451
Author: Roger Sayle <roger@nextmovesoftware.com>
Date:   Mon Jul 4 13:58:37 2022 +0100

    PR target/105991: Recognize PLUS and XOR forms of rldimi in rs6000.md.

    This patch addresses PR target/105991 where a change to prefer representing
    shifts and adds at the tree-level as multiplications, causes problems for
    the rldimi patterns in the powerpc backend.  The issue is that rs6000.md
    models this pattern using IOR, and some variants that have the equivalent
    PLUS or XOR in the RTL fail to match some *rotl<mode>4_insert patterns.
    This is fixed in this patch by adding a define_insn_and_split to locally
    canonicalize the PLUS and XOR forms to the backend's preferred IOR form.

    Backported from master.

    2022-07-04  Roger Sayle  <roger@nextmovesoftware.com>
                Marek Polacek  <polacek@redhat.com>
                Segher Boessenkool  <segher@kernel.crashing.org>
                Kewen Lin  <linkw@linux.ibm.com>

    gcc/ChangeLog
            PR target/105991
            * config/rs6000/rs6000.md (rotl<mode>3_insert_3): Check that
            exact_log2 doesn't return -1 (or zero).
            (plus_xor): New code iterator.
            (*rotl<mode>3_insert_3_<code>): New define_insn_and_split.

    gcc/testsuite/ChangeLog
            PR target/105991
            * gcc.target/powerpc/pr105991.c: New test case.


More information about the Gcc-bugs mailing list