summaryrefslogtreecommitdiff
path: root/inffast.h
diff options
context:
space:
mode:
authorSimon Hosie <simhos01@users.noreply.github.com>2017-03-22 10:48:39 -0700
committerHans Kristian Rosbach <hk-git@circlestorm.org>2017-03-24 22:01:48 +0100
commit67f514ab48373f535290c715356693a4bf1207d3 (patch)
tree3e02aeb98de15381163ff5fcb737bfe2f250ac00 /inffast.h
parentf4b3fa7c2466b763e3dd839d63f4b9295c6f62e8 (diff)
Inflate using wider loads and stores and a minimum of branches. (#95)
* Inflate using wider loads and stores. In inflate_fast() the output pointer always has plenty of room to write. This means that so long as the target is capable, wide un-aligned loads and stores can be used to transfer several bytes at once. When the reference distance is too short simply unroll the data a little to increase the distance. Change-Id: I59854eb25d2b1e43561c8a2afaf9175bf10cf674
Diffstat (limited to 'inffast.h')
-rw-r--r--inffast.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/inffast.h b/inffast.h
index 0d75614..fdf5a18 100644
--- a/inffast.h
+++ b/inffast.h
@@ -12,4 +12,11 @@
void ZLIB_INTERNAL inflate_fast(z_stream *strm, unsigned long start);
+
+#if (defined(__GNUC__) || defined(__clang__)) && defined(__ARM_NEON__)
+# include <arm_neon.h>
+typedef uint8x16_t inffast_chunk_t;
+# define INFFAST_CHUNKSIZE sizeof(inffast_chunk_t)
+#endif
+
#endif /* INFFAST_H_ */