Closed
Description
static bool Test(int x) => (x & 1) == 0;
Just a good first issue for anyone interested in contributing to CLR JIT.
Current codegen:
test cl, 1
sete al
movzx rax, al
ret
Expected codegen:
mov eax, ecx
and eax, 1
ret
I noticed it when I was trying to implement a faster IsNegative for floats:
static bool IsNegative(double x) =>
(Sse2.MoveMask(Vector128.CreateScalarUnsafe(x)) & 1) != 0;