native 0.0.1
Vectors, masks and wide register packs for C++26
Loading...
Searching...
No Matches
exp_policies.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/targets.h>
5#include "native/kernel_policies.h"
6
7// Clang attributes require literal target strings.
8#define NATIVE_TARGET_exp_base NATIVE_KERNEL_TARGET_2
9#define NATIVE_TARGET_exp_bw NATIVE_KERNEL_TARGET_3
10#define NATIVE_TARGET_exp_vl NATIVE_KERNEL_TARGET_4
11
12namespace native::detail {
13 // Every callee in the binary32 graph uses this same five-way split.
14 template<isa<x86> A> inline constexpr auto exp_target=
16}
17
18// Pattern: [callback lists](../README.md#callback-lists).
19// Ordinal and literal Clang target for each body.
20#define NATIVE_EXP_TARGETS(X) \
21 X(0, avx512) \
22 X(1, exp_bw) \
23 X(2, exp_vl) \
24 X(3, exp_base) \
25 X(4, avx2)
26
27#define CHECK_EXP_TARGET(i, name) \
28 static_assert(::native::detail::exp_target<::native::target_features<::native::x86>(NATIVE_TARGET_STRING(name))> == i);
29
30NATIVE_EXP_TARGETS(CHECK_EXP_TARGET)
31#undef CHECK_EXP_TARGET
constexpr int target
First matching requirement, with every later choice checked for shadowing.
Definition isa.h:445