News for hackers. Stuff that matters.
Re:Low Level Bit Hacks You Absolutely Must Know by vardump on Friday May 11, 2018 @02:08PM (#17049546)
Apparently not true, at least in a simple function.

https://godbolt.org/g/hfpHz7

  int isEven(int number)
  {
      return number & 1;
  }
gcc 7.3, -O1, -O2 and -O3 (identical codegen for all optimization levels):

  isEven(int):
    mov eax, edi
    and eax, 1
    ret
Re:Low Level Bit Hacks You Absolutely Must Know by Hello71 on Friday May 11, 2018 @06:31PM (#17051194)
that function checks if a number is odd, not even.

https://godbolt.org/g/7Khcg9

Re:Low Level Bit Hacks You Absolutely Must Know by vardump on Friday May 11, 2018 @07:31PM (#17051454)
My bad. Didn't even check it at any point.

Anyways, you still prove my point. All those three are pretty close.

-O1 sete instruction is very slightly unoptimal, but even it is just a fractional clock cycle.