https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31271
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.7.0
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #2)
>
> 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
x86_64 produces that in GCC 13 with r13-792-g29ae455901ac71 .
>
> Or for aarch64:
> mov w8, #224
> bics wzr, w8, w0
> cset w0, ne
> ret
For aarch64, it could define an instruction to catch:
(set (reg:CC_NZV 66 cc)
(compare:CC_NZV (and:SI (not:SI (reg:SI 100))
(const_int 224 [0xe0]))
(const_int 0 [0])))
Anyways the original issue was fixed in GCC 4.7.0 and the small improvement for
x86_64 is in GCC 13. The aarch64 code generation is currently:
and w0, w0, 224
cmp w0, 224
cset w0, ne
ret
Which is only slightly worse than what I proposed too.