Skip to content

Commit a31857c

Browse files
authored
Merge pull request #1603 from evoskuil/master
Disable non-xcode clang vectorization hack.
2 parents 486990c + f625384 commit a31857c

3 files changed

Lines changed: 10 additions & 17 deletions

File tree

include/bitcoin/system/impl/hash/sha/algorithm_konstant.ipp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ konstant(buffer_t& buffer) NOEXCEPT
257257
////{
258258
//// konstant_(buffer);
259259
////}
260-
////else if constexpr (vector && !with_clang)
260+
////else if constexpr (vector)
261261
////{
262262
//// vector_konstant(buffer);
263263
////}

include/bitcoin/system/impl/hash/sha/algorithm_parsing.ipp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,22 @@ input(buffer_t& buffer, const block_t& block) NOEXCEPT
5959
else if constexpr (bc::is_little_endian)
6060
{
6161
// This optimization is neutral in 4/8/16 lane sha256 perf.
62-
////if constexpr (have_lanes<word_t, 16> && !with_clang)
62+
////if constexpr (have_lanes<word_t, 16>)
6363
////{
6464
//// using xword_t = to_extended<word_t, 16>;
6565
//// const auto& in = array_cast<xword_t>(block);
6666
//// auto& out = array_cast<xword_t>(buffer);
6767
//// out[0] = byteswap<word_t>(in[0]);
6868
////}
69-
////else if constexpr (have_lanes<word_t, 8> && !with_clang)
69+
////else if constexpr (have_lanes<word_t, 8>)
7070
////{
7171
//// using xword_t = to_extended<word_t, 8>;
7272
//// const auto& in = array_cast<xword_t>(block);
7373
//// auto& out = array_cast<xword_t>(buffer);
7474
//// out[0] = byteswap<word_t>(in[0]);
7575
//// out[1] = byteswap<word_t>(in[1]);
7676
////}
77-
////else if constexpr (have_lanes<word_t, 4> && !with_clang)
77+
////else if constexpr (have_lanes<word_t, 4>)
7878
////{
7979
//// using xword_t = to_extended<word_t, 4>;
8080
//// const auto& in = array_cast<xword_t>(block);
@@ -131,14 +131,14 @@ input_left(auto& buffer, const half_t& half) NOEXCEPT
131131
else if constexpr (bc::is_little_endian)
132132
{
133133
// This optimization is neutral in 4/8 lane sha256 perf.
134-
////if constexpr (have_lanes<word_t, 8> && !with_clang)
134+
////if constexpr (have_lanes<word_t, 8>)
135135
////{
136136
//// using xword_t = to_extended<word_t, 8>;
137137
//// const auto& in = array_cast<xword_t>(half);
138138
//// auto& out = array_cast<xword_t>(buffer);
139139
//// out[0] = byteswap<word_t>(in[0]);
140140
////}
141-
////else if constexpr (have_lanes<word_t, 4> && !with_clang)
141+
////else if constexpr (have_lanes<word_t, 4>)
142142
////{
143143
//// using xword_t = to_extended<word_t, 4>;
144144
//// const auto& in = array_cast<xword_t>(half);
@@ -184,14 +184,14 @@ input_right(auto& buffer, const half_t& half) NOEXCEPT
184184
else if constexpr (bc::is_little_endian)
185185
{
186186
// This optimization is neutral in 4/8 lane sha256 perf.
187-
////if constexpr (have_lanes<word_t, 8> && !with_clang)
187+
////if constexpr (have_lanes<word_t, 8>)
188188
////{
189189
//// using xword_t = to_extended<word_t, 8>;
190190
//// const auto& in = array_cast<xword_t>(half);
191191
//// auto& out = array_cast<xword_t>(buffer);
192192
//// out[1] = byteswap<word_t>(in[0]);
193193
////}
194-
////else if constexpr (have_lanes<word_t, 4> && !with_clang)
194+
////else if constexpr (have_lanes<word_t, 4>)
195195
////{
196196
//// using xword_t = to_extended<word_t, 4>;
197197
//// const auto& in = array_cast<xword_t>(half);
@@ -354,7 +354,7 @@ output(const state_t& state) NOEXCEPT
354354
if constexpr (SHA::strength != 160)
355355
{
356356
// This optimization is neutral in 4/8 lane sha256 perf.
357-
////if constexpr (have_lanes<word_t, 8> && !with_clang)
357+
////if constexpr (have_lanes<word_t, 8>)
358358
////{
359359
//// using xword_t = to_extended<word_t, 8>;
360360
//// const auto& in = array_cast<xword_t>(state);
@@ -363,7 +363,7 @@ output(const state_t& state) NOEXCEPT
363363
//// byteswap<word_t>(in[0])
364364
//// });
365365
////}
366-
////else if constexpr (have_lanes<word_t, 4> && !with_clang)
366+
////else if constexpr (have_lanes<word_t, 4>)
367367
////{
368368
//// using xword_t = to_extended<word_t, 4>;
369369
//// const auto& in = array_cast<xword_t>(state);

include/bitcoin/system/intrinsics/haves.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@
3030
namespace libbitcoin {
3131
namespace system {
3232

33-
// HACK: work around vectorizations failing on non-xcode clang.
34-
#if defined(HAVE_CLANG) && !defined(HAVE_XCODE)
35-
constexpr auto with_clang = true;
36-
#else
37-
constexpr auto with_clang = false;
38-
#endif
39-
4033
// Functions may only be constexpr conditionally.
4134
BC_PUSH_WARNING(USE_CONSTEXPR_FOR_FUNCTION)
4235

0 commit comments

Comments
 (0)