Skip to content

Commit

Permalink
use intrinsics function.
Browse files Browse the repository at this point in the history
  • Loading branch information
aikiriao committed Jun 21, 2024
1 parent e7c748e commit e6f1888
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/srla_internal/include/srla_utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
/* ビルトイン関数を使用 */
#define SRLAUTILITY_NLZ(x) (((x) > 0) ? (uint32_t)__builtin_clz(x) : 32U)
#elif defined(_MSC_VER)
#include <intrin.h>
/* ビルトイン関数を使用 */
__inline uint32_t SRLAUTILITY_NLZ(uint32_t x)
{
unsigned long result;
return (_BitScanReverse(&result, x) != 0) ? (31U - result) : 32U;
return __lzcnt(x);
}
#else
/* ソフトウェア実装を使用 */
Expand Down

0 comments on commit e6f1888

Please sign in to comment.