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

--- Comment #3 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:8ea03e9016cbca5a7ee2b4befa4d5c32467b0982

commit r11-37-g8ea03e9016cbca5a7ee2b4befa4d5c32467b0982
Author: Uros Bizjak <ubiz...@gmail.com>
Date:   Mon May 4 13:49:14 2020 +0200

    i386: Use SHR to compare with large power-of-two constants [PR94650]

    Convert unsigned compares where

            m >= LARGE_POWER_OF_TWO

    and LARGE_POWER_OF_TWO represent an immediate where bit 33+ is set to use
    a SHR instruction and compare the result to 0.  This avoids loading a
    large immediate with MOVABS insn.

            movabsq $1099511627775, %rax
            cmpq    %rax, %rdi
            ja      .L5

    gets converted to:

            shrq    $40, %rdi
            jne     .L5

            PR target/94650
            * config/i386/predicates.md (shr_comparison_operator): New
predicate.
            * config/i386/i386.md (compare->shr splitter): New splitters.

    testsuite/ChangeLog:

            PR target/94650
            * gcc.targeti/i386/pr94650.c: New test.

Reply via email to