Hacker News new | ask | show | jobs
by Aardwolf 534 days ago
> that doesn't need lzcnt

Is it a big advantage to not need it, or can we safely assume CPU's have fast instructions for this today?

1 comments

Sometimes you have a scalar instruction but not a vectorized one, or it doesn't match the 'lanes' you want to operate (ISTR weird holes in AVX where I could find a specific instruction for 8, 32, 64-bits lanes but not for 16). Always good to have an escape hatch there, especially a highly pipelined (or pipeline-able) one.