]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
use unaligned loads for short scans 11/head
authorKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Thu, 11 Feb 2021 12:21:57 +0000 (14:21 +0200)
committerKonstantinos Margaritis <konstantinos@vectorcamp.gr>
Thu, 11 Feb 2021 12:21:57 +0000 (14:21 +0200)
src/hwlm/noodle_engine_sse.c

index fcd753fc296a306cd2c98329ee36ad1928a66360..0f14852d93a3a4eeda175f33814f2b4901f2c49f 100644 (file)
@@ -50,7 +50,7 @@ hwlm_error_t scanSingleShort(const struct noodTable *n, const u8 *buf,
         return HWLM_SUCCESS;
     }
     m128 mask128 = noCase ? caseMask : ones128();
-    m128 v = and128(load128(d), mask128);
+    m128 v = and128(loadu128(d), mask128);
 
     // mask out where we can't match
     u32 mask = (0xFFFF >> (16 - l));
@@ -103,7 +103,7 @@ hwlm_error_t scanDoubleShort(const struct noodTable *n, const u8 *buf,
 
     DEBUG_PRINTF("d %zu\n", d - buf);
     m128 mask128 = noCase ? caseMask : ones128();
-    m128 v = and128(load128(d), mask128);
+    m128 v = and128(loadu128(d), mask128);
 
     u32 z = movemask128(and128(lshiftbyte_m128(eq128(mask1, v), 1),
                                eq128(mask2, v)));