https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95566
Hongtao.liu <crazylht at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |crazylht at gmail dot com
--- Comment #2 from Hongtao.liu <crazylht at gmail dot com> ---
(In reply to Andrew Pinski from comment #1)
> Reduced testcase:
> int f(unsigned short *a, unsigned long long d)
> {
> return *a == (d>>48);
> }
>
> ---- CUT ----
> of the compilers I have compared, only ICX can do this:
> shrq $48, %rsi
> xorl %eax, %eax
> cmpw %si, (%rdi)
> sete %al
> retq
Failed to match this instruction:
(set (reg:QI 93)
(eq:QI (lshiftrt:DI (reg:DI 95)
(const_int 48 [0x30]))
(zero_extend:DI (mem:HI (reg:DI 94) [1 *a_6(D)+0 S2 A16]))))
guess we can drop the zero_extend here, but still 3 instruction vs 3
instruction, just some codesize optimization.