]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Do not use word xor (iso646 legacy)
authorNathan Moinvaziri <nathan@nathanm.com>
Fri, 19 Jun 2020 04:12:32 +0000 (21:12 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Fri, 19 Jun 2020 08:17:18 +0000 (10:17 +0200)
Co-authored-by: pps83 <pps83@users.noreply.github.com>
compare258.c

index 2b07998677debb5d6953ccd855a15a9cc6eee282..c1b74c5032237dc0fb9f1073fca758bb810bef40 100644 (file)
@@ -111,10 +111,10 @@ static inline int32_t compare256_unaligned_32_static(const unsigned char *src0,
     do {
         uint32_t sv = *(uint32_t *)src0;
         uint32_t mv = *(uint32_t *)src1;
-        uint32_t xor = sv ^ mv;
+        uint32_t diff = sv ^ mv;
 
-        if (xor) {
-            uint32_t match_byte = __builtin_ctz(xor) / 8;
+        if (diff) {
+            uint32_t match_byte = __builtin_ctz(diff) / 8;
             return (int32_t)(len + match_byte);
         }
 
@@ -151,10 +151,10 @@ static inline int32_t compare256_unaligned_64_static(const unsigned char *src0,
     do {
         uint64_t sv = *(uint64_t *)src0;
         uint64_t mv = *(uint64_t *)src1;
-        uint64_t xor = sv ^ mv;
+        uint64_t diff = sv ^ mv;
 
-        if (xor) {
-            uint64_t match_byte = __builtin_ctzll(xor) / 8;
+        if (diff) {
+            uint64_t match_byte = __builtin_ctzll(diff) / 8;
             return (int32_t)(len + match_byte);
         }