Cleanups from recent changes
authorEric Biggers <ebiggers3@gmail.com>
Mon, 29 Dec 2014 02:03:09 +0000 (20:03 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Mon, 29 Dec 2014 02:06:56 +0000 (20:06 -0600)
NEWS
src/lzms_common.c
src/lzms_decompress.c
src/lzx_common.c

diff --git a/NEWS b/NEWS
index b5f7be5..e73e935 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,6 @@
 Version 1.7.4-BETA:
-       The Windows binary distribution no longer contain third party DLLs.
-       These dependencies are instead compiled directly into libwim.dll.
+       The Windows binary distribution no longer contains third party DLLs.
+       These dependencies are instead compiled directly into the libwim DLL.
 
        Added more fixes for wimlib on non-x86 architectures such as ARM.
 
index fccc566..117e2f3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * lzms-common.c - Common code for LZMS compression and decompression
+ * lzms_common.c - Common code for LZMS compression and decompression
  */
 
 /*
index 3be7cd1..8cb096f 100644 (file)
@@ -793,7 +793,6 @@ lzms_decode_items(struct lzms_decompressor * const restrict d,
                                d->recent_delta_offsets[2] = d->recent_delta_offsets[1];
                                d->recent_delta_offsets[1] = d->recent_delta_offsets[0];
                                d->recent_delta_offsets[0] = d->pending_delta_offset;
-                               d->pending_delta_offset = 0;
                        }
                        d->pending_delta_offset = raw_offset | ((u64)power << 32);
 
index 76c73ba..bd2e097 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * lzx-common.c - Common code for LZX compression and decompression.
+ * lzx_common.c - Common code for LZX compression and decompression.
  */
 
 /*
 #  include <emmintrin.h>
 #endif
 
+#ifdef __AVX2__
+#  include <immintrin.h>
+#endif
+
 /* Mapping: offset slot => first match offset that uses that offset slot.
  */
 const u32 lzx_offset_slot_base[LZX_MAX_OFFSET_SLOTS] = {
@@ -266,7 +270,17 @@ lzx_e8_filter(u8 *data, u32 size, void (*process_target)(void *, s32))
                for (;;) {
                        u32 e8_mask;
                        u8 *orig_p = p;
-               #ifdef __SSE2__
+               #ifdef __AVX2__
+                       const __m256i e8_bytes = _mm256_set1_epi8(0xE8);
+                       for (;;) {
+                               __m256i bytes = *(const __m256i *)p;
+                               __m256i cmpresult = _mm256_cmpeq_epi8(bytes, e8_bytes);
+                               e8_mask = _mm256_movemask_epi8(cmpresult);
+                               if (e8_mask)
+                                       break;
+                               p += 32;
+                       }
+               #else
                        const __m128i e8_bytes = _mm_set1_epi8(0xE8);
                        for (;;) {
                                /* Read the next 32 bytes of data and test them
@@ -286,17 +300,6 @@ lzx_e8_filter(u8 *data, u32 size, void (*process_target)(void *, s32))
                                }
                                p += 32;
                        }
-               #else
-                       /* AVX-2  */
-                       const __m256i e8_bytes = _mm256_set1_epi8(0xE8);
-                       for (;;) {
-                               __m256i bytes = *(const __m256i *)p;
-                               __m256i cmpresult = _mm256_cmpeq_epi8(bytes, e8_bytes);
-                               e8_mask = _mm256_movemask_epi8(cmpresult);
-                               if (e8_mask)
-                                       break;
-                               p += 32;
-                       }
                #endif
 
                        /* Did we pass over data with no E8 bytes?  */