Skip to content

Commit

Permalink
Merge pull request #1603 from evoskuil/master
Browse files Browse the repository at this point in the history
Disable non-xcode clang vectorization hack.
  • Loading branch information
evoskuil authored Jan 29, 2025
2 parents 486990c + f625384 commit a31857c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ konstant(buffer_t& buffer) NOEXCEPT
////{
//// konstant_(buffer);
////}
////else if constexpr (vector && !with_clang)
////else if constexpr (vector)
////{
//// vector_konstant(buffer);
////}
Expand Down
18 changes: 9 additions & 9 deletions include/bitcoin/system/impl/hash/sha/algorithm_parsing.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,22 @@ input(buffer_t& buffer, const block_t& block) NOEXCEPT
else if constexpr (bc::is_little_endian)
{
// This optimization is neutral in 4/8/16 lane sha256 perf.
////if constexpr (have_lanes<word_t, 16> && !with_clang)
////if constexpr (have_lanes<word_t, 16>)
////{
//// using xword_t = to_extended<word_t, 16>;
//// const auto& in = array_cast<xword_t>(block);
//// auto& out = array_cast<xword_t>(buffer);
//// out[0] = byteswap<word_t>(in[0]);
////}
////else if constexpr (have_lanes<word_t, 8> && !with_clang)
////else if constexpr (have_lanes<word_t, 8>)
////{
//// using xword_t = to_extended<word_t, 8>;
//// const auto& in = array_cast<xword_t>(block);
//// auto& out = array_cast<xword_t>(buffer);
//// out[0] = byteswap<word_t>(in[0]);
//// out[1] = byteswap<word_t>(in[1]);
////}
////else if constexpr (have_lanes<word_t, 4> && !with_clang)
////else if constexpr (have_lanes<word_t, 4>)
////{
//// using xword_t = to_extended<word_t, 4>;
//// const auto& in = array_cast<xword_t>(block);
Expand Down Expand Up @@ -131,14 +131,14 @@ input_left(auto& buffer, const half_t& half) NOEXCEPT
else if constexpr (bc::is_little_endian)
{
// This optimization is neutral in 4/8 lane sha256 perf.
////if constexpr (have_lanes<word_t, 8> && !with_clang)
////if constexpr (have_lanes<word_t, 8>)
////{
//// using xword_t = to_extended<word_t, 8>;
//// const auto& in = array_cast<xword_t>(half);
//// auto& out = array_cast<xword_t>(buffer);
//// out[0] = byteswap<word_t>(in[0]);
////}
////else if constexpr (have_lanes<word_t, 4> && !with_clang)
////else if constexpr (have_lanes<word_t, 4>)
////{
//// using xword_t = to_extended<word_t, 4>;
//// const auto& in = array_cast<xword_t>(half);
Expand Down Expand Up @@ -184,14 +184,14 @@ input_right(auto& buffer, const half_t& half) NOEXCEPT
else if constexpr (bc::is_little_endian)
{
// This optimization is neutral in 4/8 lane sha256 perf.
////if constexpr (have_lanes<word_t, 8> && !with_clang)
////if constexpr (have_lanes<word_t, 8>)
////{
//// using xword_t = to_extended<word_t, 8>;
//// const auto& in = array_cast<xword_t>(half);
//// auto& out = array_cast<xword_t>(buffer);
//// out[1] = byteswap<word_t>(in[0]);
////}
////else if constexpr (have_lanes<word_t, 4> && !with_clang)
////else if constexpr (have_lanes<word_t, 4>)
////{
//// using xword_t = to_extended<word_t, 4>;
//// const auto& in = array_cast<xword_t>(half);
Expand Down Expand Up @@ -354,7 +354,7 @@ output(const state_t& state) NOEXCEPT
if constexpr (SHA::strength != 160)
{
// This optimization is neutral in 4/8 lane sha256 perf.
////if constexpr (have_lanes<word_t, 8> && !with_clang)
////if constexpr (have_lanes<word_t, 8>)
////{
//// using xword_t = to_extended<word_t, 8>;
//// const auto& in = array_cast<xword_t>(state);
Expand All @@ -363,7 +363,7 @@ output(const state_t& state) NOEXCEPT
//// byteswap<word_t>(in[0])
//// });
////}
////else if constexpr (have_lanes<word_t, 4> && !with_clang)
////else if constexpr (have_lanes<word_t, 4>)
////{
//// using xword_t = to_extended<word_t, 4>;
//// const auto& in = array_cast<xword_t>(state);
Expand Down
7 changes: 0 additions & 7 deletions include/bitcoin/system/intrinsics/haves.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@
namespace libbitcoin {
namespace system {

// HACK: work around vectorizations failing on non-xcode clang.
#if defined(HAVE_CLANG) && !defined(HAVE_XCODE)
constexpr auto with_clang = true;
#else
constexpr auto with_clang = false;
#endif

// Functions may only be constexpr conditionally.
BC_PUSH_WARNING(USE_CONSTEXPR_FOR_FUNCTION)

Expand Down

0 comments on commit a31857c

Please sign in to comment.