/src/WasmEdge/include/experimental/simd/ext.hpp
Line | Count | Source |
1 | | // SPDX-License-Identifier: CC0-1.0 |
2 | | /// |
3 | | // simd - A C++17 implementation of a subset of the C++26 std::simd library |
4 | | // |
5 | | // To the extent possible under law, the author(s) have dedicated all |
6 | | // copyright and related and neighboring rights to this software to the |
7 | | // public domain worldwide. This software is distributed without any warranty. |
8 | | // |
9 | | // You should have received a copy of the CC0 Public Domain Dedication |
10 | | // along with this software. If not, see |
11 | | // <http://creativecommons.org/publicdomain/zero/1.0/>. |
12 | | /// |
13 | | // Non-standard extensions. They are not part of C++26 std::simd. |
14 | | /// |
15 | | |
16 | | #pragma once |
17 | | |
18 | | #include "experimental/simd.hpp" |
19 | | |
20 | | #include <type_traits> |
21 | | |
22 | | namespace cxx26 { |
23 | | namespace simd_ext { |
24 | | |
25 | | using simd::simd_size_type; |
26 | | |
27 | | template <class T, class Abi, |
28 | | std::enable_if_t<std::is_floating_point_v<T>, int> = 0> |
29 | 0 | simd::basic_vec<T, Abi> roundeven(const simd::basic_vec<T, Abi> &X) noexcept { |
30 | 0 | return simd::detail::access::make<simd::basic_vec<T, Abi>>( |
31 | 0 | simd::detail::simd_backend<T, Abi>::roundeven( |
32 | 0 | simd::detail::access::data(X))); |
33 | 0 | } Unexecuted instantiation: _ZN5cxx268simd_ext9roundevenIfNS_4simd6detail14vector_ext_abiILi4EEETnNSt3__19enable_ifIXsr3stdE19is_floating_point_vIT_EEiE4typeELi0EEENS2_9basic_vecIS8_T0_EERKSD_ Unexecuted instantiation: _ZN5cxx268simd_ext9roundevenIdNS_4simd6detail14vector_ext_abiILi2EEETnNSt3__19enable_ifIXsr3stdE19is_floating_point_vIT_EEiE4typeELi0EEENS2_9basic_vecIS8_T0_EERKSD_ |
34 | | |
35 | | template <class T, class Abi> |
36 | | void replace_lane(simd::basic_vec<T, Abi> &Vec, simd_size_type I, |
37 | 0 | T Value) noexcept { |
38 | 0 | simd::detail::simd_backend<T, Abi>::set_lane(simd::detail::access::data(Vec), |
39 | 0 | I, Value); |
40 | 0 | } Unexecuted instantiation: void cxx26::simd_ext::replace_lane<unsigned char, cxx26::simd::detail::vector_ext_abi<16> >(cxx26::simd::basic_vec<unsigned char, cxx26::simd::detail::vector_ext_abi<16> >&, int, unsigned char) Unexecuted instantiation: void cxx26::simd_ext::replace_lane<unsigned short, cxx26::simd::detail::vector_ext_abi<8> >(cxx26::simd::basic_vec<unsigned short, cxx26::simd::detail::vector_ext_abi<8> >&, int, unsigned short) Unexecuted instantiation: void cxx26::simd_ext::replace_lane<unsigned int, cxx26::simd::detail::vector_ext_abi<4> >(cxx26::simd::basic_vec<unsigned int, cxx26::simd::detail::vector_ext_abi<4> >&, int, unsigned int) Unexecuted instantiation: void cxx26::simd_ext::replace_lane<unsigned long, cxx26::simd::detail::vector_ext_abi<2> >(cxx26::simd::basic_vec<unsigned long, cxx26::simd::detail::vector_ext_abi<2> >&, int, unsigned long) Unexecuted instantiation: void cxx26::simd_ext::replace_lane<float, cxx26::simd::detail::vector_ext_abi<4> >(cxx26::simd::basic_vec<float, cxx26::simd::detail::vector_ext_abi<4> >&, int, float) Unexecuted instantiation: void cxx26::simd_ext::replace_lane<double, cxx26::simd::detail::vector_ext_abi<2> >(cxx26::simd::basic_vec<double, cxx26::simd::detail::vector_ext_abi<2> >&, int, double) |
41 | | |
42 | | } // namespace simd_ext |
43 | | } // namespace cxx26 |