This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] x86 peephole2s to optimize "1LL << x"
Richard Henderson <rth@redhat.com> writes:
>
> (4) If shifts are slow and cmove is enabled, implement 1LL << C with
>
> xorl %eax, %eax
> xorl %edx, %edx
> movl $1, %ebx
> sall %cl, %ebx
> testb $32, %cl
> cmove %ebx, %eax
> cmovne %ebx, %edx
iirc cmov is also quite slow on Pentium 4. So if the goal is to get
better P4 code it may be a good idea to avoid them.
-Andi