7#include "native_simd_utility.hpp"
8#include "../utility/utility.hpp"
9#include "../macros.hpp"
16namespace hi {
inline namespace v1 {
37struct native_simd<int64_t,4> {
38 using value_type = int64_t;
39 constexpr static size_t size = 4;
45 native_simd(native_simd
const&)
noexcept =
default;
70 value_type b = value_type{0},
71 value_type c = value_type{0},
72 value_type d = value_type{0})
noexcept :
82 void store(value_type *out)
const noexcept
84 hi_axiom_not_null(out);
93 void store(
void *out)
const noexcept
95 hi_axiom_not_null(out);
99 [[
nodiscard]]
explicit native_simd(std::span<value_type const>
other)
noexcept
101 hi_axiom(
other.size() >= 4);
105 void store(std::span<value_type> out)
const noexcept
107 hi_axiom(out.size() >= 4);
118 auto r = array_type{};
160 return native_simd{
ones};
165 hi_axiom(a <= 0b1111);
195 [[
nodiscard]]
friend bool equal(native_simd a, native_simd b)
noexcept
197 return (a == b).mask() == 0b1111;
200 [[
nodiscard]]
friend native_simd operator==(native_simd a, native_simd b)
noexcept
210 [[
nodiscard]]
friend native_simd operator<(native_simd a, native_simd b)
noexcept
230 [[
nodiscard]]
friend native_simd operator+(native_simd a)
noexcept
235 [[
nodiscard]]
friend native_simd operator-(native_simd a)
noexcept
237 return native_simd{} - a;
240 [[
nodiscard]]
friend native_simd operator+(native_simd a, native_simd b)
noexcept
245 [[
nodiscard]]
friend native_simd operator-(native_simd a, native_simd b)
noexcept
250 [[
nodiscard]]
friend native_simd operator&(native_simd a, native_simd b)
noexcept
255 [[
nodiscard]]
friend native_simd operator|(native_simd a, native_simd b)
noexcept
260 [[
nodiscard]]
friend native_simd operator^(native_simd a, native_simd b)
noexcept
265 [[
nodiscard]]
friend native_simd operator~(native_simd a)
noexcept
270 [[
nodiscard]]
friend native_simd operator<<(native_simd a,
unsigned int b)
noexcept
272 hi_axiom_bounds(b,
sizeof(value_type) *
CHAR_BIT);
276 [[
nodiscard]]
friend native_simd operator>>(native_simd a,
unsigned int b)
noexcept
278 hi_axiom_bounds(b,
sizeof(value_type) *
CHAR_BIT);
294 [[
nodiscard]]
friend native_simd
min(native_simd a, native_simd b)
noexcept
297 return (mask & a) |
not_and(mask, b);
300 [[
nodiscard]]
friend native_simd
max(native_simd a, native_simd b)
noexcept
303 return (mask & a) |
not_and(mask, b);
306 [[
nodiscard]]
friend native_simd abs(native_simd a)
noexcept
308 hilet mask = a >= native_simd{};
309 return (mask & a) |
not_and(mask, -a);
318 template<
size_t Mask>
321 static_assert(
Mask <= 0b1111);
333 template<
size_t Index>
334 [[
nodiscard]]
friend native_simd insert(native_simd a, value_type b)
noexcept
336 static_assert(
Index < 4);
346 template<
size_t Index>
347 [[
nodiscard]]
friend value_type get(native_simd a)
noexcept
349 static_assert(
Index < size);
362 template<
size_t Mask>
363 [[
nodiscard]]
friend native_simd
blend(native_simd a, native_simd b)
noexcept
365 static_assert(
Mask <= 0b1111);
367 if constexpr (
Mask == 0b0000) {
369 }
else if constexpr (
Mask == 0b1111) {
373 constexpr auto dmask =
374 (
Mask & 0b0001) | ((
Mask & 0b0001) << 1) |
375 ((
Mask & 0b0010) << 1) | ((
Mask & 0b0010) << 2) |
376 ((
Mask & 0b0100) << 2) | ((
Mask & 0b0100) << 3) |
377 ((
Mask & 0b1000) << 3) | ((
Mask & 0b1000) << 4);
395 template<fixed_
string SourceElements>
399 constexpr auto order = detail::native_swizzle_to_packed_indices<SourceElements, size>();
401 if constexpr (
order == 0b11'10'01'00) {
424 template<fixed_
string SourceElements>
428 constexpr auto one_mask = detail::native_swizzle_to_mask<SourceElements, size, '1'>();
429 constexpr auto zero_mask = detail::native_swizzle_to_mask<SourceElements, size, '0'>();
459 [[
nodiscard]]
friend native_simd
not_and(native_simd a, native_simd b)
noexcept
469 template<fixed_
string SourceElements>
472 constexpr auto one_mask = detail::native_swizzle_to_mask<SourceElements, size, '1'>();
473 constexpr auto zero_mask = detail::native_swizzle_to_mask<SourceElements, size, '0'>();
488 to_bool(
one_mask & 0b1000) ? 1 : 0};
@ other
The gui_event does not have associated data.
DOXYGEN BUG.
Definition algorithm.hpp:16
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
@ zero
The number was zero, and this means something in the current language.
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377