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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
      Known to work|4.7.1                       |

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
We produce in 4.7.0+

in_canforward(unsigned int):
.LFB0:
        .cfi_startproc
        andl    $224, %edi
        xorl    %eax, %eax
        cmpl    $224, %edi
        setne   %al
        ret


That is:
  D.2201_1 = in_2(D) & 224;
  D.2199_10 = D.2201_1 != 224;

I think we could do slightly better
((~in_2(D)) & 224) == 0

But only at exand time.
This gives:
        notl    %edi
        xorl    %eax, %eax
        testb   $-32, %dil
        setne   %al

Or for aarch64:
        mov     w8, #224
        bics    wzr, w8, w0
        cset    w0, ne
        ret

Reply via email to