Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's unsurprising, since without -march, gcc will emit code for a generic cpu that doesn't have a popcnt instruction. Early x86_64 cpus didn't have popcnt, so neither will the code that gcc emits & it's the same for any other architecture.

If you want to use instructions that are only available on or after a specific cpu generation, then you need to tell your compiler to target that cpu's instruction set.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: