Adding `-mcpu=haswell` to the LDC command-line, the generated asm is: addl $-1, %edi lzcntl %edi, %eax xorb $31, %al movl $2, %ecx shlxl %eax, %ecx, %eax [Add `-mcpu=native` to tune code-gen for *your* CPU.]