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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Uros Bizjak <u...@gcc.gnu.org>:

https://gcc.gnu.org/g:00b8a212ea2132fb68e42488317392346e169035

commit r13-5969-g00b8a212ea2132fb68e42488317392346e169035
Author: Uros Bizjak <ubiz...@gmail.com>
Date:   Mon Feb 13 17:17:46 2023 +0100

    i386: Relax extract location operand mode requirements [PR108516]

    Combine pass simplifies zero-extend of a zero-extract to:

    Trying 16 -> 6:
       16: r86:QI#0=zero_extract(r87:HI,0x8,0x8)
          REG_DEAD r87:HI
        6: r84:SI=zero_extend(r86:QI)
          REG_DEAD r86:QI
    Failed to match this instruction:
    (set (reg:SI 84 [ s.e2 ])
        (zero_extract:SI (reg:HI 87)
            (const_int 8 [0x8])
            (const_int 8 [0x8])))

    which fails instruction recognision.  The pattern is valid, since there
    is no requirement on the mode of the location operand.

    The patch relaxes location operand mode requirements of *extzv and *extv
    insn patterns to allow all supported integer modes.  The patch also
    adds support for a related sign-extend from zero-extracted operand.

    2023-02-13  Uroš Bizjak  <ubiz...@gmail.com>

    gcc/ChangeLog:

            PR target/108516
            * config/i386/predicates.md (extr_register_operand):
            New special predicate.
            * config/i386/i386.md (*extv<mode>): Use extr_register_operand
            as operand 1 predicate.
            (*exzv<mode>): Ditto.
            (*extendqi<SWI24:mode>_ext_1): New insn pattern.

    gcc/testsuite/ChangeLog:

            PR target/108516
            * gcc.target/i386/pr108516-1.c: New test.
            * gcc.target/i386/pr108516-2.c: Ditto.

Reply via email to