How to use MSVC intrinsics to get the equivalent of this GCC code?

后端 未结 5 1141
甜味超标
甜味超标 2020-11-29 06:46

The following code calls the builtin functions for clz/ctz in GCC and, on other systems, has C versions. Obviously, the C versions are a bit suboptimal if the system has a

5条回答
  •  一生所求
    2020-11-29 07:21

    I find it in a korean website https://torbjorn.tistory.com/317 In msvc compiler, you can use __lzcnt(unsigned int) to replace __builtin_clz(unsigned int) in gcc compiler.

提交回复
热议问题