From: Yann Collet Date: Thu, 13 Sep 2018 23:44:04 +0000 (-0700) Subject: updated code comments, based on @terrelln review X-Git-Tag: v0.0.29~13^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=551240067786409fa7ac6da9ecee0505e3065bc9;p=thirdparty%2Fzstd.git updated code comments, based on @terrelln review --- diff --git a/lib/common/compiler.h b/lib/common/compiler.h index 31eb1ccdf..07f875e4d 100644 --- a/lib/common/compiler.h +++ b/lib/common/compiler.h @@ -89,7 +89,13 @@ #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 diff --git a/lib/decompress/zstd_decompress.c b/lib/decompress/zstd_decompress.c index 9d7408336..1382c9c7f 100644 --- a/lib/decompress/zstd_decompress.c +++ b/lib/decompress/zstd_decompress.c @@ -56,7 +56,8 @@ * Dependencies *********************************************************/ #include /* 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"