-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
232 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//================================================================================================== | ||
/* | ||
EVE - Expressive Vector Engine | ||
Copyright : EVE Project Contributors | ||
SPDX-License-Identifier: BSL-1.0 | ||
*/ | ||
//================================================================================================== | ||
#pragma once | ||
|
||
#include <eve/detail/has_abi.hpp> | ||
#include <eve/detail/implementation.hpp> | ||
#include <eve/module/core/regular/count_true.hpp> | ||
|
||
namespace eve::detail | ||
{ | ||
template<scalar_value T, typename N, relative_conditional_expr C> | ||
EVE_FORCEINLINE bool | ||
all_(EVE_SUPPORTS(sve_), C const& cond, logical<wide<T,N>> const& v) noexcept | ||
requires sve_abi<abi_t<T, N>> | ||
{ | ||
if constexpr( C::is_complete ) | ||
{ | ||
if constexpr( C::is_inverted ) return count_true(v) == N::value; | ||
else return true; | ||
} | ||
else return count_true(cond, v) == cond.count(as<wide<T,N>>()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//================================================================================================== | ||
/* | ||
EVE - Expressive Vector Engine | ||
Copyright : EVE Project Contributors | ||
SPDX-License-Identifier: BSL-1.0 | ||
*/ | ||
//================================================================================================== | ||
#pragma once | ||
|
||
#include <eve/detail/has_abi.hpp> | ||
#include <eve/detail/implementation.hpp> | ||
|
||
namespace eve::detail | ||
{ | ||
template<scalar_value T, typename N, relative_conditional_expr C> | ||
EVE_FORCEINLINE bool | ||
any_(EVE_SUPPORTS(sve_), C const& cond, logical<wide<T,N>> const& v) noexcept | ||
requires sve_abi<abi_t<T, N>> | ||
{ | ||
if constexpr( C::is_complete ) | ||
{ | ||
if constexpr( C::is_inverted ) return svptest_any(sve_true<T>(), v); | ||
else return false; | ||
} | ||
else return svptest_any(cond.mask(as<wide<T,N>>{}),v); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
include/eve/module/core/regular/impl/simd/arm/sve/bit_andnot.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//================================================================================================== | ||
/* | ||
EVE - Expressive Vector Engine | ||
Copyright : EVE Project Contributors | ||
SPDX-License-Identifier: BSL-1.0 | ||
*/ | ||
//================================================================================================== | ||
#pragma once | ||
|
||
#include <eve/arch/arm/sve/sve_true.hpp> | ||
#include <eve/concept/value.hpp> | ||
#include <eve/detail/category.hpp> | ||
#include <eve/detail/implementation.hpp> | ||
|
||
namespace eve::detail | ||
{ | ||
template<scalar_value T, typename N> | ||
EVE_FORCEINLINE auto | ||
bit_andnot_(EVE_SUPPORTS(sve_), wide<T, N> const& v0, wide<T, N> const& v1) noexcept -> wide<T, N> | ||
requires sve_abi<abi_t<T, N>> | ||
{ | ||
using i_t = typename wide<T, N>::template rebind<as_integer_t<T>,N>; | ||
constexpr auto tgt = as<i_t>(); | ||
return bit_cast ( i_t ( svbic_x ( sve_true<T>() | ||
, bit_cast(v0,tgt) | ||
, bit_cast(v1,tgt) | ||
) | ||
) | ||
, as<wide<T,N>>{} | ||
); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
include/eve/module/core/regular/impl/simd/arm/sve/count_true.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//================================================================================================== | ||
/* | ||
EVE - Expressive Vector Engine | ||
Copyright : EVE Project Contributors | ||
SPDX-License-Identifier: BSL-1.0 | ||
*/ | ||
//================================================================================================== | ||
#pragma once | ||
|
||
#include <eve/concept/conditional.hpp> | ||
#include <eve/concept/value.hpp> | ||
#include <eve/detail/implementation.hpp> | ||
|
||
namespace eve::detail | ||
{ | ||
template<scalar_value T, typename N, relative_conditional_expr C> | ||
EVE_FORCEINLINE std::ptrdiff_t | ||
count_true_(EVE_SUPPORTS(cpu_), C cond, logical<wide<T,N>> v) noexcept | ||
requires sve_abi<abi_t<T, N>> | ||
{ | ||
auto const m = cond.mask(as<wide<T,N>>{}); | ||
if constexpr(sizeof(T) == 1) return svcntp_b8(m,v); | ||
else if constexpr(sizeof(T) == 2) return svcntp_b16(m,v); | ||
else if constexpr(sizeof(T) == 4) return svcntp_b32(m,v); | ||
else if constexpr(sizeof(T) == 8) return svcntp_b64(m,v); | ||
} | ||
|
||
template<scalar_value T, typename N> | ||
EVE_FORCEINLINE std::ptrdiff_t | ||
count_true_(EVE_SUPPORTS(sve_), logical<wide<T,N>> v) noexcept | ||
requires sve_abi<abi_t<T, N>> | ||
{ | ||
return count_true[ignore_none](v); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
include/eve/module/core/regular/impl/simd/arm/sve/sqrt.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
//================================================================================================== | ||
/* | ||
EVE - Expressive Vector Engine | ||
Copyright : EVE Project Contributors | ||
SPDX-License-Identifier: BSL-1.0 | ||
*/ | ||
//================================================================================================== | ||
#pragma once | ||
|
||
#include <eve/arch/arm/sve/sve_true.hpp> | ||
#include <eve/concept/value.hpp> | ||
#include <eve/detail/category.hpp> | ||
#include <eve/detail/implementation.hpp> | ||
|
||
namespace eve::detail | ||
{ | ||
template<conditional_expr C, value V> | ||
EVE_FORCEINLINE auto | ||
sqrt_(EVE_SUPPORTS(sve_), C const& cond, V const& v) noexcept -> V | ||
requires sve_abi<typename V::abi_type> | ||
{ | ||
if constexpr( C::is_complete ) | ||
{ | ||
if constexpr( C::is_inverted ) return svsqrt_x(sve_true<element_type_t<V>>(), v); | ||
else return alternative(cond, v, as<V> {}); | ||
} | ||
else | ||
{ | ||
auto src = alternative(cond, v, as<V> {}); | ||
auto m = expand_mask(cond, as<V> {}); | ||
return svsqrt_m(src, m, v); | ||
} | ||
} | ||
|
||
template<floating_real_scalar_value T, typename N> | ||
EVE_FORCEINLINE auto | ||
sqrt_(EVE_SUPPORTS(sve_), wide<T, N> const& v) noexcept -> wide<T, N> | ||
requires sve_abi<abi_t<T, N>> | ||
{ | ||
return sqrt[ignore_none](v); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
include/eve/module/core/saturated/impl/simd/arm/sve/add.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//================================================================================================== | ||
/* | ||
EVE - Expressive Vector Engine | ||
Copyright : EVE Project Contributors | ||
SPDX-License-Identifier: BSL-1.0 | ||
*/ | ||
//================================================================================================== | ||
#pragma once | ||
|
||
#include <eve/arch/arm/sve/sve_true.hpp> | ||
#include <eve/concept/value.hpp> | ||
#include <eve/detail/category.hpp> | ||
#include <eve/detail/implementation.hpp> | ||
|
||
namespace eve::detail | ||
{ | ||
template<scalar_value T, typename N> | ||
EVE_FORCEINLINE wide<T, N> | ||
add_(EVE_SUPPORTS(sve_), saturated_type const&, wide<T, N> const& a, wide<T, N> const& b) noexcept | ||
requires sve_abi<abi_t<T, N>> | ||
{ | ||
if constexpr( std::integral<T> ) return svqadd(a, b); | ||
else return add(a, b); | ||
} | ||
} |