]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
fix rtruffle, was failing Lbr and a few ReverseTruffle tests
authorKonstantinos Margaritis <markos@freevec.org>
Mon, 5 Jul 2021 10:06:12 +0000 (13:06 +0300)
committerKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Tue, 12 Oct 2021 08:51:34 +0000 (11:51 +0300)
src/nfa/truffle.cpp
src/nfa/truffle_simd.hpp

index 1e270a51dd30830e6565e600bdd36bc9893143fd..4df1b5782ea4cd2188a4e7b3ee43579e5df7c1e2 100644 (file)
@@ -37,7 +37,6 @@
 #include "util/arch.h"
 #include "util/bitutils.h"
 
-
 #if !defined(HAVE_SVE)
 #include "truffle_simd.hpp"
 
index 943b1818e03753924886205d5ea465ee3e176d62..2105633740741e6108d1a38e6f89f17704b8b76b 100644 (file)
@@ -145,7 +145,6 @@ const u8 *truffleExecReal(SuperVector<S> shuf_mask_lo_highclear, SuperVector<S>
     }
     
     return rv;
-
 }
 
 
@@ -157,7 +156,6 @@ static really_inline const u8 *truffleRevMini(SuperVector<S> shuf_mask_lo_highcl
     
     SuperVector<S> chars = SuperVector<S>::loadu(buf); 
 
-
     u32 mask = (0xffff >> (16 - len)) ^ 0xffff;
     
     typename SuperVector<S>::movemask_type z = block(shuf_mask_lo_highclear, shuf_mask_lo_highset, chars);
@@ -215,21 +213,18 @@ const u8 *rtruffleExecReal(SuperVector<S> shuf_mask_lo_highclear, SuperVector<S>
             rv = revBlock(wide_shuf_mask_lo_highclear, wide_shuf_mask_lo_highset, chars, d);
             if (rv) return rv;
         }
-
-        
     }
 
-    DEBUG_PRINTF("d %p e %p \n", buf, d);
+    DEBUG_PRINTF("tail: d %p e %p \n", buf, d);
     // finish off tail
 
     if (d != buf) {
         rv = truffleRevMini(shuf_mask_lo_highclear, shuf_mask_lo_highset, buf, d);
         DEBUG_PRINTF("rv %p \n", rv);
-        if (rv != d - 1) return rv;
+        if (rv) return rv;
     }
     
-    return buf;
-
+    return buf - 1;
 }