]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
Remove first check from scanDouble Noodle.
authorGeorge Wort <george.wort@arm.com>
Wed, 30 Jun 2021 13:13:27 +0000 (14:13 +0100)
committerKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Tue, 12 Oct 2021 08:51:34 +0000 (11:51 +0300)
Change-Id: I00eabb3cb06ef6a2060df52c26fa8591907a2711

src/hwlm/noodle_engine_sve.hpp

index 3c0931a80f5fb0c698f702cb6b80dd98420c0605..232e0ee033c063ae7146ae8d64620556ea7e7b21 100644 (file)
@@ -242,17 +242,12 @@ hwlm_error_t scanDouble(const struct noodTable *n, const u8 *buf, size_t len,
     assert(d < e);
     assert(d >= buf);
 
-    // Check first position in scalar so as to remove underflow possibilities.
-    size_t matchPos = d - buf;
-    DEBUG_PRINTF("Test match pos %zu\n", matchPos);
-    RETURN_IF_TERMINATED(final(n, buf, len, true, cbi, matchPos));
-    d += 2;
-    if (d >= e) {
+    if (e - d < 2) {
         return HWLM_SUCCESS;
     }
+    ++d;
 
     svuint16_t chars = getCharMaskDouble(n, noCase);
-
     // peel off first part to align to the vector size
     const u8 *d1 = ROUNDUP_PTR(d, svcntb_pat(SV_POW2));
     if (d != d1) {