5#ifndef NATIVE_WIDE_MODULE
8#include "native/value_traits.h"
9#include "native/wide_pack.h"
22 template<
class T, std::
size_t N>
struct wide;
24 template<
class T>
struct wide_traits {
25 using element_type = T;
26 static constexpr bool value =
false;
27 static constexpr std::size_t size = 0;
29 template<
class T, std::
size_t N>
struct wide_traits<
wide<T, N>> {
30 using element_type = T;
31 static constexpr bool value =
true;
32 static constexpr std::size_t size = N;
37 template<
class T,
class =
void>
struct wide_features {
38 static constexpr isa<> value=scalar;
40 template<
class T>
struct wide_features<T,std::void_t<decltype(T::architecture)>> {
41 static constexpr isa<> value=value_architecture_v<T>;
43 template<
class T,std::
size_t N>
struct wide_features<
wide<T,N>> : wide_features<T> {};
44 template<
class T,std::
size_t N>
struct wide_features<std::array<T,N>> : wide_features<T> {};
45 template<
class T,
class U>
struct wide_features<std::pair<T,U>> {
46 static constexpr isa<> value=wide_features<std::remove_cvref_t<T>>::value &
47 wide_features<std::remove_cvref_t<U>>::value;
52 template<
class... T>
inline constexpr auto wide_target=[] {
53 constexpr isa<> bits=(scalar & ... & wide_features<std::remove_cvref_t<T>>::value);
54 constexpr auto index=abi_lookup<bits,wide_kernel_policies>::index;
55 static_assert(index>=0,
"wide operands require an available host declaration scope");
56 return host_kernel_profiles::indices[index];
58 template<
class T>
inline constexpr bool wide_equivalent_default=
59 value_traits<std::remove_cv_t<T>>::aggregate_default;
66 template<
class T,std::
size_t N>
inline constexpr bool wide_target_default =
67 (N == 0 || wide_equivalent_default<T>) && std::is_default_constructible_v<T> &&
68 !std::is_trivially_default_constructible_v<T> &&
69 std::is_default_constructible_v<std::array<T,N>> &&
70 !std::is_trivially_default_constructible_v<std::array<T,N>>;
85 template<
class T, std::
size_t N>
88 alignas(T) std::array<T, N> registers;
91 constexpr wide()
requires (!detail::wide_target_default<T,N>) =
default;
93 template<std::
size_t I>
requires (I < N)
94 [[nodiscard]] hint_inline
constexpr T &
get() &
noexcept hint_lifetimebound {
return registers[I]; }
96 template<std::
size_t I>
requires (I < N)
97 [[nodiscard]] hint_inline
constexpr T
const &
get()
const &
noexcept hint_lifetimebound {
return registers[I]; }
99 template<std::
size_t I>
requires (I < N)
100 [[nodiscard]] hint_inline
constexpr T &&
get() &&
noexcept hint_lifetimebound {
return std::move(registers[I]); }
102 template<std::
size_t I>
requires (I < N)
103 [[nodiscard]] hint_inline
constexpr T
const &&
get()
const &&
noexcept hint_lifetimebound {
return std::move(registers[I]); }
106 struct conversion_tag {};
107#define NATIVE_WIDE_INDEX 15
108#define NATIVE_WIDE_DETAIL detail::wide_generic_detail
109#define NATIVE_WIDE_TARGET
115 NATIVE_WIDE_TARGET hint_inline
constexpr wide()
116 noexcept(
std::is_nothrow_default_constructible_v<
std::array<T,N>>)
117 requires (detail::wide_target<T> == NATIVE_WIDE_INDEX) && detail::wide_target_default<T,N>
120 NATIVE_WIDE_TARGET hint_inline
constexpr wide(std::array<T, N> values)
121 noexcept(std::is_nothrow_move_constructible_v<std::array<T, N>>)
122 requires (detail::wide_target<T> == NATIVE_WIDE_INDEX)
123 : registers(std::move(values)) {}
125 template<
class... U>
requires (detail::wide_target<T,U...> == NATIVE_WIDE_INDEX) && (
sizeof...(U) == N && N != 0) &&
126 (std::constructible_from<T,U &&> && ...) &&
127 (N != 1 || ((!detail::wide_traits<std::remove_cvref_t<U>>::value &&
128 !std::same_as<std::remove_cvref_t<U>,std::array<T,N>>) && ...))
129 explicit(N == 1) NATIVE_WIDE_TARGET hint_inline
constexpr wide(U &&... values)
130 noexcept((std::is_nothrow_constructible_v<T,U &&> && ...))
131 : registers{T(std::forward<U>(values))...} {}
133 template<
class U>
requires (detail::wide_target<T,U> == NATIVE_WIDE_INDEX) && (N != 1) && (!detail::wide_traits<std::remove_cvref_t<U>>::value) &&
134 (!std::same_as<std::remove_cvref_t<U>,std::array<T, N>>) &&
135 std::constructible_from<T,U const &> && (N == 0 || std::copy_constructible<T>)
136 explicit NATIVE_WIDE_TARGET hint_inline
constexpr wide(U
const & value)
137 noexcept(std::is_nothrow_constructible_v<T,U const &> &&
138 (N == 0 || std::is_nothrow_copy_constructible_v<T>))
139 :
wide(T(value),
std::make_index_sequence<N>{}) {}
142 template<
class U>
requires (detail::wide_target<T,U> == NATIVE_WIDE_INDEX) && (!std::same_as<T,U>) && std::constructible_from<T,U const &>
143 explicit(!std::is_convertible_v<U const &,T>) NATIVE_WIDE_TARGET hint_inline
constexpr wide(
wide<U,N> const & source)
144 noexcept(N == 0 || std::is_nothrow_constructible_v<T,U const &>)
145 :
wide(conversion_tag{}, source,
std::make_index_sequence<N>{}) {}
147 template<
class U>
requires (detail::wide_target<T,U> == NATIVE_WIDE_INDEX) && (!std::same_as<T,U>) && std::constructible_from<T,U &&>
148 explicit(!std::is_convertible_v<U &&,T>) NATIVE_WIDE_TARGET hint_inline
constexpr wide(
wide<U,N> && source)
149 noexcept(N == 0 || std::is_nothrow_constructible_v<T,U &&>)
150 :
wide(conversion_tag{},
std::move(source),
std::make_index_sequence<N>{}) {}
153 [[nodiscard]]
static NATIVE_WIDE_TARGET hint_inline
constexpr wide broadcast(T
const & value)
154 noexcept(N == 0 || std::is_nothrow_copy_constructible_v<T>)
155 requires (detail::wide_target<T> == NATIVE_WIDE_INDEX) && (N == 0 || std::copy_constructible<T>) {
156 return wide(value, std::make_index_sequence<N>{});
160 template<
class F>
requires (detail::wide_target<T> == NATIVE_WIDE_INDEX)
161 NATIVE_WIDE_TARGET hint_inline
constexpr decltype(
auto)
apply(F && f)
noexcept(
noexcept(std::apply(std::forward<F>(f), registers))) {
162 return apply_indices(std::forward<F>(f), registers, std::make_index_sequence<N>{});
166 template<
class F>
requires (detail::wide_target<T> == NATIVE_WIDE_INDEX)
167 NATIVE_WIDE_TARGET hint_inline
constexpr decltype(
auto)
apply(F && f)
const noexcept(
noexcept(std::apply(std::forward<F>(f), registers))) {
168 return apply_indices(std::forward<F>(f), registers, std::make_index_sequence<N>{});
171 template<
class W, std::size_t... I>
requires (detail::wide_target<T,W> == NATIVE_WIDE_INDEX)
172 NATIVE_WIDE_TARGET hint_inline
constexpr wide(conversion_tag, W && source, std::index_sequence<I...>)
173 noexcept((std::is_nothrow_constructible_v<T,
174 decltype(std::get<I>(std::forward<W>(source).registers))> && ...))
175 : registers{T(std::get<I>(std::forward<W>(source).registers))...} {}
176 template<
class U, std::size_t... I>
requires (detail::wide_target<T> == NATIVE_WIDE_INDEX) && std::same_as<std::remove_cvref_t<U>,T>
177 NATIVE_WIDE_TARGET hint_inline
constexpr wide(U && value, std::index_sequence<I...>)
178 noexcept(N == 0 || std::is_nothrow_copy_constructible_v<T>)
179 : registers{((void)I,static_cast<T const &>(value))...} {}
182 template<
class F,
class A, std::size_t ... I>
requires (detail::wide_target<A> == NATIVE_WIDE_INDEX)
183 static NATIVE_WIDE_TARGET hint_inline
constexpr decltype(
auto) apply_indices(F && f, A & a, std::index_sequence<I...>) {
184 if constexpr (std::is_member_pointer_v<std::remove_reference_t<F>>)
185 return std::invoke(std::forward<F>(f), std::get<I>(a)...);
187 return std::forward<F>(f)(std::get<I>(a)...);
190#undef NATIVE_WIDE_TARGET
191#undef NATIVE_WIDE_DETAIL
192#undef NATIVE_WIDE_INDEX
194#if defined(__x86_64__) || defined(_M_X64)
195#define NATIVE_WIDE_INDEX 10
196#define NATIVE_WIDE_DETAIL detail::wide_avx2_detail
197#define NATIVE_WIDE_TARGET hint_target(NATIVE_KERNEL_TARGET_1)
199#undef NATIVE_WIDE_TARGET
200#undef NATIVE_WIDE_DETAIL
201#undef NATIVE_WIDE_INDEX
204#if defined(__x86_64__) || defined(_M_X64)
205#define NATIVE_WIDE_INDEX 9
206#define NATIVE_WIDE_DETAIL detail::wide_avx512_base_detail
207#define NATIVE_WIDE_TARGET hint_target(NATIVE_KERNEL_TARGET_2)
209#undef NATIVE_WIDE_TARGET
210#undef NATIVE_WIDE_DETAIL
211#undef NATIVE_WIDE_INDEX
214#if defined(__x86_64__) || defined(_M_X64)
215#define NATIVE_WIDE_INDEX 7
216#define NATIVE_WIDE_DETAIL detail::wide_avx512_bw_detail
217#define NATIVE_WIDE_TARGET hint_target(NATIVE_KERNEL_TARGET_3)
219#undef NATIVE_WIDE_TARGET
220#undef NATIVE_WIDE_DETAIL
221#undef NATIVE_WIDE_INDEX
224#if defined(__x86_64__) || defined(_M_X64)
225#define NATIVE_WIDE_INDEX 8
226#define NATIVE_WIDE_DETAIL detail::wide_avx512_vl_detail
227#define NATIVE_WIDE_TARGET hint_target(NATIVE_KERNEL_TARGET_4)
229#undef NATIVE_WIDE_TARGET
230#undef NATIVE_WIDE_DETAIL
231#undef NATIVE_WIDE_INDEX
234#if defined(__x86_64__) || defined(_M_X64)
235#define NATIVE_WIDE_INDEX 3
236#define NATIVE_WIDE_DETAIL detail::wide_avx512_bw_vl_detail
237#define NATIVE_WIDE_TARGET hint_target(NATIVE_KERNEL_TARGET_5)
239#undef NATIVE_WIDE_TARGET
240#undef NATIVE_WIDE_DETAIL
241#undef NATIVE_WIDE_INDEX
244#if defined(__x86_64__) || defined(_M_X64)
245#define NATIVE_WIDE_INDEX 5
246#define NATIVE_WIDE_DETAIL detail::wide_avx512_bw_bf16_detail
247#define NATIVE_WIDE_TARGET hint_target(NATIVE_KERNEL_TARGET_7)
249#undef NATIVE_WIDE_TARGET
250#undef NATIVE_WIDE_DETAIL
251#undef NATIVE_WIDE_INDEX
254#if defined(__x86_64__) || defined(_M_X64)
255#define NATIVE_WIDE_INDEX 1
256#define NATIVE_WIDE_DETAIL detail::wide_avx512_bw_vl_bf16_detail
257#define NATIVE_WIDE_TARGET hint_target(NATIVE_KERNEL_TARGET_9)
259#undef NATIVE_WIDE_TARGET
260#undef NATIVE_WIDE_DETAIL
261#undef NATIVE_WIDE_INDEX
264#if defined(__x86_64__) || defined(_M_X64)
265#define NATIVE_WIDE_INDEX 6
266#define NATIVE_WIDE_DETAIL detail::wide_avx512_bw_fp16_detail
267#define NATIVE_WIDE_TARGET hint_target(NATIVE_KERNEL_TARGET_11)
269#undef NATIVE_WIDE_TARGET
270#undef NATIVE_WIDE_DETAIL
271#undef NATIVE_WIDE_INDEX
274#if defined(__x86_64__) || defined(_M_X64)
275#define NATIVE_WIDE_INDEX 2
276#define NATIVE_WIDE_DETAIL detail::wide_avx512_bw_vl_fp16_detail
277#define NATIVE_WIDE_TARGET hint_target(NATIVE_KERNEL_TARGET_13)
279#undef NATIVE_WIDE_TARGET
280#undef NATIVE_WIDE_DETAIL
281#undef NATIVE_WIDE_INDEX
284#if defined(__x86_64__) || defined(_M_X64)
285#define NATIVE_WIDE_INDEX 4
286#define NATIVE_WIDE_DETAIL detail::wide_avx512_bw_bf16_fp16_detail
287#define NATIVE_WIDE_TARGET hint_target(NATIVE_KERNEL_TARGET_15)
289#undef NATIVE_WIDE_TARGET
290#undef NATIVE_WIDE_DETAIL
291#undef NATIVE_WIDE_INDEX
294#if defined(__x86_64__) || defined(_M_X64)
295#define NATIVE_WIDE_INDEX 0
296#define NATIVE_WIDE_DETAIL detail::wide_avx512_bw_vl_bf16_fp16_detail
297#define NATIVE_WIDE_TARGET hint_target(NATIVE_KERNEL_TARGET_17)
299#undef NATIVE_WIDE_TARGET
300#undef NATIVE_WIDE_DETAIL
301#undef NATIVE_WIDE_INDEX
304#if defined(__aarch64__) || defined(_M_ARM64)
305#define NATIVE_WIDE_INDEX 14
306#define NATIVE_WIDE_DETAIL detail::wide_neon_detail
307#define NATIVE_WIDE_TARGET hint_target(NATIVE_KERNEL_TARGET_20)
309#undef NATIVE_WIDE_TARGET
310#undef NATIVE_WIDE_DETAIL
311#undef NATIVE_WIDE_INDEX
314#if defined(__aarch64__) || defined(_M_ARM64)
315#define NATIVE_WIDE_INDEX 12
316#define NATIVE_WIDE_DETAIL detail::wide_neon_bf16_detail
317#define NATIVE_WIDE_TARGET hint_target(NATIVE_KERNEL_TARGET_21)
319#undef NATIVE_WIDE_TARGET
320#undef NATIVE_WIDE_DETAIL
321#undef NATIVE_WIDE_INDEX
324#if defined(__aarch64__) || defined(_M_ARM64)
325#define NATIVE_WIDE_INDEX 13
326#define NATIVE_WIDE_DETAIL detail::wide_neon_fp16_detail
327#define NATIVE_WIDE_TARGET hint_target(NATIVE_KERNEL_TARGET_22)
329#undef NATIVE_WIDE_TARGET
330#undef NATIVE_WIDE_DETAIL
331#undef NATIVE_WIDE_INDEX
334#if defined(__aarch64__) || defined(_M_ARM64)
335#define NATIVE_WIDE_INDEX 11
336#define NATIVE_WIDE_DETAIL detail::wide_neon_half_detail
337#define NATIVE_WIDE_TARGET hint_target(NATIVE_KERNEL_TARGET_23)
339#undef NATIVE_WIDE_TARGET
340#undef NATIVE_WIDE_DETAIL
341#undef NATIVE_WIDE_INDEX
345#define NATIVE_WIDE_INDEX 16
346#define NATIVE_WIDE_DETAIL detail::wide_wasm_detail
347#define NATIVE_WIDE_TARGET hint_target(NATIVE_KERNEL_TARGET_WASM)
349#undef NATIVE_WIDE_TARGET
350#undef NATIVE_WIDE_DETAIL
351#undef NATIVE_WIDE_INDEX
356 template<
class T,
class... U>
requires (std::same_as<T,U> && ...)
359#define NATIVE_WIDE_INDEX 15
360#define NATIVE_WIDE_DETAIL detail::wide_generic_detail
364 namespace NATIVE_WIDE_DETAIL {
365 using namespace ::native::detail;
366 template<
class T>
using wide_element_t =
typename wide_traits<T>::element_type;
367 template<
class A,
class B>
concept wide_arguments =
368 (wide_traits<A>::value || wide_traits<B>::value) &&
369 (!wide_traits<A>::value || !wide_traits<B>::value || wide_traits<A>::size == wide_traits<B>::size);
370 template<
class A,
class B>
inline constexpr std::size_t wide_size =
371 wide_traits<A>::value ? wide_traits<A>::size : wide_traits<B>::size;
373 template<std::
size_t I,
class T>
374 hint_inline
constexpr decltype(
auto) wide_element(T
const & value) {
375 if constexpr (wide_traits<T>::value)
return value.registers[I];
378 template<
class A,
class B,
class F, std::size_t... I>
379 hint_inline
constexpr auto wide_binary(A
const & a, B
const & b, F f, std::index_sequence<I...>) {
380 using R = std::remove_cvref_t<
decltype(f(std::declval<wide_element_t<A>
const &>(),
381 std::declval<wide_element_t<B>
const &>()))>;
382 return wide<R,
sizeof...(I)>{{f(wide_element<I>(a), wide_element<I>(b))...}};
384 template<
class T, std::size_t N,
class F, std::size_t... I>
385 hint_inline
constexpr auto wide_unary(
wide<T, N> const & a, F f, std::index_sequence<I...>) {
386 using R = std::remove_cvref_t<decltype(f(std::declval<T const &>()))>;
389 template<
class T, std::size_t N,
class B,
class F, std::size_t... I>
390 hint_inline
constexpr wide<T, N> & wide_mutate(
wide<T, N> & a, B
const & b, F f, std::index_sequence<I...>) {
391 if constexpr (wide_traits<B>::value) (f(a.registers[I], b.registers[I]), ...);
392 else if constexpr (N != 0) {
396 (f(a.registers[I], value), ...);
402 namespace NATIVE_WIDE_DETAIL {
403 using namespace ::native::detail;
404 template<
class A> hint_inline
constexpr decltype(
auto) wide_storage(A
const & a)
noexcept {
405 if constexpr (wide_traits<A>::value)
return (a.registers);
409 template<
class A,
class B> hint_inline
constexpr auto operator()(A
const & a,B
const & b)
const
410 noexcept(
noexcept(a + b)) ->
decltype(a + b) {
return a + b; }
411 template<
class A,
class B> hint_inline
constexpr auto batch(A
const & a,B
const & b)
const
412 noexcept(
noexcept(add(a,b))) ->
decltype(add(a,b)) {
return add(a,b); }
415 template<
class A,
class B> hint_inline
constexpr auto operator()(A
const & a,B
const & b)
const
416 noexcept(
noexcept(a - b)) ->
decltype(a - b) {
return a - b; }
417 template<
class A,
class B> hint_inline
constexpr auto batch(A
const & a,B
const & b)
const
418 noexcept(
noexcept(sub(a,b))) ->
decltype(sub(a,b)) {
return sub(a,b); }
421 template<
class A,
class B> hint_inline
constexpr auto operator()(A
const & a,B
const & b)
const
422 noexcept(
noexcept(a * b)) ->
decltype(a * b) {
return a * b; }
423 template<
class A,
class B> hint_inline
constexpr auto batch(A
const & a,B
const & b)
const
424 noexcept(
noexcept(mul(a,b))) ->
decltype(mul(a,b)) {
return mul(a,b); }
426 template<
class A,
class B,
class F>
concept wide_batch =
requires(A
const & a,B
const & b) {
427 wide{F{}.batch(wide_storage(a),wide_storage(b))};
429 template<
class A,
class B,
class F>
concept wide_batch_assignable = wide_batch<A,B,F> &&
430 requires(A & a,B
const & b) { a =
wide{F{}.batch(wide_storage(a),wide_storage(b))}; };
431 template<
class A,
class B,
class F>
432 hint_inline
constexpr auto wide_dispatch(A
const & a,B
const & b,F f)
434 if constexpr (wide_batch<A,B,F>)
435 return noexcept(wide{F{}.batch(wide_storage(std::declval<A const &>()),wide_storage(std::declval<B const &>()))});
438 if constexpr (wide_batch<A,B,F>)
return wide{f.batch(wide_storage(a),wide_storage(b))};
439 else return wide_binary(a,b,f,std::make_index_sequence<wide_size<A,B>>{});
447 template<
class A,
class B>
requires NATIVE_WIDE_DETAIL::wide_arguments<A, B> && (::native::detail::wide_target<A,B> == NATIVE_WIDE_INDEX) &&
448 requires(NATIVE_WIDE_DETAIL::wide_element_t<A>
const & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a + b; }
449 [[nodiscard]] hint_inline
constexpr auto operator+(A
const & a, B
const & b)
450 noexcept(
noexcept(NATIVE_WIDE_DETAIL::wide_dispatch(a,b,NATIVE_WIDE_DETAIL::wide_add{}))) {
451 return NATIVE_WIDE_DETAIL::wide_dispatch(a,b,NATIVE_WIDE_DETAIL::wide_add{});
456 template<
class A,
class B>
requires NATIVE_WIDE_DETAIL::wide_arguments<A, B> && (::native::detail::wide_target<A,B> == NATIVE_WIDE_INDEX) &&
457 requires(NATIVE_WIDE_DETAIL::wide_element_t<A>
const & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a - b; }
458 [[nodiscard]] hint_inline
constexpr auto operator-(A
const & a, B
const & b)
459 noexcept(
noexcept(NATIVE_WIDE_DETAIL::wide_dispatch(a,b,NATIVE_WIDE_DETAIL::wide_sub{}))) {
460 return NATIVE_WIDE_DETAIL::wide_dispatch(a,b,NATIVE_WIDE_DETAIL::wide_sub{});
465 template<
class A,
class B>
requires NATIVE_WIDE_DETAIL::wide_arguments<A, B> && (::native::detail::wide_target<A,B> == NATIVE_WIDE_INDEX) &&
466 requires(NATIVE_WIDE_DETAIL::wide_element_t<A>
const & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a * b; }
467 [[nodiscard]] hint_inline
constexpr auto operator*(A
const & a, B
const & b)
468 noexcept(
noexcept(NATIVE_WIDE_DETAIL::wide_dispatch(a,b,NATIVE_WIDE_DETAIL::wide_mul{}))) {
469 return NATIVE_WIDE_DETAIL::wide_dispatch(a,b,NATIVE_WIDE_DETAIL::wide_mul{});
474 template<
class A,
class B>
requires NATIVE_WIDE_DETAIL::wide_arguments<A, B> && (::native::detail::wide_target<A,B> == NATIVE_WIDE_INDEX) &&
475 requires(NATIVE_WIDE_DETAIL::wide_element_t<A>
const & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a / b; }
476 [[nodiscard]] hint_inline
constexpr auto operator/(A
const & a, B
const & b) {
477 return NATIVE_WIDE_DETAIL::wide_binary(a, b, [](
auto const & x,
auto const & y) ->
decltype(x / y) {
return x / y; },
478 std::make_index_sequence<NATIVE_WIDE_DETAIL::wide_size<A, B>>{});
483 template<
class A,
class B>
requires NATIVE_WIDE_DETAIL::wide_arguments<A, B> && (::native::detail::wide_target<A,B> == NATIVE_WIDE_INDEX) &&
484 requires(NATIVE_WIDE_DETAIL::wide_element_t<A>
const & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a % b; }
485 [[nodiscard]] hint_inline
constexpr auto operator%(A
const & a, B
const & b) {
486 return NATIVE_WIDE_DETAIL::wide_binary(a, b, [](
auto const & x,
auto const & y) ->
decltype(x % y) {
return x % y; },
487 std::make_index_sequence<NATIVE_WIDE_DETAIL::wide_size<A, B>>{});
492 template<
class A,
class B>
requires NATIVE_WIDE_DETAIL::wide_arguments<A, B> && (::native::detail::wide_target<A,B> == NATIVE_WIDE_INDEX) &&
493 requires(NATIVE_WIDE_DETAIL::wide_element_t<A>
const & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a & b; }
494 [[nodiscard]] hint_inline
constexpr auto operator&(A
const & a, B
const & b) {
495 return NATIVE_WIDE_DETAIL::wide_binary(a, b, [](
auto const & x,
auto const & y) ->
decltype(x & y) {
return x & y; },
496 std::make_index_sequence<NATIVE_WIDE_DETAIL::wide_size<A, B>>{});
501 template<
class A,
class B>
requires NATIVE_WIDE_DETAIL::wide_arguments<A, B> && (::native::detail::wide_target<A,B> == NATIVE_WIDE_INDEX) &&
502 requires(NATIVE_WIDE_DETAIL::wide_element_t<A>
const & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a | b; }
503 [[nodiscard]] hint_inline
constexpr auto operator|(A
const & a, B
const & b) {
504 return NATIVE_WIDE_DETAIL::wide_binary(a, b, [](
auto const & x,
auto const & y) ->
decltype(x | y) {
return x | y; },
505 std::make_index_sequence<NATIVE_WIDE_DETAIL::wide_size<A, B>>{});
510 template<
class A,
class B>
requires NATIVE_WIDE_DETAIL::wide_arguments<A, B> && (::native::detail::wide_target<A,B> == NATIVE_WIDE_INDEX) &&
511 requires(NATIVE_WIDE_DETAIL::wide_element_t<A>
const & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a ^ b; }
512 [[nodiscard]] hint_inline
constexpr auto operator^(A
const & a, B
const & b) {
513 return NATIVE_WIDE_DETAIL::wide_binary(a, b, [](
auto const & x,
auto const & y) ->
decltype(x ^ y) {
return x ^ y; },
514 std::make_index_sequence<NATIVE_WIDE_DETAIL::wide_size<A, B>>{});
519 template<
class A,
class B>
requires NATIVE_WIDE_DETAIL::wide_arguments<A, B> && (::native::detail::wide_target<A,B> == NATIVE_WIDE_INDEX) &&
520 requires(NATIVE_WIDE_DETAIL::wide_element_t<A>
const & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a << b; }
521 [[nodiscard]] hint_inline
constexpr auto operator<<(A
const & a, B
const & b) {
522 return NATIVE_WIDE_DETAIL::wide_binary(a, b, [](
auto const & x,
auto const & y) ->
decltype(x << y) {
return x << y; },
523 std::make_index_sequence<NATIVE_WIDE_DETAIL::wide_size<A, B>>{});
528 template<
class A,
class B>
requires NATIVE_WIDE_DETAIL::wide_arguments<A, B> && (::native::detail::wide_target<A,B> == NATIVE_WIDE_INDEX) &&
529 requires(NATIVE_WIDE_DETAIL::wide_element_t<A>
const & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a >> b; }
530 [[nodiscard]] hint_inline
constexpr auto operator>>(A
const & a, B
const & b) {
531 return NATIVE_WIDE_DETAIL::wide_binary(a, b, [](
auto const & x,
auto const & y) ->
decltype(x >> y) {
return x >> y; },
532 std::make_index_sequence<NATIVE_WIDE_DETAIL::wide_size<A, B>>{});
537 template<
class A,
class B>
requires NATIVE_WIDE_DETAIL::wide_arguments<A, B> && (::native::detail::wide_target<A,B> == NATIVE_WIDE_INDEX) &&
538 requires(NATIVE_WIDE_DETAIL::wide_element_t<A>
const & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a == b; }
539 [[nodiscard]] hint_inline
constexpr auto operator==(A
const & a, B
const & b) {
540 return NATIVE_WIDE_DETAIL::wide_binary(a, b, [](
auto const & x,
auto const & y) ->
decltype(x == y) {
return x == y; },
541 std::make_index_sequence<NATIVE_WIDE_DETAIL::wide_size<A, B>>{});
546 template<
class A,
class B>
requires NATIVE_WIDE_DETAIL::wide_arguments<A, B> && (::native::detail::wide_target<A,B> == NATIVE_WIDE_INDEX) &&
547 requires(NATIVE_WIDE_DETAIL::wide_element_t<A>
const & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a != b; }
548 [[nodiscard]] hint_inline
constexpr auto operator!=(A
const & a, B
const & b) {
549 return NATIVE_WIDE_DETAIL::wide_binary(a, b, [](
auto const & x,
auto const & y) ->
decltype(x != y) {
return x != y; },
550 std::make_index_sequence<NATIVE_WIDE_DETAIL::wide_size<A, B>>{});
555 template<
class A,
class B>
requires NATIVE_WIDE_DETAIL::wide_arguments<A, B> && (::native::detail::wide_target<A,B> == NATIVE_WIDE_INDEX) &&
556 requires(NATIVE_WIDE_DETAIL::wide_element_t<A>
const & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a < b; }
557 [[nodiscard]] hint_inline
constexpr auto operator<(A
const & a, B
const & b) {
558 return NATIVE_WIDE_DETAIL::wide_binary(a, b, [](
auto const & x,
auto const & y) ->
decltype(x < y) {
return x < y; },
559 std::make_index_sequence<NATIVE_WIDE_DETAIL::wide_size<A, B>>{});
564 template<
class A,
class B>
requires NATIVE_WIDE_DETAIL::wide_arguments<A, B> && (::native::detail::wide_target<A,B> == NATIVE_WIDE_INDEX) &&
565 requires(NATIVE_WIDE_DETAIL::wide_element_t<A>
const & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a > b; }
566 [[nodiscard]] hint_inline
constexpr auto operator>(A
const & a, B
const & b) {
567 return NATIVE_WIDE_DETAIL::wide_binary(a, b, [](
auto const & x,
auto const & y) ->
decltype(x > y) {
return x > y; },
568 std::make_index_sequence<NATIVE_WIDE_DETAIL::wide_size<A, B>>{});
573 template<
class A,
class B>
requires NATIVE_WIDE_DETAIL::wide_arguments<A, B> && (::native::detail::wide_target<A,B> == NATIVE_WIDE_INDEX) &&
574 requires(NATIVE_WIDE_DETAIL::wide_element_t<A>
const & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a <= b; }
575 [[nodiscard]] hint_inline
constexpr auto operator<=(A
const & a, B
const & b) {
576 return NATIVE_WIDE_DETAIL::wide_binary(a, b, [](
auto const & x,
auto const & y) ->
decltype(x <= y) {
return x <= y; },
577 std::make_index_sequence<NATIVE_WIDE_DETAIL::wide_size<A, B>>{});
582 template<
class A,
class B>
requires NATIVE_WIDE_DETAIL::wide_arguments<A, B> && (::native::detail::wide_target<A,B> == NATIVE_WIDE_INDEX) &&
583 requires(NATIVE_WIDE_DETAIL::wide_element_t<A>
const & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a >= b; }
584 [[nodiscard]] hint_inline
constexpr auto operator>=(A
const & a, B
const & b) {
585 return NATIVE_WIDE_DETAIL::wide_binary(a, b, [](
auto const & x,
auto const & y) ->
decltype(x >= y) {
return x >= y; },
586 std::make_index_sequence<NATIVE_WIDE_DETAIL::wide_size<A, B>>{});
591 template<
class T, std::
size_t N>
requires (::native::detail::wide_target<T> == NATIVE_WIDE_INDEX) &&
requires(T
const & a) { +a; }
593 return NATIVE_WIDE_DETAIL::wide_unary(a, [](
auto const & x) ->
decltype(+x) {
return +x; }, std::make_index_sequence<N>{});
598 template<
class T, std::
size_t N>
requires (::native::detail::wide_target<T> == NATIVE_WIDE_INDEX) &&
requires(T
const & a) { -a; }
600 return NATIVE_WIDE_DETAIL::wide_unary(a, [](
auto const & x) ->
decltype(-x) {
return -x; }, std::make_index_sequence<N>{});
605 template<
class T, std::
size_t N>
requires (::native::detail::wide_target<T> == NATIVE_WIDE_INDEX) &&
requires(T
const & a) { ~a; }
607 return NATIVE_WIDE_DETAIL::wide_unary(a, [](
auto const & x) ->
decltype(~x) {
return ~x; }, std::make_index_sequence<N>{});
612 template<
class T, std::
size_t N>
requires (::native::detail::wide_target<T> == NATIVE_WIDE_INDEX) &&
requires(T
const & a) { !a; }
614 return NATIVE_WIDE_DETAIL::wide_unary(a, [](
auto const & x) ->
decltype(!x) {
return !x; }, std::make_index_sequence<N>{});
619 template<
class T, std::
size_t N,
class B>
requires (::native::detail::wide_target<T,B> == NATIVE_WIDE_INDEX) && NATIVE_WIDE_DETAIL::wide_arguments<wide<T, N>, B> &&
620 (NATIVE_WIDE_DETAIL::wide_batch_assignable<wide<T,N>,B,NATIVE_WIDE_DETAIL::wide_add> ||
621 ((NATIVE_WIDE_DETAIL::wide_traits<B>::value || std::copy_constructible<B>) &&
622 requires(T & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a += b; })))
625 if constexpr (NATIVE_WIDE_DETAIL::wide_batch_assignable<wide<T,N>,B,NATIVE_WIDE_DETAIL::wide_add>)
626 return noexcept(std::declval<
wide<T,N> &>() = NATIVE_WIDE_DETAIL::wide_dispatch(
627 std::declval<
wide<T,N> const &>(),std::declval<B const &>(),NATIVE_WIDE_DETAIL::wide_add{}));
630 if constexpr (NATIVE_WIDE_DETAIL::wide_batch_assignable<wide<T,N>,B,NATIVE_WIDE_DETAIL::wide_add>)
631 return a = NATIVE_WIDE_DETAIL::wide_dispatch(a,b,NATIVE_WIDE_DETAIL::wide_add{});
632 else return NATIVE_WIDE_DETAIL::wide_mutate(a, b, [](
auto & x,
auto const & y) { x += y; }, std::make_index_sequence<N>{});
637 template<
class T, std::
size_t N,
class B>
requires (::native::detail::wide_target<T,B> == NATIVE_WIDE_INDEX) && NATIVE_WIDE_DETAIL::wide_arguments<
wide<T, N>, B> &&
638 (NATIVE_WIDE_DETAIL::wide_batch_assignable<
wide<T,N>,B,NATIVE_WIDE_DETAIL::wide_sub> ||
639 ((NATIVE_WIDE_DETAIL::wide_traits<B>::value || std::copy_constructible<B>) &&
640 requires(T & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a -= b; })))
643 if constexpr (NATIVE_WIDE_DETAIL::wide_batch_assignable<wide<T,N>,B,NATIVE_WIDE_DETAIL::wide_sub>)
644 return noexcept(std::declval<
wide<T,N> &>() = NATIVE_WIDE_DETAIL::wide_dispatch(
645 std::declval<
wide<T,N> const &>(),std::declval<B const &>(),NATIVE_WIDE_DETAIL::wide_sub{}));
648 if constexpr (NATIVE_WIDE_DETAIL::wide_batch_assignable<wide<T,N>,B,NATIVE_WIDE_DETAIL::wide_sub>)
649 return a = NATIVE_WIDE_DETAIL::wide_dispatch(a,b,NATIVE_WIDE_DETAIL::wide_sub{});
650 else return NATIVE_WIDE_DETAIL::wide_mutate(a, b, [](
auto & x,
auto const & y) { x -= y; }, std::make_index_sequence<N>{});
655 template<
class T, std::
size_t N,
class B>
requires (::native::detail::wide_target<T,B> == NATIVE_WIDE_INDEX) && NATIVE_WIDE_DETAIL::wide_arguments<
wide<T, N>, B> &&
656 (NATIVE_WIDE_DETAIL::wide_batch_assignable<
wide<T,N>,B,NATIVE_WIDE_DETAIL::wide_mul> ||
657 ((NATIVE_WIDE_DETAIL::wide_traits<B>::value || std::copy_constructible<B>) &&
658 requires(T & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a *= b; })))
661 if constexpr (NATIVE_WIDE_DETAIL::wide_batch_assignable<wide<T,N>,B,NATIVE_WIDE_DETAIL::wide_mul>)
662 return noexcept(std::declval<
wide<T,N> &>() = NATIVE_WIDE_DETAIL::wide_dispatch(
663 std::declval<
wide<T,N> const &>(),std::declval<B const &>(),NATIVE_WIDE_DETAIL::wide_mul{}));
666 if constexpr (NATIVE_WIDE_DETAIL::wide_batch_assignable<wide<T,N>,B,NATIVE_WIDE_DETAIL::wide_mul>)
667 return a = NATIVE_WIDE_DETAIL::wide_dispatch(a,b,NATIVE_WIDE_DETAIL::wide_mul{});
668 else return NATIVE_WIDE_DETAIL::wide_mutate(a, b, [](
auto & x,
auto const & y) { x *= y; }, std::make_index_sequence<N>{});
673 template<
class T, std::
size_t N,
class B>
requires (::native::detail::wide_target<T,B> == NATIVE_WIDE_INDEX) && NATIVE_WIDE_DETAIL::wide_arguments<
wide<T, N>, B> &&
674 (NATIVE_WIDE_DETAIL::wide_traits<B>::value || std::copy_constructible<B>) &&
675 requires(T & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a /= b; }
677 return NATIVE_WIDE_DETAIL::wide_mutate(a, b, [](
auto & x,
auto const & y) { x /= y; }, std::make_index_sequence<N>{});
682 template<
class T, std::
size_t N,
class B>
requires (::native::detail::wide_target<T,B> == NATIVE_WIDE_INDEX) && NATIVE_WIDE_DETAIL::wide_arguments<wide<T, N>, B> &&
683 (NATIVE_WIDE_DETAIL::wide_traits<B>::value || std::copy_constructible<B>) &&
684 requires(T & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a %= b; }
686 return NATIVE_WIDE_DETAIL::wide_mutate(a, b, [](
auto & x,
auto const & y) { x %= y; }, std::make_index_sequence<N>{});
691 template<
class T, std::
size_t N,
class B>
requires (::native::detail::wide_target<T,B> == NATIVE_WIDE_INDEX) && NATIVE_WIDE_DETAIL::wide_arguments<wide<T, N>, B> &&
692 (NATIVE_WIDE_DETAIL::wide_traits<B>::value || std::copy_constructible<B>) &&
693 requires(T & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a &= b; }
695 return NATIVE_WIDE_DETAIL::wide_mutate(a, b, [](
auto & x,
auto const & y) { x &= y; }, std::make_index_sequence<N>{});
700 template<
class T, std::
size_t N,
class B>
requires (::native::detail::wide_target<T,B> == NATIVE_WIDE_INDEX) && NATIVE_WIDE_DETAIL::wide_arguments<wide<T, N>, B> &&
701 (NATIVE_WIDE_DETAIL::wide_traits<B>::value || std::copy_constructible<B>) &&
702 requires(T & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a |= b; }
704 return NATIVE_WIDE_DETAIL::wide_mutate(a, b, [](
auto & x,
auto const & y) { x |= y; }, std::make_index_sequence<N>{});
709 template<
class T, std::
size_t N,
class B>
requires (::native::detail::wide_target<T,B> == NATIVE_WIDE_INDEX) && NATIVE_WIDE_DETAIL::wide_arguments<wide<T, N>, B> &&
710 (NATIVE_WIDE_DETAIL::wide_traits<B>::value || std::copy_constructible<B>) &&
711 requires(T & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a ^= b; }
713 return NATIVE_WIDE_DETAIL::wide_mutate(a, b, [](
auto & x,
auto const & y) { x ^= y; }, std::make_index_sequence<N>{});
718 template<
class T, std::
size_t N,
class B>
requires (::native::detail::wide_target<T,B> == NATIVE_WIDE_INDEX) && NATIVE_WIDE_DETAIL::wide_arguments<wide<T, N>, B> &&
719 (NATIVE_WIDE_DETAIL::wide_traits<B>::value || std::copy_constructible<B>) &&
720 requires(T & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a <<= b; }
722 return NATIVE_WIDE_DETAIL::wide_mutate(a, b, [](
auto & x,
auto const & y) { x <<= y; }, std::make_index_sequence<N>{});
727 template<
class T, std::
size_t N,
class B>
requires (::native::detail::wide_target<T,B> == NATIVE_WIDE_INDEX) && NATIVE_WIDE_DETAIL::wide_arguments<wide<T, N>, B> &&
728 (NATIVE_WIDE_DETAIL::wide_traits<B>::value || std::copy_constructible<B>) &&
729 requires(T & a, NATIVE_WIDE_DETAIL::wide_element_t<B>
const & b) { a >>= b; }
731 return NATIVE_WIDE_DETAIL::wide_mutate(a, b, [](
auto & x,
auto const & y) { x >>= y; }, std::make_index_sequence<N>{});
734 namespace NATIVE_WIDE_DETAIL {
735 using namespace ::native::detail;
749 template<
class... A> hint_inline
constexpr auto adl_abs(A
const &... a)
750 noexcept(
noexcept(abs(a...))) ->
decltype(abs(a...)) {
return abs(a...); }
751 template<
class... A> hint_inline
constexpr auto adl_sqrt(A
const &... a)
752 noexcept(
noexcept(
sqrt(a...))) ->
decltype(
sqrt(a...)) {
return sqrt(a...); }
753 template<
class... A> hint_inline
constexpr auto adl_fma(A
const &... a)
754 noexcept(
noexcept(
fma(a...))) ->
decltype(
fma(a...)) {
return fma(a...); }
755 template<
class... A> hint_inline
constexpr auto adl_sin(A
const &... a)
756 noexcept(
noexcept(sin(a...))) ->
decltype(sin(a...)) {
return sin(a...); }
757 template<
class... A> hint_inline
constexpr auto adl_cos(A
const &... a)
758 noexcept(
noexcept(cos(a...))) ->
decltype(cos(a...)) {
return cos(a...); }
759 template<
class... A> hint_inline
constexpr auto adl_expm1(A
const &... a)
760 noexcept(
noexcept(expm1(a...))) ->
decltype(expm1(a...)) {
return expm1(a...); }
761 template<
class... A> hint_inline
constexpr auto adl_damping_gain(A
const &... a)
762 noexcept(
noexcept(damping_gain(a...))) ->
decltype(damping_gain(a...)) {
return damping_gain(a...); }
763 template<
class... A> hint_inline
constexpr auto adl_log(A
const &... a)
764 noexcept(
noexcept(log(a...))) ->
decltype(log(a...)) {
return log(a...); }
765 template<
class... A> hint_inline
constexpr auto adl_log2(A
const &... a)
766 noexcept(
noexcept(log2(a...))) ->
decltype(log2(a...)) {
return log2(a...); }
767 template<
class... A> hint_inline
constexpr auto adl_log1p(A
const &... a)
768 noexcept(
noexcept(log1p(a...))) ->
decltype(log1p(a...)) {
return log1p(a...); }
769 template<
class... A> hint_inline
constexpr auto adl_atan2(A
const &... a)
770 noexcept(
noexcept(
atan2(a...))) ->
decltype(
atan2(a...)) {
return atan2(a...); }
771 template<
class... A> hint_inline
constexpr auto adl_tanh(A
const &... a)
772 noexcept(
noexcept(tanh(a...))) ->
decltype(tanh(a...)) {
return tanh(a...); }
773 template<
bool Flush,
unsigned Degree,
class A>
774 requires requires(A
const & a) { exp(a,std::bool_constant<Flush>{},std::integral_constant<unsigned,Degree>{}); }
775 hint_inline
constexpr auto adl_exp(A
const & a)
776 noexcept(
noexcept(exp(a,std::bool_constant<Flush>{},std::integral_constant<unsigned,Degree>{})))
777 ->
decltype(exp(a,std::bool_constant<Flush>{},std::integral_constant<unsigned,Degree>{})) {
778 return exp(a,std::bool_constant<Flush>{},std::integral_constant<unsigned,Degree>{});
780 template<
bool Flush,
unsigned Degree,
class A>
781 requires (Degree == 6) &&
782 (!
requires(A
const & a) { exp(a,std::bool_constant<Flush>{},std::integral_constant<unsigned,Degree>{}); }) &&
783 requires(A
const & a) { exp(a,std::bool_constant<Flush>{}); }
784 hint_inline
constexpr auto adl_exp(A
const & a)
785 noexcept(
noexcept(exp(a,std::bool_constant<Flush>{}))) ->
decltype(exp(a,std::bool_constant<Flush>{})) {
786 return exp(a,std::bool_constant<Flush>{});
788 template<
bool Flush,
unsigned Degree,
class A>
789 requires (!Flush && Degree == 6) &&
790 (!
requires(A
const & a) { exp(a,std::bool_constant<Flush>{},std::integral_constant<unsigned,Degree>{}); }) &&
791 (!
requires(A
const & a) { exp(a,std::bool_constant<Flush>{}); })
792 hint_inline
constexpr auto adl_exp(A
const & a)
noexcept(
noexcept(exp(a))) ->
decltype(exp(a)) {
return exp(a); }
793 template<
bool Flush,
class A>
requires requires(A
const & a) {
exp2(a,std::bool_constant<Flush>{}); }
794 hint_inline
constexpr auto adl_exp2(A
const & a)
noexcept(
noexcept(
exp2(a,std::bool_constant<Flush>{}))) ->
decltype(
exp2(a,std::bool_constant<Flush>{})) {
return exp2(a,std::bool_constant<Flush>{}); }
795 template<
bool Flush,
class A>
requires (!Flush) && (!
requires(A
const & a) {
exp2(a,std::bool_constant<Flush>{}); })
796 hint_inline
constexpr auto adl_exp2(A
const & a)
noexcept(
noexcept(
exp2(a))) ->
decltype(
exp2(a)) {
return exp2(a); }
797 template<
class A> hint_inline
constexpr auto adl_sincos(A
const & a)
799 template<
class M,
class T> hint_inline
constexpr auto adl_select(M
const & m,T
const & a,T
const & b)
800 noexcept(
noexcept(select(m,a,b))) ->
decltype(select(m,a,b)) {
return select(m,a,b); }
802 namespace NATIVE_WIDE_DETAIL {
803 using namespace ::native::detail;
805 template<
class T>
requires std::is_arithmetic_v<T>
806 hint_inline
constexpr auto isfinite(T
const & x)
807 noexcept(
noexcept(std::isfinite(x))) ->
decltype(std::isfinite(x)) {
return std::isfinite(x); }
808 template<
class T>
requires std::is_arithmetic_v<T>
809 hint_inline
constexpr auto isinf(T
const & x)
810 noexcept(
noexcept(std::isinf(x))) ->
decltype(std::isinf(x)) {
return std::isinf(x); }
811 template<
class T>
requires std::is_arithmetic_v<T>
812 hint_inline
constexpr auto isnan(T
const & x)
814 template<
class T>
requires std::is_arithmetic_v<T>
815 hint_inline
constexpr auto signbit(T
const & x)
816 noexcept(
noexcept(std::signbit(x))) ->
decltype(std::signbit(x)) {
return std::signbit(x); }
817 template<
class T>
requires std::is_arithmetic_v<T>
818 hint_inline
constexpr auto copysign(T
const & x,T
const & y)
819 noexcept(
noexcept(std::copysign(x,y))) ->
decltype(std::copysign(x,y)) {
return std::copysign(x,y); }
820 template<
class T>
requires std::is_floating_point_v<T>
821 hint_inline
constexpr auto floor(T
const & x)
822 noexcept(
noexcept(std::floor(x))) ->
decltype(std::floor(x)) {
return std::floor(x); }
824 template<
class T> hint_inline
constexpr auto operator()(T
const & x)
const
825 noexcept(
noexcept(floor(x))) ->
decltype(floor(x)) {
return floor(x); }
827 template<
class T>
requires std::is_floating_point_v<T>
828 hint_inline
constexpr auto ceil(T
const & x)
829 noexcept(
noexcept(std::ceil(x))) ->
decltype(std::ceil(x)) {
return std::ceil(x); }
831 template<
class T> hint_inline
constexpr auto operator()(T
const & x)
const
832 noexcept(
noexcept(ceil(x))) ->
decltype(ceil(x)) {
return ceil(x); }
834 template<
class T>
requires std::is_floating_point_v<T>
835 hint_inline
constexpr auto trunc(T
const & x)
836 noexcept(
noexcept(std::trunc(x))) ->
decltype(std::trunc(x)) {
return std::trunc(x); }
838 template<
class T> hint_inline
constexpr auto operator()(T
const & x)
const
839 noexcept(
noexcept(trunc(x))) ->
decltype(trunc(x)) {
return trunc(x); }
841 struct wide_isfinite {
842 template<
class... T> hint_inline
constexpr auto operator()(T
const &... x)
const
843 noexcept(
noexcept(isfinite(x...))) ->
decltype(isfinite(x...)) {
return isfinite(x...); }
846 template<
class... T> hint_inline
constexpr auto operator()(T
const &... x)
const
847 noexcept(
noexcept(isinf(x...))) ->
decltype(isinf(x...)) {
return isinf(x...); }
850 template<
class... T> hint_inline
constexpr auto operator()(T
const &... x)
const
851 noexcept(
noexcept(
isnan(x...))) ->
decltype(
isnan(x...)) {
return isnan(x...); }
853 struct wide_signbit {
854 template<
class... T> hint_inline
constexpr auto operator()(T
const &... x)
const
855 noexcept(
noexcept(signbit(x...))) ->
decltype(signbit(x...)) {
return signbit(x...); }
857 struct wide_copysign {
858 template<
class... T> hint_inline
constexpr auto operator()(T
const &... x)
const
859 noexcept(
noexcept(copysign(x...))) ->
decltype(copysign(x...)) {
return copysign(x...); }
861 template<
class F,
class... T>
862 using wide_result = std::remove_cvref_t<std::invoke_result_t<F,T
const &...>>;
863 template<std::size_t N,
class F,
class... T>
concept wide_value_operation =
864 std::invocable<F,T
const &...> && std::is_object_v<wide_result<F,T...>> &&
865 std::is_move_constructible_v<std::array<wide_result<F,T...>,N>> &&
866 (N == 0 ||
requires(T
const &... x) { std::array<wide_result<F,T...>,1>{F{}(x...)}; });
870 template<
class F,
class T,std::
size_t N>
requires wide_value_operation<N,F,T>
871 hint_inline
constexpr auto wide_map(wide<T,N>
const & input)
873 if constexpr (N == 0)
return true;
874 else return noexcept(wide<wide_result<F,T>,1>{
875 std::array<wide_result<F,T>,1>{F{}(std::declval<T const &>())}});
877 auto const & [...x] = input;
878 return wide<wide_result<F,T>,N>{std::array<wide_result<F,T>,N>{F{}(x)...}};
880 template<
class F,
class T,std::
size_t N>
requires wide_value_operation<N,F,T,T>
881 hint_inline
constexpr auto wide_map(wide<T,N>
const & a,wide<T,N>
const & b)
883 if constexpr (N == 0)
return true;
884 else return noexcept(wide<wide_result<F,T,T>,1>{
885 std::array<wide_result<F,T,T>,1>{F{}(std::declval<T const &>(),std::declval<T const &>())}});
887 auto const & [...x] = a;
888 auto const & [...y] = b;
889 return wide<wide_result<F,T,T>,N>{std::array<wide_result<F,T,T>,N>{F{}(x,y)...}};
895 template<
class T,std::
size_t N>
requires (::native::detail::wide_target<T> == NATIVE_WIDE_INDEX) && NATIVE_WIDE_DETAIL::wide_value_operation<N,NATIVE_WIDE_DETAIL::wide_isfinite,T>
897 noexcept(
noexcept(NATIVE_WIDE_DETAIL::wide_map<NATIVE_WIDE_DETAIL::wide_isfinite>(input))) {
898 return NATIVE_WIDE_DETAIL::wide_map<NATIVE_WIDE_DETAIL::wide_isfinite>(input);
902 template<
class T,std::
size_t N>
requires (::native::detail::wide_target<T> == NATIVE_WIDE_INDEX) && NATIVE_WIDE_DETAIL::wide_value_operation<N,NATIVE_WIDE_DETAIL::wide_isinf,T>
904 noexcept(
noexcept(NATIVE_WIDE_DETAIL::wide_map<NATIVE_WIDE_DETAIL::wide_isinf>(input))) {
905 return NATIVE_WIDE_DETAIL::wide_map<NATIVE_WIDE_DETAIL::wide_isinf>(input);
909 template<
class T,std::
size_t N>
requires (::native::detail::wide_target<T> == NATIVE_WIDE_INDEX) && NATIVE_WIDE_DETAIL::wide_value_operation<N,NATIVE_WIDE_DETAIL::wide_isnan,T>
911 noexcept(
noexcept(NATIVE_WIDE_DETAIL::wide_map<NATIVE_WIDE_DETAIL::wide_isnan>(input))) {
912 return NATIVE_WIDE_DETAIL::wide_map<NATIVE_WIDE_DETAIL::wide_isnan>(input);
916 template<
class T,std::
size_t N>
requires (::native::detail::wide_target<T> == NATIVE_WIDE_INDEX) && NATIVE_WIDE_DETAIL::wide_value_operation<N,NATIVE_WIDE_DETAIL::wide_signbit,T>
918 noexcept(
noexcept(NATIVE_WIDE_DETAIL::wide_map<NATIVE_WIDE_DETAIL::wide_signbit>(input))) {
919 return NATIVE_WIDE_DETAIL::wide_map<NATIVE_WIDE_DETAIL::wide_signbit>(input);
924 template<
class T,std::
size_t N>
requires (::native::detail::wide_target<T> == NATIVE_WIDE_INDEX) && NATIVE_WIDE_DETAIL::wide_value_operation<N,NATIVE_WIDE_DETAIL::wide_copysign,T,T> &&
925 std::same_as<NATIVE_WIDE_DETAIL::wide_result<NATIVE_WIDE_DETAIL::wide_copysign,T,T>,T>
927 noexcept(
noexcept(NATIVE_WIDE_DETAIL::wide_map<NATIVE_WIDE_DETAIL::wide_copysign>(a,b))) {
928 return NATIVE_WIDE_DETAIL::wide_map<NATIVE_WIDE_DETAIL::wide_copysign>(a,b);
933 template<
class T,std::
size_t N>
requires (::native::detail::wide_target<T> == NATIVE_WIDE_INDEX) && NATIVE_WIDE_DETAIL::wide_value_operation<N,NATIVE_WIDE_DETAIL::wide_floor,T> &&
934 std::same_as<NATIVE_WIDE_DETAIL::wide_result<NATIVE_WIDE_DETAIL::wide_floor,T>,T>
936 noexcept(
noexcept(NATIVE_WIDE_DETAIL::wide_map<NATIVE_WIDE_DETAIL::wide_floor>(input))) {
937 return NATIVE_WIDE_DETAIL::wide_map<NATIVE_WIDE_DETAIL::wide_floor>(input);
941 template<
class T,std::
size_t N>
requires (::native::detail::wide_target<T> == NATIVE_WIDE_INDEX) && NATIVE_WIDE_DETAIL::wide_value_operation<N,NATIVE_WIDE_DETAIL::wide_ceil,T> &&
942 std::same_as<NATIVE_WIDE_DETAIL::wide_result<NATIVE_WIDE_DETAIL::wide_ceil,T>,T>
944 noexcept(
noexcept(NATIVE_WIDE_DETAIL::wide_map<NATIVE_WIDE_DETAIL::wide_ceil>(input))) {
945 return NATIVE_WIDE_DETAIL::wide_map<NATIVE_WIDE_DETAIL::wide_ceil>(input);
949 template<
class T,std::
size_t N>
requires (::native::detail::wide_target<T> == NATIVE_WIDE_INDEX) && NATIVE_WIDE_DETAIL::wide_value_operation<N,NATIVE_WIDE_DETAIL::wide_trunc,T> &&
950 std::same_as<NATIVE_WIDE_DETAIL::wide_result<NATIVE_WIDE_DETAIL::wide_trunc,T>,T>
952 noexcept(
noexcept(NATIVE_WIDE_DETAIL::wide_map<NATIVE_WIDE_DETAIL::wide_trunc>(input))) {
953 return NATIVE_WIDE_DETAIL::wide_map<NATIVE_WIDE_DETAIL::wide_trunc>(input);
957 template<
class R,std::
size_t N>
requires (::native::detail::wide_target<R> == NATIVE_WIDE_INDEX)
963 template<
class R,std::
size_t N>
requires (::native::detail::wide_target<R> == NATIVE_WIDE_INDEX) &&
requires(R
const & x) { NATIVE_WIDE_DETAIL::adl_abs(x); }
966 if constexpr (
requires(std::array<R,N>
const & a) { NATIVE_WIDE_DETAIL::adl_abs(a); })
967 return noexcept(
wide<R,N>{NATIVE_WIDE_DETAIL::adl_abs(std::declval<std::array<R,N>
const &>())});
968 else return noexcept(
wide<R,N>()) && std::is_nothrow_move_constructible_v<
wide<R,N>> &&
969 (N == 0 ||
noexcept(std::declval<R &>() = NATIVE_WIDE_DETAIL::adl_abs(std::declval<R const &>())));
971 if constexpr (
requires { NATIVE_WIDE_DETAIL::adl_abs(input.registers); })
972 return wide<R,N>{NATIVE_WIDE_DETAIL::adl_abs(input.registers)};
975 auto & [...value] = result;
976 auto const & [...x] = input;
977 ([&] { value = NATIVE_WIDE_DETAIL::adl_abs(x); }(), ...);
984 template<
class R,std::
size_t N>
requires (::native::detail::wide_target<R> == NATIVE_WIDE_INDEX) &&
requires(R
const & x) { NATIVE_WIDE_DETAIL::adl_sqrt(x); }
987 if constexpr (
requires(std::array<R,N>
const & a) { NATIVE_WIDE_DETAIL::adl_sqrt(a); })
988 return noexcept(
wide<R,N>{NATIVE_WIDE_DETAIL::adl_sqrt(std::declval<std::array<R,N>
const &>())});
989 else return noexcept(
wide<R,N>()) && std::is_nothrow_move_constructible_v<
wide<R,N>> &&
990 (N == 0 ||
noexcept(std::declval<R &>() = NATIVE_WIDE_DETAIL::adl_sqrt(std::declval<R const &>())));
992 if constexpr (
requires { NATIVE_WIDE_DETAIL::adl_sqrt(input.registers); })
993 return wide<R,N>{NATIVE_WIDE_DETAIL::adl_sqrt(input.registers)};
996 auto & [...value] = result;
997 auto const & [...x] = input;
998 ([&] { value = NATIVE_WIDE_DETAIL::adl_sqrt(x); }(), ...);
1005 template<
class R,std::
size_t N>
requires (::native::detail::wide_target<R> == NATIVE_WIDE_INDEX) &&
requires(R
const & x) { NATIVE_WIDE_DETAIL::adl_sin(x); }
1008 if constexpr (
requires(std::array<R,N>
const & a) { NATIVE_WIDE_DETAIL::adl_sin(a); })
1009 return noexcept(
wide<R,N>{NATIVE_WIDE_DETAIL::adl_sin(std::declval<std::array<R,N>
const &>())});
1010 else return noexcept(
wide<R,N>()) && std::is_nothrow_move_constructible_v<
wide<R,N>> &&
1011 (N == 0 ||
noexcept(std::declval<R &>() = NATIVE_WIDE_DETAIL::adl_sin(std::declval<R const &>())));
1013 if constexpr (
requires { NATIVE_WIDE_DETAIL::adl_sin(input.registers); })
1014 return wide<R,N>{NATIVE_WIDE_DETAIL::adl_sin(input.registers)};
1017 auto & [...value] = result;
1018 auto const & [...x] = input;
1019 ([&] { value = NATIVE_WIDE_DETAIL::adl_sin(x); }(), ...);
1026 template<
class R,std::
size_t N>
requires (::native::detail::wide_target<R> == NATIVE_WIDE_INDEX) &&
requires(R
const & x) { NATIVE_WIDE_DETAIL::adl_cos(x); }
1029 if constexpr (
requires(std::array<R,N>
const & a) { NATIVE_WIDE_DETAIL::adl_cos(a); })
1030 return noexcept(
wide<R,N>{NATIVE_WIDE_DETAIL::adl_cos(std::declval<std::array<R,N>
const &>())});
1031 else return noexcept(
wide<R,N>()) && std::is_nothrow_move_constructible_v<
wide<R,N>> &&
1032 (N == 0 ||
noexcept(std::declval<R &>() = NATIVE_WIDE_DETAIL::adl_cos(std::declval<R const &>())));
1034 if constexpr (
requires { NATIVE_WIDE_DETAIL::adl_cos(input.registers); })
1035 return wide<R,N>{NATIVE_WIDE_DETAIL::adl_cos(input.registers)};
1038 auto & [...value] = result;
1039 auto const & [...x] = input;
1040 ([&] { value = NATIVE_WIDE_DETAIL::adl_cos(x); }(), ...);
1048 template<
bool Flush = false,
unsigned Degree = 6,
class R,std::
size_t N>
requires (Degree >= 1 && Degree <= 7) && (::native::detail::wide_target<R> == NATIVE_WIDE_INDEX) &&
requires(R
const & x) { NATIVE_WIDE_DETAIL::adl_exp<Flush,Degree>(x); }
1051 if constexpr (
requires(std::array<R,N>
const & a) { NATIVE_WIDE_DETAIL::adl_exp<Flush,Degree>(a); })
1052 return noexcept(
wide<R,N>{NATIVE_WIDE_DETAIL::adl_exp<Flush,Degree>(std::declval<std::array<R,N>
const &>())});
1053 else return noexcept(
wide<R,N>()) && std::is_nothrow_move_constructible_v<
wide<R,N>> &&
1054 (N == 0 ||
noexcept(std::declval<R &>() = NATIVE_WIDE_DETAIL::adl_exp<Flush,Degree>(std::declval<R const &>())));
1056 if constexpr (
requires { NATIVE_WIDE_DETAIL::adl_exp<Flush,Degree>(input.registers); })
1057 return wide<R,N>{NATIVE_WIDE_DETAIL::adl_exp<Flush,Degree>(input.registers)};
1060 auto & [...value] = result;
1061 auto const & [...x] = input;
1062 ([&] { value = NATIVE_WIDE_DETAIL::adl_exp<Flush,Degree>(x); }(), ...);
1069 template<
bool Flush = false,
class R,std::
size_t N>
requires (::native::detail::wide_target<R> == NATIVE_WIDE_INDEX) &&
requires(R
const & x) { NATIVE_WIDE_DETAIL::adl_exp2<Flush>(x); }
1072 if constexpr (
requires(std::array<R,N>
const & a) { NATIVE_WIDE_DETAIL::adl_exp2<Flush>(a); })
1073 return noexcept(
wide<R,N>{NATIVE_WIDE_DETAIL::adl_exp2<Flush>(std::declval<std::array<R,N>
const &>())});
1074 else return noexcept(
wide<R,N>()) && std::is_nothrow_move_constructible_v<
wide<R,N>> &&
1075 (N == 0 ||
noexcept(std::declval<R &>() = NATIVE_WIDE_DETAIL::adl_exp2<Flush>(std::declval<R const &>())));
1077 if constexpr (
requires { NATIVE_WIDE_DETAIL::adl_exp2<Flush>(input.registers); })
1078 return wide<R,N>{NATIVE_WIDE_DETAIL::adl_exp2<Flush>(input.registers)};
1081 auto & [...value] = result;
1082 auto const & [...x] = input;
1083 ([&] { value = NATIVE_WIDE_DETAIL::adl_exp2<Flush>(x); }(), ...);
1090 template<
class R,std::
size_t N>
requires (::native::detail::wide_target<R> == NATIVE_WIDE_INDEX) &&
requires(R
const & x) { NATIVE_WIDE_DETAIL::adl_expm1(x); }
1093 if constexpr (
requires(std::array<R,N>
const & a) { NATIVE_WIDE_DETAIL::adl_expm1(a); })
1094 return noexcept(
wide<R,N>{NATIVE_WIDE_DETAIL::adl_expm1(std::declval<std::array<R,N>
const &>())});
1095 else return noexcept(
wide<R,N>()) && std::is_nothrow_move_constructible_v<
wide<R,N>> &&
1096 (N == 0 ||
noexcept(std::declval<R &>() = NATIVE_WIDE_DETAIL::adl_expm1(std::declval<R const &>())));
1098 if constexpr (
requires { NATIVE_WIDE_DETAIL::adl_expm1(input.registers); })
1099 return wide<R,N>{NATIVE_WIDE_DETAIL::adl_expm1(input.registers)};
1102 auto & [...value] = result;
1103 auto const & [...x] = input;
1104 ([&] { value = NATIVE_WIDE_DETAIL::adl_expm1(x); }(), ...);
1111 template<
class R,std::
size_t N>
requires (::native::detail::wide_target<R> == NATIVE_WIDE_INDEX) &&
requires(R
const & x) { NATIVE_WIDE_DETAIL::adl_damping_gain(x); }
1114 if constexpr (
requires(std::array<R,N>
const & a) { NATIVE_WIDE_DETAIL::adl_damping_gain(a); })
1115 return noexcept(
wide<R,N>{NATIVE_WIDE_DETAIL::adl_damping_gain(std::declval<std::array<R,N>
const &>())});
1116 else return noexcept(
wide<R,N>()) && std::is_nothrow_move_constructible_v<
wide<R,N>> &&
1117 (N == 0 ||
noexcept(std::declval<R &>() = NATIVE_WIDE_DETAIL::adl_damping_gain(std::declval<R const &>())));
1119 if constexpr (
requires { NATIVE_WIDE_DETAIL::adl_damping_gain(input.registers); })
1120 return wide<R,N>{NATIVE_WIDE_DETAIL::adl_damping_gain(input.registers)};
1123 auto & [...value] = result;
1124 auto const & [...x] = input;
1125 ([&] { value = NATIVE_WIDE_DETAIL::adl_damping_gain(x); }(), ...);
1132 template<
class R,std::
size_t N>
requires (::native::detail::wide_target<R> == NATIVE_WIDE_INDEX) &&
requires(R
const & x) { NATIVE_WIDE_DETAIL::adl_log(x); }
1135 if constexpr (
requires(std::array<R,N>
const & a) { NATIVE_WIDE_DETAIL::adl_log(a); })
1136 return noexcept(
wide<R,N>{NATIVE_WIDE_DETAIL::adl_log(std::declval<std::array<R,N>
const &>())});
1137 else return noexcept(
wide<R,N>()) && std::is_nothrow_move_constructible_v<
wide<R,N>> &&
1138 (N == 0 ||
noexcept(std::declval<R &>() = NATIVE_WIDE_DETAIL::adl_log(std::declval<R const &>())));
1140 if constexpr (
requires { NATIVE_WIDE_DETAIL::adl_log(input.registers); })
1141 return wide<R,N>{NATIVE_WIDE_DETAIL::adl_log(input.registers)};
1144 auto & [...value] = result;
1145 auto const & [...x] = input;
1146 ([&] { value = NATIVE_WIDE_DETAIL::adl_log(x); }(), ...);
1153 template<
class R,std::
size_t N>
requires (::native::detail::wide_target<R> == NATIVE_WIDE_INDEX) &&
requires(R
const & x) { NATIVE_WIDE_DETAIL::adl_log2(x); }
1156 if constexpr (
requires(std::array<R,N>
const & a) { NATIVE_WIDE_DETAIL::adl_log2(a); })
1157 return noexcept(
wide<R,N>{NATIVE_WIDE_DETAIL::adl_log2(std::declval<std::array<R,N>
const &>())});
1158 else return noexcept(
wide<R,N>()) && std::is_nothrow_move_constructible_v<
wide<R,N>> &&
1159 (N == 0 ||
noexcept(std::declval<R &>() = NATIVE_WIDE_DETAIL::adl_log2(std::declval<R const &>())));
1161 if constexpr (
requires { NATIVE_WIDE_DETAIL::adl_log2(input.registers); })
1162 return wide<R,N>{NATIVE_WIDE_DETAIL::adl_log2(input.registers)};
1165 auto & [...value] = result;
1166 auto const & [...x] = input;
1167 ([&] { value = NATIVE_WIDE_DETAIL::adl_log2(x); }(), ...);
1174 template<
class R,std::
size_t N>
requires (::native::detail::wide_target<R> == NATIVE_WIDE_INDEX) &&
requires(R
const & x) { NATIVE_WIDE_DETAIL::adl_log1p(x); }
1177 if constexpr (
requires(std::array<R,N>
const & a) { NATIVE_WIDE_DETAIL::adl_log1p(a); })
1178 return noexcept(
wide<R,N>{NATIVE_WIDE_DETAIL::adl_log1p(std::declval<std::array<R,N>
const &>())});
1179 else return noexcept(
wide<R,N>()) && std::is_nothrow_move_constructible_v<
wide<R,N>> &&
1180 (N == 0 ||
noexcept(std::declval<R &>() = NATIVE_WIDE_DETAIL::adl_log1p(std::declval<R const &>())));
1182 if constexpr (
requires { NATIVE_WIDE_DETAIL::adl_log1p(input.registers); })
1183 return wide<R,N>{NATIVE_WIDE_DETAIL::adl_log1p(input.registers)};
1186 auto & [...value] = result;
1187 auto const & [...x] = input;
1188 ([&] { value = NATIVE_WIDE_DETAIL::adl_log1p(x); }(), ...);
1195 template<
class R,std::
size_t N>
requires (::native::detail::wide_target<R> == NATIVE_WIDE_INDEX) &&
requires(R
const & x) { NATIVE_WIDE_DETAIL::adl_tanh(x); }
1198 if constexpr (
requires(std::array<R,N>
const & a) { NATIVE_WIDE_DETAIL::adl_tanh(a); })
1199 return noexcept(
wide<R,N>{NATIVE_WIDE_DETAIL::adl_tanh(std::declval<std::array<R,N>
const &>())});
1200 else return noexcept(
wide<R,N>()) && std::is_nothrow_move_constructible_v<
wide<R,N>> &&
1201 (N == 0 ||
noexcept(std::declval<R &>() = NATIVE_WIDE_DETAIL::adl_tanh(std::declval<R const &>())));
1203 if constexpr (
requires { NATIVE_WIDE_DETAIL::adl_tanh(input.registers); })
1204 return wide<R,N>{NATIVE_WIDE_DETAIL::adl_tanh(input.registers)};
1207 auto & [...value] = result;
1208 auto const & [...x] = input;
1209 ([&] { value = NATIVE_WIDE_DETAIL::adl_tanh(x); }(), ...);
1216 template<
class R,std::
size_t N>
requires (::native::detail::wide_target<R> == NATIVE_WIDE_INDEX) &&
requires(R
const & x) { NATIVE_WIDE_DETAIL::adl_atan2(x,x); }
1219 if constexpr (
requires(std::array<R,N>
const & a) { NATIVE_WIDE_DETAIL::adl_atan2(a,a); })
1220 return noexcept(
wide<R,N>{NATIVE_WIDE_DETAIL::adl_atan2(std::declval<std::array<R,N>
const &>(),
1221 std::declval<std::array<R,N>
const &>())});
1222 else return noexcept(
wide<R,N>()) && std::is_nothrow_move_constructible_v<
wide<R,N>> &&
1223 (N == 0 ||
noexcept(std::declval<R &>() = NATIVE_WIDE_DETAIL::adl_atan2(
1224 std::declval<R const &>(),std::declval<R const &>())));
1226 if constexpr (
requires { NATIVE_WIDE_DETAIL::adl_atan2(y.registers,x.registers); })
1227 return wide<R,N>{NATIVE_WIDE_DETAIL::adl_atan2(y.registers,x.registers)};
1230 auto & [...value] = result;
1231 auto const & [...a] = y;
1232 auto const & [...b] = x;
1233 ([&] { value = NATIVE_WIDE_DETAIL::adl_atan2(a,b); }(), ...);
1240 template<
class R,std::
size_t N>
requires (::native::detail::wide_target<R> == NATIVE_WIDE_INDEX) &&
requires(R
const & x) { NATIVE_WIDE_DETAIL::adl_fma(x,x,x); }
1243 if constexpr (
requires(std::array<R,N>
const & x) { NATIVE_WIDE_DETAIL::adl_fma(x,x,x); })
1244 return noexcept(
wide<R,N>{NATIVE_WIDE_DETAIL::adl_fma(std::declval<std::array<R,N>
const &>(),
1245 std::declval<std::array<R,N>
const &>(),std::declval<std::array<R,N>
const &>())});
1246 else return noexcept(
wide<R,N>()) && std::is_nothrow_move_constructible_v<
wide<R,N>> &&
1247 (N == 0 ||
noexcept(std::declval<R &>() = NATIVE_WIDE_DETAIL::adl_fma(
1248 std::declval<R const &>(),std::declval<R const &>(),std::declval<R const &>())));
1250 if constexpr (
requires { NATIVE_WIDE_DETAIL::adl_fma(a.registers,b.registers,c.registers); })
1251 return wide<R,N>{NATIVE_WIDE_DETAIL::adl_fma(a.registers,b.registers,c.registers)};
1254 auto & [...value] = result;
1255 auto const & [...x] = a;
1256 auto const & [...y] = b;
1257 auto const & [...z] = c;
1258 ([&] { value = NATIVE_WIDE_DETAIL::adl_fma(x,y,z); }(), ...);
1265 template<
class R,std::
size_t N>
requires (::native::detail::wide_target<R> == NATIVE_WIDE_INDEX) &&
requires(R
const & x) { NATIVE_WIDE_DETAIL::adl_sincos(x); }
1268 if constexpr (
requires(std::array<R,N>
const & x) { NATIVE_WIDE_DETAIL::adl_sincos(x); })
1269 return noexcept(NATIVE_WIDE_DETAIL::adl_sincos(std::declval<std::array<R,N>
const &>())) &&
1270 std::is_nothrow_move_constructible_v<std::array<R,N>>;
1271 else return noexcept(
wide<R,N>()) && std::is_nothrow_move_constructible_v<
wide<R,N>> &&
1272 (N == 0 || (
noexcept(NATIVE_WIDE_DETAIL::adl_sincos(std::declval<R const &>())) &&
noexcept(std::declval<R &>() = std::declval<
decltype(NATIVE_WIDE_DETAIL::adl_sincos(std::declval<R const &>())) &>().first) &&
1273 noexcept(std::declval<R &>() = std::declval<
decltype(NATIVE_WIDE_DETAIL::adl_sincos(std::declval<R const &>())) &>().second)));
1275 if constexpr (
requires { NATIVE_WIDE_DETAIL::adl_sincos(input.registers); }) {
1276 auto [sine,cosine] = NATIVE_WIDE_DETAIL::adl_sincos(input.registers);
1280 auto & [...s] = sine;
1281 auto & [...c] = cosine;
1282 auto const & [...x] = input;
1283 ([&] {
auto pair = NATIVE_WIDE_DETAIL::adl_sincos(x); s = pair.first; c = pair.second; }(), ...);
1284 return std::pair{std::move(sine),std::move(cosine)};
1289 template <
class R, std::
size_t N>
requires (::native::detail::wide_target<R> == NATIVE_WIDE_INDEX)
1293 if constexpr (N == 0)
1294 return noexcept(
wide<R,N>()) && std::is_nothrow_move_constructible_v<wide<R,N>>;
1295 else if constexpr (std::is_same_v<
decltype(R{} == R{}),
bool>)
1296 return noexcept(
wide<R,N>()) && std::is_nothrow_move_constructible_v<wide<R,N>> &&
1297 noexcept(std::declval<R &>() = std::declval<R const &>());
1300 noexcept(std::declval<R &>() = NATIVE_WIDE_DETAIL::adl_select(
1301 std::declval<
decltype(R{} == R{})
const &>(),
1302 std::declval<R const &>(), std::declval<R const &>()));
1305 auto & [...value] = result;
1306 auto const & [...mask] = masks;
1307 auto const & [...x] = a;
1308 auto const & [...y] = b;
1309 if constexpr (std::is_same_v<
decltype(R{} == R{}),
bool>)
1310 ([&] { value =
mask ? x : y; }(), ...);
1312 ([&] { value = NATIVE_WIDE_DETAIL::adl_select(
mask, x, y); }(), ...);
1316#undef NATIVE_WIDE_DETAIL
1317#undef NATIVE_WIDE_INDEX
1319#if defined(__x86_64__) || defined(_M_X64)
1320#define NATIVE_WIDE_INDEX 10
1321#define NATIVE_WIDE_DETAIL detail::wide_avx2_detail
1322#pragma clang attribute push(__attribute__((target(NATIVE_KERNEL_TARGET_1))), apply_to=function)
1324#pragma clang attribute pop
1325#undef NATIVE_WIDE_DETAIL
1326#undef NATIVE_WIDE_INDEX
1329#if defined(__x86_64__) || defined(_M_X64)
1330#define NATIVE_WIDE_INDEX 9
1331#define NATIVE_WIDE_DETAIL detail::wide_avx512_base_detail
1332#pragma clang attribute push(__attribute__((target(NATIVE_KERNEL_TARGET_2))), apply_to=function)
1334#pragma clang attribute pop
1335#undef NATIVE_WIDE_DETAIL
1336#undef NATIVE_WIDE_INDEX
1339#if defined(__x86_64__) || defined(_M_X64)
1340#define NATIVE_WIDE_INDEX 7
1341#define NATIVE_WIDE_DETAIL detail::wide_avx512_bw_detail
1342#pragma clang attribute push(__attribute__((target(NATIVE_KERNEL_TARGET_3))), apply_to=function)
1344#pragma clang attribute pop
1345#undef NATIVE_WIDE_DETAIL
1346#undef NATIVE_WIDE_INDEX
1349#if defined(__x86_64__) || defined(_M_X64)
1350#define NATIVE_WIDE_INDEX 8
1351#define NATIVE_WIDE_DETAIL detail::wide_avx512_vl_detail
1352#pragma clang attribute push(__attribute__((target(NATIVE_KERNEL_TARGET_4))), apply_to=function)
1354#pragma clang attribute pop
1355#undef NATIVE_WIDE_DETAIL
1356#undef NATIVE_WIDE_INDEX
1359#if defined(__x86_64__) || defined(_M_X64)
1360#define NATIVE_WIDE_INDEX 3
1361#define NATIVE_WIDE_DETAIL detail::wide_avx512_bw_vl_detail
1362#pragma clang attribute push(__attribute__((target(NATIVE_KERNEL_TARGET_5))), apply_to=function)
1364#pragma clang attribute pop
1365#undef NATIVE_WIDE_DETAIL
1366#undef NATIVE_WIDE_INDEX
1369#if defined(__x86_64__) || defined(_M_X64)
1370#define NATIVE_WIDE_INDEX 5
1371#define NATIVE_WIDE_DETAIL detail::wide_avx512_bw_bf16_detail
1372#pragma clang attribute push(__attribute__((target(NATIVE_KERNEL_TARGET_7))), apply_to=function)
1374#pragma clang attribute pop
1375#undef NATIVE_WIDE_DETAIL
1376#undef NATIVE_WIDE_INDEX
1379#if defined(__x86_64__) || defined(_M_X64)
1380#define NATIVE_WIDE_INDEX 1
1381#define NATIVE_WIDE_DETAIL detail::wide_avx512_bw_vl_bf16_detail
1382#pragma clang attribute push(__attribute__((target(NATIVE_KERNEL_TARGET_9))), apply_to=function)
1384#pragma clang attribute pop
1385#undef NATIVE_WIDE_DETAIL
1386#undef NATIVE_WIDE_INDEX
1389#if defined(__x86_64__) || defined(_M_X64)
1390#define NATIVE_WIDE_INDEX 6
1391#define NATIVE_WIDE_DETAIL detail::wide_avx512_bw_fp16_detail
1392#pragma clang attribute push(__attribute__((target(NATIVE_KERNEL_TARGET_11))), apply_to=function)
1394#pragma clang attribute pop
1395#undef NATIVE_WIDE_DETAIL
1396#undef NATIVE_WIDE_INDEX
1399#if defined(__x86_64__) || defined(_M_X64)
1400#define NATIVE_WIDE_INDEX 2
1401#define NATIVE_WIDE_DETAIL detail::wide_avx512_bw_vl_fp16_detail
1402#pragma clang attribute push(__attribute__((target(NATIVE_KERNEL_TARGET_13))), apply_to=function)
1404#pragma clang attribute pop
1405#undef NATIVE_WIDE_DETAIL
1406#undef NATIVE_WIDE_INDEX
1409#if defined(__x86_64__) || defined(_M_X64)
1410#define NATIVE_WIDE_INDEX 4
1411#define NATIVE_WIDE_DETAIL detail::wide_avx512_bw_bf16_fp16_detail
1412#pragma clang attribute push(__attribute__((target(NATIVE_KERNEL_TARGET_15))), apply_to=function)
1414#pragma clang attribute pop
1415#undef NATIVE_WIDE_DETAIL
1416#undef NATIVE_WIDE_INDEX
1419#if defined(__x86_64__) || defined(_M_X64)
1420#define NATIVE_WIDE_INDEX 0
1421#define NATIVE_WIDE_DETAIL detail::wide_avx512_bw_vl_bf16_fp16_detail
1422#pragma clang attribute push(__attribute__((target(NATIVE_KERNEL_TARGET_17))), apply_to=function)
1424#pragma clang attribute pop
1425#undef NATIVE_WIDE_DETAIL
1426#undef NATIVE_WIDE_INDEX
1429#if defined(__aarch64__) || defined(_M_ARM64)
1430#define NATIVE_WIDE_INDEX 14
1431#define NATIVE_WIDE_DETAIL detail::wide_neon_detail
1432#pragma clang attribute push(__attribute__((target(NATIVE_KERNEL_TARGET_20))), apply_to=function)
1434#pragma clang attribute pop
1435#undef NATIVE_WIDE_DETAIL
1436#undef NATIVE_WIDE_INDEX
1439#if defined(__aarch64__) || defined(_M_ARM64)
1440#define NATIVE_WIDE_INDEX 12
1441#define NATIVE_WIDE_DETAIL detail::wide_neon_bf16_detail
1442#pragma clang attribute push(__attribute__((target(NATIVE_KERNEL_TARGET_21))), apply_to=function)
1444#pragma clang attribute pop
1445#undef NATIVE_WIDE_DETAIL
1446#undef NATIVE_WIDE_INDEX
1449#if defined(__aarch64__) || defined(_M_ARM64)
1450#define NATIVE_WIDE_INDEX 13
1451#define NATIVE_WIDE_DETAIL detail::wide_neon_fp16_detail
1452#pragma clang attribute push(__attribute__((target(NATIVE_KERNEL_TARGET_22))), apply_to=function)
1454#pragma clang attribute pop
1455#undef NATIVE_WIDE_DETAIL
1456#undef NATIVE_WIDE_INDEX
1459#if defined(__aarch64__) || defined(_M_ARM64)
1460#define NATIVE_WIDE_INDEX 11
1461#define NATIVE_WIDE_DETAIL detail::wide_neon_half_detail
1462#pragma clang attribute push(__attribute__((target(NATIVE_KERNEL_TARGET_23))), apply_to=function)
1464#pragma clang attribute pop
1465#undef NATIVE_WIDE_DETAIL
1466#undef NATIVE_WIDE_INDEX
1470#define NATIVE_WIDE_INDEX 16
1471#define NATIVE_WIDE_DETAIL detail::wide_wasm_detail
1472#pragma clang attribute push(__attribute__((target(NATIVE_KERNEL_TARGET_WASM))), apply_to=function)
1474#pragma clang attribute pop
1475#undef NATIVE_WIDE_DETAIL
1476#undef NATIVE_WIDE_INDEX
1483 using ::std::tuple_size;
1484 using ::std::tuple_element;
1486 template<
class T,
size_t N>
1487 struct tuple_size<::
native::wide<T, N>> : integral_constant<size_t, N> {};
1488 template<
size_t I,
class T,
size_t N>
1489 struct tuple_element<I, ::
native::wide<T, N>> : tuple_element<I, array<T, N>> {};
1491namespace wide::detail {
1494 template<
class T,std::
size_t N>
struct shape<::
native::wide<T,N>> : array_shape<T,N> {
1495 static constexpr auto kind=family::legacy;
1496 template<
class R>
using rebind=::native::wide<R,N>;
1499 template<
class R>
requires (::native::detail::wide_target<R> == 16)
1500 hint_target(
"simd128")
static inline constexpr rebind<R> restore(std::array<R,N>
const & values) {
1501 return rebind<R>{values};
typename mask_traits< std::remove_cvref_t< T > >::type mask
constexpr simd< float, L, Arch > atan2(simd< float, L, Arch > y, simd< float, L, Arch > x) noexcept
constexpr simd< float, N, Arch > ceil(simd< float, N, Arch > x) noexcept
constexpr simd< float, L, Arch > exp2(simd< float, L, Arch > input) noexcept
constexpr auto abs(simd< float, N, Arch > a) noexcept
constexpr simd< float, N, Arch > trunc(simd< float, N, Arch > x) noexcept
constexpr simd< float, L, Arch > exp(simd< float, L, Arch > input) noexcept
Evaluate the binary32 range-reduced exponential approximation. Degree selects a polynomial from one t...
constexpr simd< float, N, Arch > floor(simd< float, N, Arch > x) noexcept
constexpr wide< T, N > copysign(wide< T, N > const &a, wide< T, N > const &b) noexcept(noexcept(detail::wide_generic_detail::wide_map< detail::wide_generic_detail::wide_copysign >(a, b)))
constexpr auto operator!(wide< T, N > const &a)
constexpr wide< R, N > cos(wide< R, N > const &input) noexcept([] { if constexpr(requires(std::array< R, N > const &a) { detail::wide_generic_detail::adl_cos(a);}) return noexcept(wide< R, N >{detail::wide_generic_detail::adl_cos(std::declval< std::array< R, N > const & >())});else return noexcept(wide< R, N >()) &&std::is_nothrow_move_constructible_v< wide< R, N > > &&(N==0||noexcept(std::declval< R & >()=detail::wide_generic_detail::adl_cos(std::declval< R const & >())));}())
constexpr auto operator~(wide< T, N > const &a)
constexpr wide< R, N > tanh(wide< R, N > const &input) noexcept([] { if constexpr(requires(std::array< R, N > const &a) { detail::wide_generic_detail::adl_tanh(a);}) return noexcept(wide< R, N >{detail::wide_generic_detail::adl_tanh(std::declval< std::array< R, N > const & >())});else return noexcept(wide< R, N >()) &&std::is_nothrow_move_constructible_v< wide< R, N > > &&(N==0||noexcept(std::declval< R & >()=detail::wide_generic_detail::adl_tanh(std::declval< R const & >())));}())
constexpr auto isnan(wide< T, N > const &input) noexcept(noexcept(detail::wide_generic_detail::wide_map< detail::wide_generic_detail::wide_isnan >(input)))
constexpr wide< R, N > sin(wide< R, N > const &input) noexcept([] { if constexpr(requires(std::array< R, N > const &a) { detail::wide_generic_detail::adl_sin(a);}) return noexcept(wide< R, N >{detail::wide_generic_detail::adl_sin(std::declval< std::array< R, N > const & >())});else return noexcept(wide< R, N >()) &&std::is_nothrow_move_constructible_v< wide< R, N > > &&(N==0||noexcept(std::declval< R & >()=detail::wide_generic_detail::adl_sin(std::declval< R const & >())));}())
constexpr wide< R, N > log(wide< R, N > const &input) noexcept([] { if constexpr(requires(std::array< R, N > const &a) { detail::wide_generic_detail::adl_log(a);}) return noexcept(wide< R, N >{detail::wide_generic_detail::adl_log(std::declval< std::array< R, N > const & >())});else return noexcept(wide< R, N >()) &&std::is_nothrow_move_constructible_v< wide< R, N > > &&(N==0||noexcept(std::declval< R & >()=detail::wide_generic_detail::adl_log(std::declval< R const & >())));}())
constexpr wide< R, N > log2(wide< R, N > const &input) noexcept([] { if constexpr(requires(std::array< R, N > const &a) { detail::wide_generic_detail::adl_log2(a);}) return noexcept(wide< R, N >{detail::wide_generic_detail::adl_log2(std::declval< std::array< R, N > const & >())});else return noexcept(wide< R, N >()) &&std::is_nothrow_move_constructible_v< wide< R, N > > &&(N==0||noexcept(std::declval< R & >()=detail::wide_generic_detail::adl_log2(std::declval< R const & >())));}())
constexpr wide< R, N > damping_gain(wide< R, N > const &input) noexcept([] { if constexpr(requires(std::array< R, N > const &a) { detail::wide_generic_detail::adl_damping_gain(a);}) return noexcept(wide< R, N >{detail::wide_generic_detail::adl_damping_gain(std::declval< std::array< R, N > const & >())});else return noexcept(wide< R, N >()) &&std::is_nothrow_move_constructible_v< wide< R, N > > &&(N==0||noexcept(std::declval< R & >()=detail::wide_generic_detail::adl_damping_gain(std::declval< R const & >())));}())
constexpr auto isfinite(wide< T, N > const &input) noexcept(noexcept(detail::wide_generic_detail::wide_map< detail::wide_generic_detail::wide_isfinite >(input)))
constexpr wide< R, N > expm1(wide< R, N > const &input) noexcept([] { if constexpr(requires(std::array< R, N > const &a) { detail::wide_generic_detail::adl_expm1(a);}) return noexcept(wide< R, N >{detail::wide_generic_detail::adl_expm1(std::declval< std::array< R, N > const & >())});else return noexcept(wide< R, N >()) &&std::is_nothrow_move_constructible_v< wide< R, N > > &&(N==0||noexcept(std::declval< R & >()=detail::wide_generic_detail::adl_expm1(std::declval< R const & >())));}())
constexpr wide< R, N > log1p(wide< R, N > const &input) noexcept([] { if constexpr(requires(std::array< R, N > const &a) { detail::wide_generic_detail::adl_log1p(a);}) return noexcept(wide< R, N >{detail::wide_generic_detail::adl_log1p(std::declval< std::array< R, N > const & >())});else return noexcept(wide< R, N >()) &&std::is_nothrow_move_constructible_v< wide< R, N > > &&(N==0||noexcept(std::declval< R & >()=detail::wide_generic_detail::adl_log1p(std::declval< R const & >())));}())
constexpr auto isinf(wide< T, N > const &input) noexcept(noexcept(detail::wide_generic_detail::wide_map< detail::wide_generic_detail::wide_isinf >(input)))
constexpr auto signbit(wide< T, N > const &input) noexcept(noexcept(detail::wide_generic_detail::wide_map< detail::wide_generic_detail::wide_signbit >(input)))
Architecture-tagged vectors, register packs and supporting value types. Native arithmetic follows its...
void operator%=(simd< T, N, A > &, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
void operator-(simd< T, N, A >, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
constexpr auto sincos(simd< float, L, A > input) noexcept
Paired sine/cosine preserving the permitted logical lane shape.
constexpr simd< T, N, A > sqrt(simd< T, N, A > v) noexcept
Compute correctly rounded square roots; negative finite lanes produce NaN.
void operator/(simd< T, N, A >, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
void operator>>=(simd< T, N, A > &, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
void operator>>(simd< T, N, A >, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
wide(T, U...) -> wide< T, 1+sizeof...(U)>
Deduce the common element type and the number of homogeneous constructor arguments.
void operator*=(simd< T, N, A > &, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
void operator==(simd< T, N, A >, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
void operator%(simd< T, N, A >, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
void operator>=(simd< T, N, A >, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
void operator>(simd< T, N, A >, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
void operator&=(simd< T, N, A > &, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
constexpr simd< T, N, A > broadcast(simd< T, N, A > value, imm_t< I >) noexcept
Broadcast one compile-time-selected logical lane.
void operator/=(simd< T, N, A > &, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
void operator|(simd< T, N, A >, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
void operator+=(simd< T, N, A > &, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
void operator*(simd< T, N, A >, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
void operator-=(simd< T, N, A > &, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
constexpr simd< fp16, 32, Arch > fma(simd< fp16, 32, Arch > a, simd< fp16, 32, Arch > b, simd< fp16, 32, Arch > c) noexcept
void operator<=(simd< T, N, A >, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
void operator^=(simd< T, N, A > &, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
void operator<<(simd< T, N, A >, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
void operator&(simd< T, N, A >, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
void operator^(simd< T, N, A >, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
void operator+(simd< T, N, A >, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
constexpr simd< T, N, A > select(M mask, simd< T, N, A > a, simd< T, N, A > b) noexcept
Bridge a matching compact mask to native half's existing vector-mask selection.
void operator!=(simd< T, N, A >, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
void operator<(simd< T, N, A >, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
void operator|=(simd< T, N, A > &, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
void operator<<=(simd< T, N, A > &, simd< U, M, B >)=delete
Reject mixed architectures and mismatched short-vector widths before native conversions can participa...
Standard-library adaptations documented here for SIMD value types.
constexpr bool isnan(::native::fp16 x) noexcept
Classify the stored bits as NaN without performing a floating-point conversion.
Own N values of T, including an empty pack when N == 0. registers is the underlying array....
constexpr wide(U const &value) noexcept(std::is_nothrow_constructible_v< T, U const & > &&(N==0||std::is_nothrow_copy_constructible_v< T >))
Convert one value to T, then copy it across the pack.
constexpr decltype(auto) apply(F &&f) noexcept(noexcept(std::apply(std::forward< F >(f), registers)))
Invoke f with all elements as arguments; the empty pack calls f().
constexpr T const & get() const &noexcept
Access element I, preserving constness and the value category of the pack.
constexpr decltype(auto) apply(F &&f) const noexcept(noexcept(std::apply(std::forward< F >(f), registers)))
Invoke f with all elements as arguments; the empty pack calls f().
static constexpr wide broadcast(T const &value) noexcept(N==0||std::is_nothrow_copy_constructible_v< T >)
Copy value to every element; an empty pack makes no copies.
constexpr T & get() &noexcept
Access element I, preserving constness and the value category of the pack.
constexpr T const && get() const &&noexcept
Access element I, preserving constness and the value category of the pack.
constexpr T && get() &&noexcept
Access element I, preserving constness and the value category of the pack.
constexpr wide(wide< U, N > const &source) noexcept(N==0||std::is_nothrow_constructible_v< T, U const & >)
Convert each element of a same-size pack; explicitness follows the element conversion.
constexpr wide() noexcept(std::is_nothrow_default_constructible_v< std::array< T, N > >)
Retain opted-in array initialization in the element's target scope.
constexpr wide()=default
Default-initialize the underlying array. Use wide{} for value initialization.
constexpr wide(std::array< T, N > values) noexcept(std::is_nothrow_move_constructible_v< std::array< T, N > >)
Take an array of exactly the pack extent.
constexpr wide(U &&... values) noexcept((std::is_nothrow_constructible_v< T, U && > &&...))
Construct one element from each argument, preserving argument order.
constexpr wide(wide< U, N > &&source) noexcept(N==0||std::is_nothrow_constructible_v< T, U && >)
Convert each element of a same-size pack; explicitness follows the element conversion.