Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable non-xcode clang vectorization hack. #1603

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading