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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |ubizjak at gmail dot com

--- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> ---
Created attachment 48386
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48386&action=edit
Proof of concept patch

Proof of concept patch that implements both suggestions and results in:

        negl    %edi
        sbbl    %eax, %eax
        ret

for the first case and:

        cmpl    $1, %edi
        sbbl    %eax, %eax
        ret

for the second.

For the record, the transformation triggers:

- for linux x86_64 defconfig: 338 times neg/sbb and 28 times cmp/sbb

- for GCC bootstrap: 296 times neg/sbb and 1246 times cmp/sbb

Reply via email to