Skip to content

Commit

Permalink
fix NO_SIMD
Browse files Browse the repository at this point in the history
  • Loading branch information
SadiinsoSnowfall committed Sep 30, 2024
1 parent 9e3c740 commit ffff344
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions include/eve/module/core/regular/logical_and.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ namespace eve
constexpr EVE_FORCEINLINE common_logical_t<T, U> operator()(T a, U b) const noexcept
requires (same_lanes_or_scalar<T, U> && !arithmetic_simd_value<T> && !arithmetic_simd_value<U>)
{
return EVE_DISPATCH_CALL(a, b);
if constexpr (has_emulated_abi_v<common_logical_t<T, U>>)
{
return convert(EVE_DISPATCH_CALL(a, b), as_element<common_logical_t<T, U>>{});
}
else
{
return EVE_DISPATCH_CALL(a, b);
}
}

EVE_CALLABLE_OBJECT(logical_and_t, logical_and_);
Expand Down Expand Up @@ -77,14 +84,13 @@ namespace eve
template<callable_options O, typename T, typename U>
EVE_FORCEINLINE constexpr common_logical_t<T, U> logical_and_(EVE_REQUIRES(cpu_), O const&, T a, U b) noexcept
{
if constexpr ((scalar_value<T> || std::same_as<T, bool>)
&& (scalar_value<U> || std::same_as<U, bool>)) return a && b;
if constexpr (std::same_as<T, bool> && std::same_as<U, bool>) return a && b;
else if constexpr (std::same_as<T, bool>) return logical_and(U{a}, b);
else if constexpr (std::same_as<U, bool>) return logical_and(a, T{b});
else if constexpr (simd_value<T> && scalar_value<U>) return logical_and(a, T{b});
else if constexpr (scalar_value<T> && simd_value<U>) return logical_and(b, U{a});
else if constexpr (logical_simd_value<T> && scalar_value<U>) return logical_and(a, T{b});
else if constexpr (scalar_value<T> && logical_simd_value<U>) return logical_and(b, U{a});
else if constexpr (std::same_as<typename T::bits_type, typename U::bits_type>) return bit_cast(a.bits() & b.bits(), as<as_logical_t<T>>{});
else return logical_and(a, convert(b, as<typename T::value_type>{}));
else return logical_and(a, convert(b, as<as_logical_t<typename T::value_type>>{}));
}
}
}
Expand Down

0 comments on commit ffff344

Please sign in to comment.