7#include "native_simd_utility.hpp"
8#include "../utility/utility.hpp"
9#include "../macros.hpp"
16namespace hi {
inline namespace v1 {
37struct native_simd<
double,4> {
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 :
79 void store(value_type *out)
const noexcept
81 hi_axiom_not_null(out);
87 void store(
void *out)
const noexcept
89 hi_axiom_not_null(out);
93 [[
nodiscard]]
explicit native_simd(std::span<value_type const>
other)
noexcept
95 hi_axiom(
other.size() >= size);
99 void store(std::span<value_type> out)
const noexcept
101 hi_axiom(out.size() >= size);
109 auto r = array_type{};
162 return native_simd{
ones};
168 hi_axiom(a <= 0b1111);
198 [[
nodiscard]]
friend bool equal(native_simd a, native_simd b)
noexcept
213 return almost_eq(a, b, epsilon).mask() == 0b1111;
216 [[
nodiscard]]
friend native_simd operator==(native_simd a, native_simd b)
noexcept
226 [[
nodiscard]]
friend native_simd operator<(native_simd a, native_simd b)
noexcept
246 [[
nodiscard]]
friend native_simd operator+(native_simd a)
noexcept
251 [[
nodiscard]]
friend native_simd operator+(native_simd a, native_simd b)
noexcept
256 [[
nodiscard]]
friend native_simd operator-(native_simd a, native_simd b)
noexcept
261 [[
nodiscard]]
friend native_simd operator-(native_simd a)
noexcept
263 return native_simd{} - a;
266 [[
nodiscard]]
friend native_simd operator*(native_simd a, native_simd b)
noexcept
271 [[
nodiscard]]
friend native_simd operator/(native_simd a, native_simd b)
noexcept
276 [[
nodiscard]]
friend native_simd operator&(native_simd a, native_simd b)
noexcept
281 [[
nodiscard]]
friend native_simd operator|(native_simd a, native_simd b)
noexcept
286 [[
nodiscard]]
friend native_simd operator^(native_simd a, native_simd b)
noexcept
291 [[
nodiscard]]
friend native_simd operator~(native_simd a)
noexcept
296 [[
nodiscard]]
friend native_simd
min(native_simd a, native_simd b)
noexcept
301 [[
nodiscard]]
friend native_simd
max(native_simd a, native_simd b)
noexcept
306 [[
nodiscard]]
friend native_simd abs(native_simd a)
noexcept
316 [[
nodiscard]]
friend native_simd
ceil(native_simd a)
noexcept
321 template<native_rounding_mode Rounding = native_rounding_mode::current>
329 [[
nodiscard]]
friend native_simd
rcp(native_simd a)
noexcept
336 [[
nodiscard]]
friend native_simd
sqrt(native_simd a)
noexcept
358 template<
size_t Mask>
361 static_assert(
Mask <= 0b1111);
372 template<
size_t Index>
373 [[
nodiscard]]
friend native_simd insert(native_simd a, value_type b)
noexcept
375 static_assert(
Index < 4);
385 template<
size_t Index>
386 [[
nodiscard]]
friend value_type get(native_simd a)
noexcept
388 static_assert(
Index < size);
411 template<
size_t Mask>
412 [[
nodiscard]]
friend native_simd
blend(native_simd a, native_simd b)
noexcept
414 static_assert(
Mask <= 0b1111);
416 if constexpr (
Mask == 0b0000) {
418 }
else if constexpr (
Mask == 0b1111) {
437 template<fixed_
string SourceElements>
441 constexpr auto order = detail::native_swizzle_to_packed_indices<SourceElements, size>();
444 if constexpr (
order == 0b11'10'01'00) {
453 ((
order & 0b00'00'00'10) >> 1) |
454 ((
order & 0b00'00'10'00) >> 2) |
455 ((
order & 0b00'10'00'00) >> 3) |
456 ((
order & 0b10'00'00'00) >> 4);
458 (
order & 0b00'00'00'01) |
459 ((
order & 0b00'00'01'00) >> 1) |
460 ((
order & 0b00'01'00'00) >> 2) |
461 ((
order & 0b01'00'00'00) >> 3);
464 if constexpr (
order == 0b11'10'01'00) {
466 }
else if constexpr (
order == 0b00'00'00'00) {
468 }
else if constexpr (
hi_order == 0b1100) {
470 }
else if constexpr (
hi_order == 0b0011) {
473 }
else if constexpr (
hi_order == 0b1111) {
476 }
else if constexpr (
hi_order == 0b0000) {
505 template<fixed_
string SourceElements>
509 constexpr auto one_mask = detail::native_swizzle_to_mask<SourceElements, size, '1'>();
510 constexpr auto zero_mask = detail::native_swizzle_to_mask<SourceElements, size, '0'>();
598 [[
nodiscard]]
friend native_simd
not_and(native_simd a, native_simd b)
noexcept
608 template<fixed_
string SourceElements>
611 constexpr auto one_mask = detail::native_swizzle_to_mask<SourceElements, size, '1'>();
612 constexpr auto zero_mask = detail::native_swizzle_to_mask<SourceElements, size, '0'>();
624 to_bool(
one_mask & 0b0001) ? 1.0f : 0.0f,
625 to_bool(
one_mask & 0b0010) ? 1.0f : 0.0f,
626 to_bool(
one_mask & 0b0100) ? 1.0f : 0.0f,
627 to_bool(
one_mask & 0b1000) ? 1.0f : 0.0f};
@ round
The end cap of the line is round.
@ other
The gui_event does not have associated data.
DOXYGEN BUG.
Definition algorithm.hpp:16
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377