about summary refs log tree commit diff
path: root/include/coverage-64.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/coverage-64.h')
-rw-r--r--include/coverage-64.h29
1 files changed, 17 insertions, 12 deletions
diff --git a/include/coverage-64.h b/include/coverage-64.h
index 54fe9d33..aab79d79 100644
--- a/include/coverage-64.h
+++ b/include/coverage-64.h
@@ -116,11 +116,12 @@ inline u32 skim(const u64 *virgin, const u64 *current, const u64 *current_end) {
     __mmask8 mask = _mm512_testn_epi64_mask(value, value);
 
     /* All bytes are zero. */
-    if (mask == 0xff) continue;
+    if (likely(mask == 0xff)) continue;
 
       /* Look for nonzero bytes and check for new bits. */
-  #define UNROLL(x) \
-    if (!(mask & (1 << x)) && classify_word(current[x]) & virgin[x]) return 1
+  #define UNROLL(x)                                                            \
+    if (unlikely(!(mask & (1 << x)) && classify_word(current[x]) & virgin[x])) \
+    return 1
     UNROLL(0);
     UNROLL(1);
     UNROLL(2);
@@ -152,13 +153,17 @@ inline u32 skim(const u64 *virgin, const u64 *current, const u64 *current_end) {
     u32     mask = _mm256_movemask_epi8(cmp);
 
     /* All bytes are zero. */
-    if (mask == (u32)-1) continue;
+    if (likely(mask == (u32)-1)) continue;
 
     /* Look for nonzero bytes and check for new bits. */
-    if (!(mask & 0xff) && classify_word(current[0]) & virgin[0]) return 1;
-    if (!(mask & 0xff00) && classify_word(current[1]) & virgin[1]) return 1;
-    if (!(mask & 0xff0000) && classify_word(current[2]) & virgin[2]) return 1;
-    if (!(mask & 0xff000000) && classify_word(current[3]) & virgin[3]) return 1;
+    if (unlikely(!(mask & 0xff) && classify_word(current[0]) & virgin[0]))
+      return 1;
+    if (unlikely(!(mask & 0xff00) && classify_word(current[1]) & virgin[1]))
+      return 1;
+    if (unlikely(!(mask & 0xff0000) && classify_word(current[2]) & virgin[2]))
+      return 1;
+    if (unlikely(!(mask & 0xff000000) && classify_word(current[3]) & virgin[3]))
+      return 1;
 
   }
 
@@ -174,10 +179,10 @@ inline u32 skim(const u64 *virgin, const u64 *current, const u64 *current_end) {
 
   for (; current < current_end; virgin += 4, current += 4) {
 
-    if (current[0] && classify_word(current[0]) & virgin[0]) return 1;
-    if (current[1] && classify_word(current[1]) & virgin[1]) return 1;
-    if (current[2] && classify_word(current[2]) & virgin[2]) return 1;
-    if (current[3] && classify_word(current[3]) & virgin[3]) return 1;
+    if (unlikely(current[0] && classify_word(current[0]) & virgin[0])) return 1;
+    if (unlikely(current[1] && classify_word(current[1]) & virgin[1])) return 1;
+    if (unlikely(current[2] && classify_word(current[2]) & virgin[2])) return 1;
+    if (unlikely(current[3] && classify_word(current[3]) & virgin[3])) return 1;
 
   }