Skip to content

Commit

Permalink
Attempt to work around MSVC ICE
Browse files Browse the repository at this point in the history
  • Loading branch information
Epixu committed Feb 6, 2025
1 parent 5bff584 commit de0fc9e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
6 changes: 2 additions & 4 deletions source/SetGet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ namespace Langulus::SIMD
if constexpr (REVERSE) {
if constexpr (MAXS - IDX - 1 < S) {
LANGULUS_SIMD_VERBOSE("Setting [", IDX, "] to ", values[MAXS - IDX - 1]);
//return reinterpret_cast<const R&>(values[MAXS - IDX - 1]);
return static_cast<R>(values[MAXS - IDX - 1]);
return reinterpret_cast<const R&>(values[MAXS - IDX - 1]);
}
else {
LANGULUS_SIMD_VERBOSE("Setting [", IDX, "] to ", static_cast<R>(DEF));
Expand All @@ -44,8 +43,7 @@ namespace Langulus::SIMD
else {
if constexpr (IDX < S) {
LANGULUS_SIMD_VERBOSE("Setting [", IDX, "] to ", values[IDX]);
//return reinterpret_cast<const R&>(values[IDX]);
return static_cast<R>(values[IDX]);
return reinterpret_cast<const R&>(values[IDX]);
}
else {
LANGULUS_SIMD_VERBOSE("Setting [", IDX, "] to ", static_cast<R>(DEF));
Expand Down
30 changes: 24 additions & 6 deletions source/binary/Subtract.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ namespace Langulus::SIMD
(void)lhs; (void)rhs;

if constexpr (SATURATE) {
#if LANGULUS_SIMD(128BIT)
if constexpr (CT::SIMD128<R>) {
if constexpr (CT::SignedInteger8<T>) return R {simde_mm_subs_epi8 (lhs, rhs)};
else if constexpr (CT::UnsignedInteger8<T>) return R {simde_mm_subs_epu8 (lhs, rhs)};
Expand Down Expand Up @@ -64,7 +65,10 @@ namespace Langulus::SIMD
}
else static_assert(false, "Unsupported type for 16-byte package");
}
else if constexpr (CT::SIMD256<R>) {
else
#endif
#if LANGULUS_SIMD(256BIT)
if constexpr (CT::SIMD256<R>) {
if constexpr (CT::SignedInteger8<T>) return R {simde_mm256_subs_epi8 (lhs, rhs)};
else if constexpr (CT::UnsignedInteger8<T>) return R {simde_mm256_subs_epu8 (lhs, rhs)};
else if constexpr (CT::SignedInteger16<T>) return R {simde_mm256_subs_epi16(lhs, rhs)};
Expand Down Expand Up @@ -97,7 +101,10 @@ namespace Langulus::SIMD
}
else static_assert(false, "Unsupported type for 32-byte package");
}
else if constexpr (CT::SIMD512<R>) {
else
#endif
#if LANGULUS_SIMD(512BIT)
if constexpr (CT::SIMD512<R>) {
if constexpr (CT::SignedInteger8<T>) return R {simde_mm512_subs_epi8 (lhs, rhs)};
else if constexpr (CT::UnsignedInteger8<T>) return R {simde_mm512_subs_epu8 (lhs, rhs)};
else if constexpr (CT::SignedInteger16<T>) return R {simde_mm512_subs_epi16(lhs, rhs)};
Expand Down Expand Up @@ -126,9 +133,12 @@ namespace Langulus::SIMD
}
else static_assert(false, "Unsupported type for 64-byte package");
}
else static_assert(false, "Unsupported type");
else
#endif
static_assert(false, "Unsupported type");
}
else {
#if LANGULUS_SIMD(128BIT)
if constexpr (CT::SIMD128<R>) {
if constexpr (CT::Integer8<T>) return R {simde_mm_sub_epi8 (lhs, rhs)};
else if constexpr (CT::Integer16<T>) return R {simde_mm_sub_epi16 (lhs, rhs)};
Expand All @@ -138,7 +148,10 @@ namespace Langulus::SIMD
else if constexpr (CT::Double<T>) return R {simde_mm_sub_pd (lhs, rhs)};
else static_assert(false, "Unsupported type for 16-byte package");
}
else if constexpr (CT::SIMD256<R>) {
else
#endif
#if LANGULUS_SIMD(256BIT)
if constexpr (CT::SIMD256<R>) {
if constexpr (CT::Integer8<T>) return R {simde_mm256_sub_epi8 (lhs, rhs)};
else if constexpr (CT::Integer16<T>) return R {simde_mm256_sub_epi16(lhs, rhs)};
else if constexpr (CT::Integer32<T>) return R {simde_mm256_sub_epi32(lhs, rhs)};
Expand All @@ -147,7 +160,10 @@ namespace Langulus::SIMD
else if constexpr (CT::Double<T>) return R {simde_mm256_sub_pd (lhs, rhs)};
else static_assert(false, "Unsupported type for 32-byte package");
}
else if constexpr (CT::SIMD512<R>) {
else
#endif
#if LANGULUS_SIMD(512BIT)
if constexpr (CT::SIMD512<R>) {
if constexpr (CT::Integer8<T>) return R {simde_mm512_sub_epi8 (lhs, rhs)};
else if constexpr (CT::Integer16<T>) return R {simde_mm512_sub_epi16(lhs, rhs)};
else if constexpr (CT::Integer32<T>) return R {simde_mm512_sub_epi32(lhs, rhs)};
Expand All @@ -156,7 +172,9 @@ namespace Langulus::SIMD
else if constexpr (CT::Double<T>) return R {simde_mm512_sub_pd (lhs, rhs)};
else static_assert(false, "Unsupported type for 64-byte package");
}
else static_assert(false, "Unsupported type");
else
#endif
static_assert(false, "Unsupported type");
}
}

Expand Down

0 comments on commit de0fc9e

Please sign in to comment.