Skip to content

Commit 84b87de

Browse files
Update to simde v0.8.2
1 parent 89bf118 commit 84b87de

32 files changed

+227750
-63870
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ install (
157157
DESTINATION include
158158
FILES_MATCHING PATTERN "*.hpp")
159159
install (
160-
DIRECTORY ${CMAKE_SOURCE_DIR}/third_party/simde
160+
DIRECTORY ${CMAKE_SOURCE_DIR}/third_party/simde-0.8.2
161161
DESTINATION include/${HPCOMBI_INSTALL_DIR})
162162
install (
163163
FILES ${CMAKE_CURRENT_BINARY_DIR}/hpcombi.pc

examples/Renner.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@
3131
#include <unordered_map>
3232
#endif
3333

34-
#include "simde/x86/sse4.1.h" // for simde_mm_max_epu8, simde...
3534
#include "hpcombi/perm16.hpp"
36-
35+
#include "simde-0.8.2/x86/sse4.1.h" // for simde_mm_max_epu8, simde...
3736

3837
template <typename T>
3938
std::ostream &operator<<(std::ostream &out, const std::vector<T> &v) {

examples/pattern.cpp

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@
3030
#else
3131
#include <unordered_map>
3232
#endif
33-
#include "simde/x86/sse4.1.h" // for simde_mm_max_epu8, simde...
33+
#include "simde-0.8.2/x86/sse4.1.h" // for simde_mm_max_epu8, simde...
3434

3535
#include "hpcombi/perm16.hpp"
3636

3737
template <typename T>
3838
std::ostream &operator<<(std::ostream &out, const std::vector<T> &v) {
39-
out << '[';
40-
if (!v.empty()) {
41-
auto i = v.begin();
42-
for (; i != --v.end(); ++i)
43-
out << std::setw(2) << *i << ",";
44-
out << std::setw(2) << *i;
45-
}
46-
out << "]";
47-
return out;
39+
out << '[';
40+
if (!v.empty()) {
41+
auto i = v.begin();
42+
for (; i != --v.end(); ++i)
43+
out << std::setw(2) << *i << ",";
44+
out << std::setw(2) << *i;
45+
}
46+
out << "]";
47+
return out;
4848
}
4949

5050
using namespace std;
@@ -54,16 +54,18 @@ std::vector<epu8> subsets;
5454
std::vector<epu8> subperm;
5555

5656
epu8 tosubset(uint16_t n) {
57-
epu8 res {};
57+
epu8 res{};
5858
for (int i = 0; i < 16; i++) {
59-
if (((n >> i) & 1) != 0) res[i] = 0xff;
59+
if (((n >> i) & 1) != 0)
60+
res[i] = 0xff;
6061
}
61-
if (simde_mm_movemask_epi8(res) != n) cout << n << "BUG" << res << endl;
62+
if (simde_mm_movemask_epi8(res) != n)
63+
cout << n << "BUG" << res << endl;
6264
return res;
6365
}
6466

6567
epu8 subset_to_perm(epu8 s) {
66-
epu8 res = Epu8({},0xff);
68+
epu8 res = Epu8({}, 0xff);
6769
int c = 0;
6870
for (int i = 0; i < 16; i++) {
6971
if (s[i] != 0) {
@@ -76,27 +78,26 @@ epu8 subset_to_perm(epu8 s) {
7678

7779
void make_subsets_of_size(int n, int k) {
7880
int n2 = 1 << n;
79-
for (uint16_t i=0; i < n2; i++) {
81+
for (uint16_t i = 0; i < n2; i++) {
8082
if (__builtin_popcountl(i) == k) {
8183
subsets.push_back(tosubset(i));
8284
subperm.push_back(subset_to_perm(tosubset(i)));
8385
}
8486
}
8587
}
8688

87-
template <int Size>
88-
epu8 extract_pattern(epu8 perm, epu8 permset) {
89+
template <int Size> epu8 extract_pattern(epu8 perm, epu8 permset) {
8990
epu8 cst = Epu8({}, Size);
9091
epu8 res = permuted(perm, permset) | (Epu8.id() >= cst);
9192
res = sort_perm(res) & (Epu8.id() < cst);
9293
return res;
9394
}
9495

95-
template <int Size>
96-
bool has_pattern(epu8 perm, epu8 patt) {
96+
template <int Size> bool has_pattern(epu8 perm, epu8 patt) {
9797
for (size_t i = 0; i < subperm.size(); i++) {
9898
epu8 extr = extract_pattern<Size>(perm, subperm[i]);
99-
if (equal(extr, patt)) return true;
99+
if (equal(extr, patt))
100+
return true;
100101
}
101102
return false;
102103
}
@@ -106,13 +107,13 @@ int main() {
106107
int n = 8, k = 4, n2 = 1 << n;
107108
make_subsets_of_size(n, k);
108109
cout << subsets.size() << endl;
109-
epu8 perm = {1,4,2,0,3,5,6,7};
110+
epu8 perm = {1, 4, 2, 0, 3, 5, 6, 7};
110111
int i = 42;
111112
cout << Perm16::one() << endl;
112113
cout << perm << endl;
113114
cout << subsets[i] << endl;
114115
cout << simde_mm_movemask_epi8(subsets[i]) << endl;
115116
cout << extract_pattern<4>(perm, subperm[i]) << endl;
116-
cout << int(has_pattern<4>(perm, epu8 {2,1,0,3})) << endl;
117-
cout << int(has_pattern<4>(perm, epu8 {3,2,1,0})) << endl;
117+
cout << int(has_pattern<4>(perm, epu8{2, 1, 0, 3})) << endl;
118+
cout << int(has_pattern<4>(perm, epu8{3, 2, 1, 0})) << endl;
118119
}

include/hpcombi/bmat16.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include "bmat8.hpp" // for BMat8
3535
#include "debug.hpp" // for HPCOMBI_ASSERT
3636

37-
#include "simde/x86/avx2.h"
37+
#include "simde-0.8.2/x86/avx2.h"
3838

3939
namespace HPCombi {
4040
using xpu16 = uint16_t __attribute__((vector_size(32)));

include/hpcombi/epu8.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ eg simde_mm_testz_si128(a,a) → is_all_zero(a) */
4545
#pragma clang diagnostic push
4646
#pragma clang diagnostic ignored "-Wbitwise-instead-of-logical"
4747
#endif
48-
#include "simde/x86/sse4.1.h" // for simde_mm_max_epu8, simde...
49-
#include "simde/x86/sse4.2.h" // for ???
48+
#include "simde-0.8.2/x86/sse4.1.h" // for simde_mm_max_epu8, simde...
49+
#include "simde-0.8.2/x86/sse4.2.h" // for ???
5050
#if defined(__clang__)
5151
#pragma clang diagnostic pop
5252
#endif

include/hpcombi/perm16.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
#pragma clang diagnostic push
4949
#pragma clang diagnostic ignored "-Wbitwise-instead-of-logical"
5050
#endif
51-
#include "simde/x86/sse4.1.h"
52-
#include "simde/x86/sse4.2.h"
51+
#include "simde-0.8.2/x86/sse4.1.h"
52+
#include "simde-0.8.2/x86/sse4.2.h"
5353
#if defined(__clang__)
5454
#pragma clang diagnostic pop
5555
#endif

0 commit comments

Comments
 (0)