Mercurial > public > mercurial-scm > hg
comparison contrib/python-zstandard/zstd/common/compiler.h @ 43994:de7838053207
zstandard: vendor python-zstandard 0.13.0
Version 0.13.0 of the package was just released. It contains
an upgraded zstd C library which can result in some performance
wins, official support for Python 3.8, and a blackened code base.
There were no meaningful code or functionality changes in this
release of python-zstandard: just reformatting and an upgraded
zstd library version. So the diff seems much larger than what it
is.
Files were added without modifications.
The clang-format-ignorelist file was updated to reflect a new
header file in the zstd distribution.
# no-check-commit because 3rd party code has different style guidelines
Differential Revision: https://phab.mercurial-scm.org/D7770
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 28 Dec 2019 09:55:45 -0800 |
parents | 69de49c4e39c |
children |
comparison
equal
deleted
inserted
replaced
43993:873d0fecb9a3 | 43994:de7838053207 |
---|---|
57 */ | 57 */ |
58 #if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 8 && __GNUC__ < 5 | 58 #if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 8 && __GNUC__ < 5 |
59 # define HINT_INLINE static INLINE_KEYWORD | 59 # define HINT_INLINE static INLINE_KEYWORD |
60 #else | 60 #else |
61 # define HINT_INLINE static INLINE_KEYWORD FORCE_INLINE_ATTR | 61 # define HINT_INLINE static INLINE_KEYWORD FORCE_INLINE_ATTR |
62 #endif | |
63 | |
64 /* UNUSED_ATTR tells the compiler it is okay if the function is unused. */ | |
65 #if defined(__GNUC__) | |
66 # define UNUSED_ATTR __attribute__((unused)) | |
67 #else | |
68 # define UNUSED_ATTR | |
62 #endif | 69 #endif |
63 | 70 |
64 /* force no inlining */ | 71 /* force no inlining */ |
65 #ifdef _MSC_VER | 72 #ifdef _MSC_VER |
66 # define FORCE_NOINLINE static __declspec(noinline) | 73 # define FORCE_NOINLINE static __declspec(noinline) |
125 for (_pos=0; _pos<_size; _pos+=CACHELINE_SIZE) { \ | 132 for (_pos=0; _pos<_size; _pos+=CACHELINE_SIZE) { \ |
126 PREFETCH_L2(_ptr + _pos); \ | 133 PREFETCH_L2(_ptr + _pos); \ |
127 } \ | 134 } \ |
128 } | 135 } |
129 | 136 |
130 /* vectorization */ | 137 /* vectorization |
138 * older GCC (pre gcc-4.3 picked as the cutoff) uses a different syntax */ | |
131 #if !defined(__clang__) && defined(__GNUC__) | 139 #if !defined(__clang__) && defined(__GNUC__) |
132 # define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize"))) | 140 # if (__GNUC__ == 4 && __GNUC_MINOR__ > 3) || (__GNUC__ >= 5) |
141 # define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize"))) | |
142 # else | |
143 # define DONT_VECTORIZE _Pragma("GCC optimize(\"no-tree-vectorize\")") | |
144 # endif | |
133 #else | 145 #else |
134 # define DONT_VECTORIZE | 146 # define DONT_VECTORIZE |
135 #endif | 147 #endif |
136 | 148 |
137 /* disable warnings */ | 149 /* disable warnings */ |