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

normally there is an instruction for this called blend (since SSE4.1).

There shouldn't be a need to do any bitwise magic.



You can get gcc to generate the blend instruction in the example given - you just have to 'force' it to use SIMD more aggressively by, for example, using -march=native.


That's not forcing anything, if you're not getting blend you're just targeting an old ISA without that instruction.

It's up to you to choose your target adequately based on your deployment requirements.




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

Search: