HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
native_simd_conversions_x86.hpp
1// Copyright Take Vos 2023.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
7#include "native_f32x4_sse.hpp"
8#include "native_f64x4_avx.hpp"
9#include "native_i32x4_sse2.hpp"
10#include "native_i64x4_avx2.hpp"
11#include "native_u32x4_sse2.hpp"
12#include "native_simd_utility.hpp"
13#include "../macros.hpp"
14
15namespace hi { inline namespace v1 {
16
17#ifdef HI_HAS_SSE2
18[[nodiscard]] inline native_simd<float, 4>::native_simd(native_simd<int32_t, 4> const& a) noexcept : v(_mm_cvtepi32_ps(a.v)) {}
19[[nodiscard]] inline native_simd<int32_t, 4>::native_simd(native_simd<float, 4> const& a) noexcept : v(_mm_cvtps_epi32(a.v)) {}
20[[nodiscard]] inline native_simd<int32_t, 4>::native_simd(native_simd<uint32_t, 4> const& a) noexcept : v(a.v) {}
21[[nodiscard]] inline native_simd<uint32_t, 4>::native_simd(native_simd<int32_t, 4> const& a) noexcept : v(a.v) {}
22#endif
23#ifdef HI_HAS_AVX
24[[nodiscard]] inline native_simd<float, 4>::native_simd(native_simd<double, 4> const& a) noexcept : v(_mm256_cvtpd_ps(a.v)) {}
25[[nodiscard]] inline native_simd<double, 4>::native_simd(native_simd<float, 4> const& a) noexcept : v(_mm256_cvtps_pd(a.v)) {}
26[[nodiscard]] inline native_simd<double, 4>::native_simd(native_simd<int32_t, 4> const& a) noexcept : v(_mm256_cvtepi32_pd(a.v))
27{
28}
29[[nodiscard]] inline native_simd<int32_t, 4>::native_simd(native_simd<double, 4> const& a) noexcept : v(_mm256_cvtpd_epi32(a.v))
30{
31}
32#endif
33#ifdef HI_HAS_AVX2
34[[nodiscard]] inline native_simd<int64_t, 4>::native_simd(native_simd<int32_t, 4> const& a) noexcept :
36{
37}
38[[nodiscard]] inline native_simd<int64_t, 4>::native_simd(native_simd<uint32_t, 4> const& a) noexcept :
40{
41}
42#endif
43
44
45//[[nodiscard]] inline native_f32x4 permute(native_f32x4 a, native_i32x4 const &source_elements) noexcept
46//{
47// return native_f32x4{_mm_shufflevar_ps(a.v, source_elements.v)};
48//}
49
50}} // namespace hi::v1
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