-
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.
SVE: Add support for fma-like intrinsics (#1474)
* Add support for fma-like intrinsics * Factorize handling of sve masking for ignore_none * USe _x when using ignore_none
- Loading branch information
Showing
14 changed files
with
218 additions
and
3 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
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,37 @@ | ||
//================================================================================================== | ||
/* | ||
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/implementation.hpp> | ||
|
||
namespace eve::detail | ||
{ | ||
template<arithmetic_scalar_value T, typename N> | ||
EVE_FORCEINLINE auto | ||
fam_(EVE_SUPPORTS(sve_), wide<T, N> v0, wide<T, N> v1, wide<T, N> v2) noexcept -> wide<T, N> | ||
requires sve_abi<abi_t<T, N>> | ||
{ | ||
return fam[ignore_none](v0, v1, v2); | ||
} | ||
|
||
template<conditional_expr C, arithmetic_scalar_value T, typename N> | ||
EVE_FORCEINLINE auto | ||
fam_(EVE_SUPPORTS(sve_), C cond, wide<T, N> v0, wide<T, N> v1, wide<T, N> v2) noexcept -> wide<T, N> | ||
requires sve_abi<abi_t<T, N>> | ||
{ | ||
if constexpr( C::is_complete && C::is_inverted ) return svmla_x(sve_true<T>(), v0, v1, v2); | ||
else | ||
{ | ||
auto const alt = alternative(cond, v0, as(v0)); | ||
if constexpr( C::is_complete && !C::is_inverted ) return alt; | ||
else return svmla_m(cond.mask(as<T>{}), alt, v1, v2); | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
include/eve/module/core/regular/impl/simd/arm/sve/fanm.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,37 @@ | ||
//================================================================================================== | ||
/* | ||
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/implementation.hpp> | ||
|
||
namespace eve::detail | ||
{ | ||
template<arithmetic_scalar_value T, typename N> | ||
EVE_FORCEINLINE auto | ||
fanm_(EVE_SUPPORTS(sve_), wide<T, N> v0, wide<T, N> v1, wide<T, N> v2) noexcept -> wide<T, N> | ||
requires sve_abi<abi_t<T, N>> | ||
{ | ||
return fanm[ignore_none](v0, v1, v2); | ||
} | ||
|
||
template<conditional_expr C, arithmetic_scalar_value T, typename N> | ||
EVE_FORCEINLINE auto | ||
fanm_(EVE_SUPPORTS(sve_), C cond, wide<T, N> v0, wide<T, N> v1, wide<T, N> v2) noexcept -> wide<T, N> | ||
requires sve_abi<abi_t<T, N>> | ||
{ | ||
if constexpr( C::is_complete && C::is_inverted ) return svmls_x(sve_true<T>(), v0, v1, v2); | ||
else | ||
{ | ||
auto const alt = alternative(cond, v0, as(v0)); | ||
if constexpr( C::is_complete && !C::is_inverted ) return alt; | ||
else return svmls_m(cond.mask(as<T>{}), alt, v1, v2); | ||
} | ||
} | ||
} |
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,37 @@ | ||
//================================================================================================== | ||
/* | ||
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/implementation.hpp> | ||
|
||
namespace eve::detail | ||
{ | ||
template<arithmetic_scalar_value T, typename N> | ||
EVE_FORCEINLINE auto | ||
fma_(EVE_SUPPORTS(sve_), wide<T, N> v0, wide<T, N> v1, wide<T, N> v2) noexcept -> wide<T, N> | ||
requires sve_abi<abi_t<T, N>> | ||
{ | ||
return fma[ignore_none](v0, v1, v2); | ||
} | ||
|
||
template<conditional_expr C, arithmetic_scalar_value T, typename N> | ||
EVE_FORCEINLINE auto | ||
fma_(EVE_SUPPORTS(sve_), C cond, wide<T, N> v0, wide<T, N> v1, wide<T, N> v2) noexcept -> wide<T, N> | ||
requires sve_abi<abi_t<T, N>> | ||
{ | ||
if constexpr( C::is_complete && C::is_inverted ) return svmad_x(sve_true<T>(), v0, v1, v2); | ||
else | ||
{ | ||
auto const alt = alternative(cond, v0, as(v0)); | ||
if constexpr( C::is_complete && !C::is_inverted ) return alt; | ||
else return svmad_m(cond.mask(as<T>{}), alt, v1, v2); | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
include/eve/module/core/regular/impl/simd/arm/sve/fnma.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,37 @@ | ||
//================================================================================================== | ||
/* | ||
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/implementation.hpp> | ||
|
||
namespace eve::detail | ||
{ | ||
template<arithmetic_scalar_value T, typename N> | ||
EVE_FORCEINLINE auto | ||
fnma_(EVE_SUPPORTS(sve_), wide<T, N> v0, wide<T, N> v1, wide<T, N> v2) noexcept -> wide<T, N> | ||
requires sve_abi<abi_t<T, N>> | ||
{ | ||
return fnma[ignore_none](v0, v1, v2); | ||
} | ||
|
||
template<conditional_expr C, arithmetic_scalar_value T, typename N> | ||
EVE_FORCEINLINE auto | ||
fnma_(EVE_SUPPORTS(sve_), C cond, wide<T, N> v0, wide<T, N> v1, wide<T, N> v2) noexcept -> wide<T, N> | ||
requires sve_abi<abi_t<T, N>> | ||
{ | ||
if constexpr( C::is_complete && C::is_inverted ) return svmsb_x(sve_true<T>(), v0, v1, v2); | ||
else | ||
{ | ||
auto const alt = alternative(cond, v0, as(v0)); | ||
if constexpr( C::is_complete && !C::is_inverted ) return alt; | ||
else return svmsb_m(cond.mask(as<T>{}), alt, v1, v2); | ||
} | ||
} | ||
} |
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,22 @@ | ||
//================================================================================================== | ||
/* | ||
EVE - Expressive Vector Engine | ||
Copyright : EVE Project Contributors | ||
SPDX-License-Identifier: BSL-1.0 | ||
*/ | ||
//================================================================================================== | ||
#pragma once | ||
|
||
#include <eve/concept/value.hpp> | ||
#include <eve/detail/implementation.hpp> | ||
|
||
namespace eve::detail | ||
{ | ||
template<arithmetic_scalar_value T, typename N> | ||
EVE_FORCEINLINE auto | ||
fsm_(EVE_SUPPORTS(sve_), wide<T, N> v0, wide<T, N> v1, wide<T, N> v2) noexcept -> wide<T, N> | ||
requires sve_abi<abi_t<T, N>> | ||
{ | ||
return -fanm(v0, v1, v2); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
include/eve/module/core/regular/impl/simd/arm/sve/fsnm.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,22 @@ | ||
//================================================================================================== | ||
/* | ||
EVE - Expressive Vector Engine | ||
Copyright : EVE Project Contributors | ||
SPDX-License-Identifier: BSL-1.0 | ||
*/ | ||
//================================================================================================== | ||
#pragma once | ||
|
||
#include <eve/concept/value.hpp> | ||
#include <eve/detail/implementation.hpp> | ||
|
||
namespace eve::detail | ||
{ | ||
template<arithmetic_scalar_value T, typename N> | ||
EVE_FORCEINLINE auto | ||
fsnm_(EVE_SUPPORTS(sve_), wide<T, N> v0, wide<T, N> v1, wide<T, N> v2) noexcept -> wide<T, N> | ||
requires sve_abi<abi_t<T, N>> | ||
{ | ||
return -fam(v0, v1, v2); | ||
} | ||
} |
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