native 0.0.1
Vectors, masks and wide register packs for C++26
Loading...
Searching...
No Matches
pclmul.h
1// SPDX-FileCopyrightText: 2026 Edward Kmett <ekmett@gmail.com>
2// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0
3#pragma once
4#include "native/config.h"
5#include "native/attributes.h"
6#include "native/isa.h"
7#if NATIVE_HOST_X86
8#include <immintrin.h>
9#endif
10
11#if NATIVE_HOST_X86 || defined(NATIVE_DOXYGEN)
12namespace native::detail::x86_pclmul {
13// Internal register helpers for the native.x86.pclmul module.
14
15
18 template<isa<x86> Arch, unsigned Imm8> requires(Arch.has(x86_feature::pclmul) && Imm8 <= 255)
20 __m128i pclmulqdq(__m128i a, __m128i b) noexcept {
21 return _mm_clmulepi64_si128(a, b, Imm8);
22 }
23
26 template<isa<x86> Arch, unsigned Imm8, class A, class B>
27 void pclmulqdq(A, B) = delete;
28
29
30}
31#endif
Compiler attributes for host code, with shader-safe shared modifiers.
#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