]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
fix last failing Shufti/Truffle tests
authorKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Tue, 6 Jul 2021 06:22:31 +0000 (09:22 +0300)
committerKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Tue, 12 Oct 2021 08:51:34 +0000 (11:51 +0300)
src/nfa/shufti_simd.hpp
src/nfa/truffle_simd.hpp

index bc9916b5aacc355ce47dd124686b054f08df800e..46ad3d36b8ee0da5525217331ee298aff0154b73 100644 (file)
@@ -212,7 +212,7 @@ const u8 *rshuftiExecReal(m128 mask_lo, m128 mask_hi, const u8 *buf, const u8 *b
         rv = shuftiRevSlow((const u8 *)&mask_lo, (const u8 *)&mask_hi, buf, d);
         // rv = shortShufti(wide_mask_lo, wide_mask_hi, buf_end - S, buf_end, low4bits);
         DEBUG_PRINTF("rv %p \n", rv);
-        if (rv != d - 1) return rv;
+        if (rv) return rv;
     }
     
     return buf - 1;
index 2105633740741e6108d1a38e6f89f17704b8b76b..0d57650bfe853fee5b3e903f7ef830298070a163 100644 (file)
@@ -48,10 +48,7 @@ typename SuperVector<S>::movemask_type block(SuperVector<S> shuf_mask_lo_highcle
             SuperVector<S> v){
 
     SuperVector<S> highconst = SuperVector<S>::dup_u8(0x80);
-    printv_u8("highconst", highconst);
-    
     SuperVector<S> shuf_mask_hi = SuperVector<S>::dup_u64(0x8040201008040201);
-    printv_u64("shuf_mask_hi", shuf_mask_hi);
     
     SuperVector<S> shuf1 = shuf_mask_lo_highclear.pshufb(v);
     SuperVector<S> t1 = v ^ highconst;
@@ -68,7 +65,9 @@ static really_inline const u8 *truffleMini(SuperVector<S> shuf_mask_lo_highclear
                        const u8 *buf, const u8 *buf_end){
     uintptr_t len = buf_end - buf;
     assert(len < 16);
-    SuperVector<S> chars = SuperVector<S>::loadu(buf); 
+
+    SuperVector<S> chars = SuperVector<S>::Zeroes();
+    memcpy(&chars.u.u8[0], buf, len);
 
     u32 mask = (0xffff >> (16 - len)) ^ 0xffff;
     typename SuperVector<S>::movemask_type z = block(shuf_mask_lo_highclear, shuf_mask_lo_highset, chars);
@@ -81,7 +80,6 @@ static really_inline const u8 *truffleMini(SuperVector<S> shuf_mask_lo_highclear
     }
 }
 
-
 template <uint16_t S>
 static really_inline
 const u8 *fwdBlock(SuperVector<S> shuf_mask_lo_highclear, SuperVector<S> shuf_mask_lo_highset, SuperVector<S> v,