native 0.0.1
Vectors, masks and wide register packs for C++26
Loading...
Searching...
No Matches
native.x86.pclmul.ccm
1// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0
2module;
3#include "native/isa_import.h"
4#include "native/x86/pclmul.h"
5#include "native/x86/integer_constant.h"
6export module native.x86.pclmul;
7export import native.x86.features;
8export import native.simd;
9// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0
10#if NATIVE_HOST_X86 || defined(NATIVE_DOXYGEN)
11export namespace native {
24
27 template<isa<x86> Arch, unsigned Imm8> requires(Arch.has(x86_feature::pclmul) && Imm8 <= 255)
29 constexpr simd<std::uint64_t, 2, Arch> pclmulqdq(simd<std::uint64_t, 2, Arch> a, simd<std::uint64_t, 2, Arch> b) noexcept {
30 if consteval { return detail::x86_instruction_constant::carryless<Imm8>(a, b); }
31 else {
32 return simd<std::uint64_t, 2, Arch>::from_native(detail::x86_pclmul::pclmulqdq<Arch, Imm8>(a.to_native(), b.to_native()));
33 }
34 }
35
37 template<isa<x86> Arch, unsigned Imm8> requires(!((Arch.has(x86_feature::pclmul))) && Imm8 <= 255 &&
38 requires { sizeof(simd<std::uint64_t, 2, Arch>); })
40 return detail::x86_instruction_constant::carryless<Imm8>(a, b);
41 }
42
43 // Reject implicit register conversions, mixed tags and wrong element types.
45 template<isa<x86> Arch, unsigned Imm8, class... Args>
46 void pclmulqdq(Args...) = delete;
47
49}
50#endif
#define native_inline
inline [[always_inline]]
Definition attributes.h:212
#define native_nodiscard
C++17 [[nodiscard]].
Definition attributes.h:189
#define native_const
[[const]] is not const
Definition attributes.h:108
#define native_target(x)
this indicates a required feature set for the current multiversioned function.
Definition attributes.h:476
constexpr simd< std::uint64_t, 2, Arch > pclmulqdq(simd< std::uint64_t, 2, Arch > a, simd< std::uint64_t, 2, Arch > b) noexcept
Architecture-tagged vectors, register packs and supporting value types. Native arithmetic follows its...
Standard-library adaptations documented here for SIMD value types.
Omitted architecture arguments use the native.simd provider's baseline.