3#include "native/isa_import.h"
4#include "native/x86/bmi2.h"
5#include "native/targets.h"
10extern "C++" namespace native {
11 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(Arch.has(x86_feature::bmi2))
12 constexpr std::uint32_t
bzhi(std::uint32_t value,
unsigned index)
noexcept;
14 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(!Arch.has(x86_feature::bmi2))
15 consteval std::uint32_t
bzhi(std::uint32_t value,
unsigned index)
noexcept;
17 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(Arch.has(x86_feature::bmi2))
18 constexpr std::uint64_t
bzhi(std::uint64_t value,
unsigned index)
noexcept;
20 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(!Arch.has(x86_feature::bmi2))
21 consteval std::uint64_t
bzhi(std::uint64_t value,
unsigned index)
noexcept;
23 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(Arch.has(x86_feature::bmi2))
24 constexpr std::uint32_t
mulx(std::uint32_t a, std::uint32_t b, std::uint32_t* high)
noexcept;
26 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(!Arch.has(x86_feature::bmi2))
27 consteval std::uint32_t
mulx(std::uint32_t a, std::uint32_t b, std::uint32_t* high)
noexcept;
29 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(Arch.has(x86_feature::bmi2))
30 constexpr std::uint64_t
mulx(std::uint64_t a, std::uint64_t b, std::uint64_t* high)
noexcept;
32 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(!Arch.has(x86_feature::bmi2))
33 consteval std::uint64_t
mulx(std::uint64_t a, std::uint64_t b, std::uint64_t* high)
noexcept;
35 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(Arch.has(x86_feature::bmi2))
36 constexpr std::uint32_t
pdep(std::uint32_t value, std::uint32_t
mask)
noexcept;
38 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(!Arch.has(x86_feature::bmi2))
39 consteval std::uint32_t
pdep(std::uint32_t value, std::uint32_t
mask)
noexcept;
41 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(Arch.has(x86_feature::bmi2))
42 constexpr std::uint64_t
pdep(std::uint64_t value, std::uint64_t
mask)
noexcept;
44 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(!Arch.has(x86_feature::bmi2))
45 consteval std::uint64_t
pdep(std::uint64_t value, std::uint64_t
mask)
noexcept;
47 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(Arch.has(x86_feature::bmi2))
48 constexpr std::uint32_t
pext(std::uint32_t value, std::uint32_t
mask)
noexcept;
50 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(!Arch.has(x86_feature::bmi2))
51 consteval std::uint32_t
pext(std::uint32_t value, std::uint32_t
mask)
noexcept;
53 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(Arch.has(x86_feature::bmi2))
54 constexpr std::uint64_t
pext(std::uint64_t value, std::uint64_t
mask)
noexcept;
56 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(!Arch.has(x86_feature::bmi2))
57 consteval std::uint64_t
pext(std::uint64_t value, std::uint64_t
mask)
noexcept;
59 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(Arch.has(x86_feature::bmi2))
60 constexpr std::uint32_t
shlx(std::uint32_t value,
unsigned count)
noexcept;
62 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(!Arch.has(x86_feature::bmi2))
63 consteval std::uint32_t
shlx(std::uint32_t value,
unsigned count)
noexcept;
65 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(Arch.has(x86_feature::bmi2))
66 constexpr std::uint64_t
shlx(std::uint64_t value,
unsigned count)
noexcept;
68 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(!Arch.has(x86_feature::bmi2))
69 consteval std::uint64_t
shlx(std::uint64_t value,
unsigned count)
noexcept;
71 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(Arch.has(x86_feature::bmi2))
72 constexpr std::uint32_t
shrx(std::uint32_t value,
unsigned count)
noexcept;
74 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(!Arch.has(x86_feature::bmi2))
75 consteval std::uint32_t
shrx(std::uint32_t value,
unsigned count)
noexcept;
77 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(Arch.has(x86_feature::bmi2))
78 constexpr std::uint64_t
shrx(std::uint64_t value,
unsigned count)
noexcept;
80 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(!Arch.has(x86_feature::bmi2))
81 consteval std::uint64_t
shrx(std::uint64_t value,
unsigned count)
noexcept;
83 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(Arch.has(x86_feature::bmi2))
84 constexpr std::int32_t
sarx(std::int32_t value,
unsigned count)
noexcept;
86 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(!Arch.has(x86_feature::bmi2))
87 consteval std::int32_t
sarx(std::int32_t value,
unsigned count)
noexcept;
89 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(Arch.has(x86_feature::bmi2))
90 constexpr std::int64_t
sarx(std::int64_t value,
unsigned count)
noexcept;
92 template<isa<x86> Arch = NATIVE_BA
SELINE>
requires(!Arch.has(x86_feature::bmi2))
93 consteval std::int64_t
sarx(std::int64_t value,
unsigned count)
noexcept;
97 template<
unsigned Imm8, isa<x86> Arch = NATIVE_BA
SELINE>
98 requires(Arch.has(x86_feature::bmi2) && Imm8 <= 255)
106 template<
unsigned Imm8, isa<x86> Arch = NATIVE_BA
SELINE>
107 requires(Arch.has(x86_feature::bmi2) && Imm8 <= 255)
114 template<
unsigned Imm8, isa<x86> Arch = NATIVE_BA
SELINE>
115 requires(!Arch.has(x86_feature::bmi2) && Imm8 <= 255)
122 template<
unsigned Imm8, isa<x86> Arch = NATIVE_BA
SELINE>
123 requires(!Arch.has(x86_feature::bmi2) && Imm8 <= 255)
#define native_inline
inline [[always_inline]]
#define native_nodiscard
C++17 [[nodiscard]].
#define native_const
[[const]] is not const
typename mask_traits< std::remove_cvref_t< T > >::type mask
constexpr std::uint32_t pdep(std::uint32_t value, std::uint32_t mask) noexcept
Parallel bit deposit (PDEP): place the low popcount(mask) bits into mask's set positions,...
constexpr std::uint32_t bzhi(std::uint32_t value, unsigned index) noexcept
Zero bits at and above index's low eight bits; an index at least the width leaves value unchanged.
constexpr std::uint32_t mulx(std::uint32_t a, std::uint32_t b, std::uint32_t *high) noexcept
Return the low product and write the high product to a valid output pointer.
constexpr std::int32_t sarx(std::int32_t value, unsigned count) noexcept
Arithmetic right shift using the low five bits of count, propagating the sign bit.
constexpr std::uint32_t pext(std::uint32_t value, std::uint32_t mask) noexcept
Parallel bit extract (PEXT): gather mask's selected bits into the low bits, in order.
constexpr std::uint32_t shlx(std::uint32_t value, unsigned count) noexcept
Logical left shift using the low five bits of count.
constexpr std::uint32_t shrx(std::uint32_t value, unsigned count) noexcept
Logical right shift using the low five bits of count.
Architecture-tagged vectors, register packs and supporting value types. Native arithmetic follows its...
constexpr std::uint32_t rorx(std::uint32_t value) noexcept
constexpr int target
First matching requirement, with every later choice checked for shadowing.
Standard-library adaptations documented here for SIMD value types.