From 7b572150834a7e566c0cddfee31b9bd75a2842ad Mon Sep 17 00:00:00 2001 From: Denis Yaroshevskiy Date: Sat, 17 Dec 2022 20:03:33 +0000 Subject: [PATCH 1/2] sve: unit.memory.exe --- .../eve/detail/function/simd/arm/sve/load.hpp | 44 +++++++++---------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/include/eve/detail/function/simd/arm/sve/load.hpp b/include/eve/detail/function/simd/arm/sve/load.hpp index 41663900ac..6749e413d9 100644 --- a/include/eve/detail/function/simd/arm/sve/load.hpp +++ b/include/eve/detail/function/simd/arm/sve/load.hpp @@ -20,50 +20,46 @@ template> Ptr> EVE_FORCEINLINE wide -load_(EVE_SUPPORTS(sve_), C const& cond, safe_type const&, eve::as> const&, Ptr p) -requires(sve_abi>) +load_(EVE_SUPPORTS(sve_), + C const& cond, safe_type const& s, eve::as> const& tgt, Ptr p) + requires (!has_bundle_abi_v>) { auto ptr = unalign(p); - if constexpr(C::is_complete && C::is_inverted) + if constexpr ( C::has_alternative ) { - if constexpr( N() == expected_cardinal_v ) return svld1(sve_true(), ptr); - else return svldff1(sve_true(), ptr); + auto res = load(drop_alternative(cond), s, tgt, p); + return eve::replace_ignored(res, cond, cond.alternative); } - else + else if constexpr ( C::is_complete && !C::is_inverted ) return {}; + else if constexpr ( has_aggregated_abi_v> ) { - wide loaded; + using half = wide; - if constexpr(!C::is_complete) - { - auto mask = cond.mask(as>{}); - if constexpr( N() == expected_cardinal_v ) loaded = svld1(mask, ptr); - else loaded = svldff1(mask, ptr); - if constexpr( C::has_alternative ) - { - loaded = svsel(mask, loaded, wide(cond.alternative)); - } - } - else - { - if constexpr( C::has_alternative ) loaded = wide(cond.alternative); - } + // condition does not matter - just presense matters + auto lo = load(cond, s, as{}, ptr); + auto hi = load(cond, s, as{}, ptr + half::size()); - return loaded; + return {lo, hi}; } + else if constexpr(C::is_complete && C::is_inverted && N() == expected_cardinal_v ) + { + return svld1(sve_true(), ptr); + } + else return svldff1(sve_true(), ptr); } //================================================================================================ // Logical support //================================================================================================ -template +template>> Pointer> EVE_FORCEINLINE logical> load_(EVE_SUPPORTS(sve_), C const& cond, safe_type const&, eve::as>> const&, Pointer ptr) noexcept -requires(dereference_as, Pointer>::value && sve_abi>) { auto const c1 = map_alternative(cond, [](auto alt) { return alt.mask(); }); auto const block = load(c1, safe, eve::as> {}, ptr_cast(ptr)); From 12e8e48e094381e8c42a10505860799805e7cc09 Mon Sep 17 00:00:00 2001 From: Joel Falcou Date: Sun, 18 Dec 2022 19:10:14 +0100 Subject: [PATCH 2/2] Fix fixed<0> in x86 arithmetic --- .../eve/detail/function/simd/x86/arithmetic_compounds.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/eve/detail/function/simd/x86/arithmetic_compounds.hpp b/include/eve/detail/function/simd/x86/arithmetic_compounds.hpp index 9735e13e80..7b75aeae83 100644 --- a/include/eve/detail/function/simd/x86/arithmetic_compounds.hpp +++ b/include/eve/detail/function/simd/x86/arithmetic_compounds.hpp @@ -180,7 +180,8 @@ namespace eve::detail } else { - using htype = wide>; + static constexpr auto half_size = (N::value/2 > 0) ? N::value/2 : 1; + using htype = wide>; htype mhi = _mm_setr_epi32(-1, 0, -1, 0); htype mlo = mhi; auto lself = _mm_srli_si128(self, 4); @@ -202,7 +203,8 @@ namespace eve::detail else if constexpr( c == category::uint16x8 ) self = _mm_mullo_epi16(self, other); else if constexpr( c == category::int8x16 || c == category::uint8x16 ) { - using htype = wide>; + static constexpr auto half_size = (N::value/2 > 0) ? N::value/2 : 1; + using htype = wide>; htype mhi = _mm_set1_epi16(0x00FF); htype mlo = mhi; auto lself = _mm_srli_epi16(self, 8);