]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
Minor changes to enable compilation on Mac M1 82/head
authorKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Sat, 11 Dec 2021 13:43:55 +0000 (15:43 +0200)
committerKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Sat, 11 Dec 2021 13:43:55 +0000 (15:43 +0200)
examples/patbench.cc
src/util/supervector/arch/arm/impl.cpp

index 20de5745ee2890def858cd9433cdbf81923d988c..8180d2a9ddf0ca05d57d1693b8521bf6f90df17e 100644 (file)
  *
  */
 
+#include <random>
 #include <algorithm>
 #include <cstring>
 #include <chrono>
@@ -151,6 +152,8 @@ using std::set;
 using std::min;
 using std::max;
 using std::copy;
+using std::random_device;
+using std::mt19937;
 
 enum Criterion {
     CRITERION_THROUGHPUT,
@@ -731,7 +734,9 @@ int main(int argc, char **argv) {
             count++;
             cout << "." << std::flush;
             vector<unsigned> sv(s.begin(), s.end());
-            random_shuffle(sv.begin(), sv.end());
+            random_device rng;
+            mt19937 urng(rng());
+            shuffle(sv.begin(), sv.end(), urng);
             unsigned groups = factor_max + 1;
             for (unsigned current_group = 0; current_group < groups;
                  current_group++) {
index ff1149a9971884ed3e22f903566585ce93813ec1..89497d3d13e09dcb08ff1685b35361090433e024 100644 (file)
@@ -251,7 +251,7 @@ really_inline SuperVector<16> SuperVector<16>::eq(SuperVector<16> const &b) cons
 template <>
 really_inline typename SuperVector<16>::movemask_type SuperVector<16>::movemask(void) const
 {
-    SuperVector powers{0x8040201008040201UL};
+    SuperVector powers = SuperVector::dup_u64(0x8040201008040201UL);
 
     // Compute the mask from the input
     uint8x16_t mask  = (uint8x16_t) vpaddlq_u32(vpaddlq_u16(vpaddlq_u8(vandq_u8(u.u8x16[0], powers.u.u8x16[0]))));