]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
updated code comments, based on @terrelln review 1316/head
authorYann Collet <cyan@fb.com>
Thu, 13 Sep 2018 23:44:04 +0000 (16:44 -0700)
committerYann Collet <cyan@fb.com>
Thu, 13 Sep 2018 23:44:04 +0000 (16:44 -0700)
lib/common/compiler.h
lib/decompress/zstd_decompress.c

index 31eb1ccdf5df3083b4bca74765a1d4438bb1baeb..07f875e4d38e06996eeb01d427cbe640cf8b0724 100644 (file)
 #endif
 
 /* prefetch
- * can be disabled, by declaring NO_PREFETCH macro */
+ * can be disabled, by declaring NO_PREFETCH macro
+ * All prefetch invocations use a single default locality 2,
+ * generating instruction prefetcht1,
+ * which, according to Intel, means "load data into L2 cache".
+ * This is a good enough "middle ground" for the time being,
+ * though in theory, it would be better to specialize locality depending on data being prefetched.
+ * Tests could not determine any sensible difference based on locality value. */
 #if defined(NO_PREFETCH)
 #  define PREFETCH(ptr)     (void)(ptr)  /* disabled */
 #else
index 9d7408336b61f1461f97aa7f4df3dc335b8555d6..1382c9c7f13059e8cdbc08df4c728613446991ec 100644 (file)
@@ -56,7 +56,8 @@
 *  Dependencies
 *********************************************************/
 #include <string.h>      /* memcpy, memmove, memset */
-#include "cpu.h"         /* prefetch */
+#include "compiler.h"    /* prefetch */
+#include "cpu.h"         /* bmi2 */
 #include "mem.h"         /* low level memory routines */
 #define FSE_STATIC_LINKING_ONLY
 #include "fse.h"