]> git.sesse.net Git - plocate/blobdiff - plocate.cpp
Move exception shifting to later; allows us to get it into SSE2.
[plocate] / plocate.cpp
index fc8c4becdbde9f77f8490eef8a8e953426206b9b..2c5514ee8b16bc5f3c8461a0c97821e6a2216987 100644 (file)
@@ -10,6 +10,7 @@
 #include <fcntl.h>
 #include <functional>
 #include <getopt.h>
+#include <limits.h>
 #include <memory>
 #include <stdio.h>
 #include <string.h>
@@ -25,6 +26,8 @@ using namespace std::chrono;
 #define dprintf(...)
 //#define dprintf(...) fprintf(stderr, __VA_ARGS__);
 
+#include "turbopfor.h"
+
 const char *dbpath = "/var/lib/mlocate/plocate.db";
 bool print_nul = false;
 
@@ -388,7 +391,7 @@ void do_search_file(const vector<string> &needles, const char *filename)
                        unsigned char *pldata = reinterpret_cast<unsigned char *>(s.data());
                        if (in1.empty()) {
                                in1.resize(num + 128);
-                               p4nd1dec128v32(pldata, num, &in1[0]);
+                               decode_pfor_delta1<128>(pldata, num, /*interleaved=*/true, &in1[0]);
                                in1.resize(num);
                                dprintf("trigram '%c%c%c' (%zu bytes) decoded to %zu entries\n", trgm & 0xff,
                                        (trgm >> 8) & 0xff, (trgm >> 16) & 0xff, len, num);
@@ -396,7 +399,7 @@ void do_search_file(const vector<string> &needles, const char *filename)
                                if (in2.size() < num + 128) {
                                        in2.resize(num + 128);
                                }
-                               p4nd1dec128v32(pldata, num, &in2[0]);
+                               decode_pfor_delta1<128>(pldata, num, /*interleaved=*/true, &in2[0]);
 
                                out.clear();
                                set_intersection(in1.begin(), in1.end(), in2.begin(), in2.begin() + num,