native 0.0.1
Vectors, masks and wide register packs for C++26
Loading...
Searching...
No Matches
LZCNT
Collaboration diagram for LZCNT:

Functions

template<isa< x86 > Arch = NATIVE_BASELINE>
requires (Arch.has(x86_feature::lzcnt))
constexpr std::uint16_t native::lzcnt (std::uint16_t value) noexcept
template<isa< x86 > Arch = NATIVE_BASELINE>
requires (Arch.has(x86_feature::lzcnt))
constexpr std::uint32_t native::lzcnt (std::uint32_t value) noexcept
template<isa< x86 > Arch = NATIVE_BASELINE>
requires (Arch.has(x86_feature::lzcnt))
constexpr std::uint64_t native::lzcnt (std::uint64_t value) noexcept

Detailed Description

Scalar bit counts requiring only extended CPUID leaf 0x80000001 ECX bit 5. Runtime calls require x86_feature::lzcnt in the supplied ISA. Admit that feature before entering a matching target scope. No vector OS state is required. Constant evaluation supports every x86 Arch; weak tags select consteval overloads.

Function Documentation

◆ lzcnt() [1/3]

template<isa< x86 > Arch = NATIVE_BASELINE>
requires (Arch.has(x86_feature::lzcnt))
std::uint16_t native::lzcnt ( std::uint16_t value)
inlineconstexprexportnoexcept

Count leading zero bits of a 16-bit value; zero returns 16. Arch must contain LZCNT; runtime callers must enable and admit that feature.

Definition at line 24 of file lzcnt.h.

Here is the caller graph for this function:

◆ lzcnt() [2/3]

template<isa< x86 > Arch = NATIVE_BASELINE>
requires (Arch.has(x86_feature::lzcnt))
std::uint32_t native::lzcnt ( std::uint32_t value)
inlineconstexprexportnoexcept

Count leading zero bits of a 32-bit value; zero returns 32. Arch must contain LZCNT; runtime callers must enable and admit that feature.

Definition at line 36 of file lzcnt.h.

◆ lzcnt() [3/3]

template<isa< x86 > Arch = NATIVE_BASELINE>
requires (Arch.has(x86_feature::lzcnt))
std::uint64_t native::lzcnt ( std::uint64_t value)
inlineconstexprexportnoexcept

Count leading zero bits of a 64-bit value; zero returns 64. Arch must contain LZCNT; runtime callers must enable and admit that feature.

Definition at line 48 of file lzcnt.h.