@revizly/sharp-libvips-dev 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/include/aom/aom_encoder.h +1 -0
- package/include/fribidi/fribidi-config.h +2 -2
- package/include/hwy/abort.h +28 -0
- package/include/hwy/aligned_allocator.h +48 -1
- package/include/hwy/base.h +235 -34
- package/include/hwy/detect_compiler_arch.h +84 -10
- package/include/hwy/detect_targets.h +95 -29
- package/include/hwy/foreach_target.h +12 -1
- package/include/hwy/highway.h +205 -50
- package/include/hwy/ops/arm_neon-inl.h +841 -99
- package/include/hwy/ops/arm_sve-inl.h +413 -141
- package/include/hwy/ops/emu128-inl.h +373 -360
- package/include/hwy/ops/generic_ops-inl.h +804 -401
- package/include/hwy/ops/inside-inl.h +691 -0
- package/include/hwy/ops/ppc_vsx-inl.h +456 -166
- package/include/hwy/ops/rvv-inl.h +537 -249
- package/include/hwy/ops/scalar-inl.h +169 -79
- package/include/hwy/ops/set_macros-inl.h +106 -18
- package/include/hwy/ops/shared-inl.h +23 -0
- package/include/hwy/ops/wasm_128-inl.h +130 -108
- package/include/hwy/ops/x86_128-inl.h +1892 -577
- package/include/hwy/ops/x86_256-inl.h +625 -184
- package/include/hwy/ops/x86_512-inl.h +733 -131
- package/include/hwy/targets.h +22 -21
- package/include/hwy/timer-inl.h +3 -3
- package/include/hwy/timer.h +5 -1
- package/include/libpng16/pnglibconf.h +1 -1
- package/include/libxml2/libxml/HTMLparser.h +12 -19
- package/include/libxml2/libxml/c14n.h +1 -12
- package/include/libxml2/libxml/debugXML.h +1 -1
- package/include/libxml2/libxml/encoding.h +9 -0
- package/include/libxml2/libxml/entities.h +12 -1
- package/include/libxml2/libxml/hash.h +19 -0
- package/include/libxml2/libxml/list.h +2 -2
- package/include/libxml2/libxml/nanohttp.h +17 -0
- package/include/libxml2/libxml/parser.h +60 -54
- package/include/libxml2/libxml/parserInternals.h +9 -1
- package/include/libxml2/libxml/pattern.h +6 -0
- package/include/libxml2/libxml/tree.h +32 -12
- package/include/libxml2/libxml/uri.h +11 -0
- package/include/libxml2/libxml/valid.h +29 -2
- package/include/libxml2/libxml/xinclude.h +7 -0
- package/include/libxml2/libxml/xmlIO.h +21 -4
- package/include/libxml2/libxml/xmlerror.h +14 -0
- package/include/libxml2/libxml/xmlexports.h +111 -15
- package/include/libxml2/libxml/xmlmemory.h +8 -45
- package/include/libxml2/libxml/xmlreader.h +2 -0
- package/include/libxml2/libxml/xmlsave.h +5 -0
- package/include/libxml2/libxml/xmlunicode.h +165 -1
- package/include/libxml2/libxml/xmlversion.h +6 -170
- package/include/libxml2/libxml/xmlwriter.h +1 -0
- package/include/libxml2/libxml/xpath.h +4 -0
- package/include/pango-1.0/pango/pango-features.h +3 -3
- package/include/pango-1.0/pango/pango-item.h +4 -2
- package/include/pango-1.0/pango/pango-version-macros.h +25 -0
- package/include/pango-1.0/pango/pangofc-font.h +2 -1
- package/include/pnglibconf.h +1 -1
- package/include/zconf.h +1 -1
- package/include/zlib.h +14 -14
- package/package.json +1 -1
- package/versions.json +8 -8
|
@@ -73,7 +73,11 @@
|
|
|
73
73
|
// https://github.com/simd-everywhere/simde/blob/47d6e603de9d04ee05cdfbc57cf282a02be1bf2a/simde/simde-detect-clang.h#L59.
|
|
74
74
|
// Please send updates below to them as well, thanks!
|
|
75
75
|
#if defined(__apple_build_version__) || __clang_major__ >= 999
|
|
76
|
-
#if
|
|
76
|
+
#if __has_warning("-Woverriding-option")
|
|
77
|
+
#define HWY_COMPILER_CLANG 1801
|
|
78
|
+
// No new warnings in 17.0, and Apple LLVM 15.3, which should be 1600, already
|
|
79
|
+
// has the unsafe_buffer_usage attribute, so we instead check for new builtins.
|
|
80
|
+
#elif __has_builtin(__builtin_nondeterministic_value)
|
|
77
81
|
#define HWY_COMPILER_CLANG 1700
|
|
78
82
|
#elif __has_attribute(nouwtable) // no new warnings in 16.0
|
|
79
83
|
#define HWY_COMPILER_CLANG 1600
|
|
@@ -115,7 +119,8 @@
|
|
|
115
119
|
#define HWY_COMPILER3_CLANG 0
|
|
116
120
|
#endif
|
|
117
121
|
|
|
118
|
-
#if HWY_COMPILER_GCC && !HWY_COMPILER_CLANG && !HWY_COMPILER_ICC
|
|
122
|
+
#if HWY_COMPILER_GCC && !HWY_COMPILER_CLANG && !HWY_COMPILER_ICC && \
|
|
123
|
+
!HWY_COMPILER_ICX
|
|
119
124
|
#define HWY_COMPILER_GCC_ACTUAL HWY_COMPILER_GCC
|
|
120
125
|
#else
|
|
121
126
|
#define HWY_COMPILER_GCC_ACTUAL 0
|
|
@@ -123,17 +128,20 @@
|
|
|
123
128
|
|
|
124
129
|
// More than one may be nonzero, but we want at least one.
|
|
125
130
|
#if 0 == (HWY_COMPILER_MSVC + HWY_COMPILER_CLANGCL + HWY_COMPILER_ICC + \
|
|
126
|
-
HWY_COMPILER_GCC + HWY_COMPILER_CLANG)
|
|
131
|
+
HWY_COMPILER_ICX + HWY_COMPILER_GCC + HWY_COMPILER_CLANG)
|
|
127
132
|
#error "Unsupported compiler"
|
|
128
133
|
#endif
|
|
129
134
|
|
|
130
|
-
// We should only detect one of these (only clang/clangcl overlap)
|
|
131
|
-
#if 1 <
|
|
132
|
-
|
|
133
|
-
|
|
135
|
+
// We should only detect one of these (only clang/clangcl/icx overlap)
|
|
136
|
+
#if 1 < (!!HWY_COMPILER_MSVC + (!!HWY_COMPILER_ICC & !HWY_COMPILER_ICX) + \
|
|
137
|
+
!!HWY_COMPILER_GCC_ACTUAL + \
|
|
138
|
+
!!(HWY_COMPILER_ICX | HWY_COMPILER_CLANGCL | HWY_COMPILER_CLANG))
|
|
134
139
|
#error "Detected multiple compilers"
|
|
135
140
|
#endif
|
|
136
141
|
|
|
142
|
+
//------------------------------------------------------------------------------
|
|
143
|
+
// Compiler features and C++ version
|
|
144
|
+
|
|
137
145
|
#ifdef __has_builtin
|
|
138
146
|
#define HWY_HAS_BUILTIN(name) __has_builtin(name)
|
|
139
147
|
#else
|
|
@@ -158,6 +166,32 @@
|
|
|
158
166
|
#define HWY_HAS_FEATURE(name) 0
|
|
159
167
|
#endif
|
|
160
168
|
|
|
169
|
+
// NOTE: clang ~17 does not correctly handle wrapping __has_include in a macro.
|
|
170
|
+
|
|
171
|
+
#if HWY_COMPILER_MSVC && defined(_MSVC_LANG) && _MSVC_LANG > __cplusplus
|
|
172
|
+
#define HWY_CXX_LANG _MSVC_LANG
|
|
173
|
+
#else
|
|
174
|
+
#define HWY_CXX_LANG __cplusplus
|
|
175
|
+
#endif
|
|
176
|
+
|
|
177
|
+
#if defined(__cpp_constexpr) && __cpp_constexpr >= 201603L
|
|
178
|
+
#define HWY_CXX17_CONSTEXPR constexpr
|
|
179
|
+
#else
|
|
180
|
+
#define HWY_CXX17_CONSTEXPR
|
|
181
|
+
#endif
|
|
182
|
+
|
|
183
|
+
#if defined(__cpp_constexpr) && __cpp_constexpr >= 201304L
|
|
184
|
+
#define HWY_CXX14_CONSTEXPR constexpr
|
|
185
|
+
#else
|
|
186
|
+
#define HWY_CXX14_CONSTEXPR
|
|
187
|
+
#endif
|
|
188
|
+
|
|
189
|
+
#if HWY_CXX_LANG >= 201703L
|
|
190
|
+
#define HWY_IF_CONSTEXPR if constexpr
|
|
191
|
+
#else
|
|
192
|
+
#define HWY_IF_CONSTEXPR if
|
|
193
|
+
#endif
|
|
194
|
+
|
|
161
195
|
//------------------------------------------------------------------------------
|
|
162
196
|
// Architecture
|
|
163
197
|
|
|
@@ -233,9 +267,34 @@
|
|
|
233
267
|
#endif
|
|
234
268
|
|
|
235
269
|
#ifdef __riscv
|
|
236
|
-
#define
|
|
270
|
+
#define HWY_ARCH_RISCV 1
|
|
237
271
|
#else
|
|
238
|
-
#define
|
|
272
|
+
#define HWY_ARCH_RISCV 0
|
|
273
|
+
#endif
|
|
274
|
+
// DEPRECATED names; please use HWY_ARCH_RISCV instead.
|
|
275
|
+
#define HWY_ARCH_RVV HWY_ARCH_RISCV
|
|
276
|
+
|
|
277
|
+
#if HWY_ARCH_RISCV && defined(__riscv_xlen)
|
|
278
|
+
|
|
279
|
+
#if __riscv_xlen == 32
|
|
280
|
+
#define HWY_ARCH_RISCV_32 1
|
|
281
|
+
#else
|
|
282
|
+
#define HWY_ARCH_RISCV_32 0
|
|
283
|
+
#endif
|
|
284
|
+
|
|
285
|
+
#if __riscv_xlen == 64
|
|
286
|
+
#define HWY_ARCH_RISCV_64 1
|
|
287
|
+
#else
|
|
288
|
+
#define HWY_ARCH_RISCV_64 0
|
|
289
|
+
#endif
|
|
290
|
+
|
|
291
|
+
#else // !HWY_ARCH_RISCV || !defined(__riscv_xlen)
|
|
292
|
+
#define HWY_ARCH_RISCV_32 0
|
|
293
|
+
#define HWY_ARCH_RISCV_64 0
|
|
294
|
+
#endif // HWY_ARCH_RISCV && defined(__riscv_xlen)
|
|
295
|
+
|
|
296
|
+
#if HWY_ARCH_RISCV_32 && HWY_ARCH_RISCV_64
|
|
297
|
+
#error "Cannot have both RISCV_32 and RISCV_64"
|
|
239
298
|
#endif
|
|
240
299
|
|
|
241
300
|
#if defined(__s390x__)
|
|
@@ -247,10 +306,13 @@
|
|
|
247
306
|
// It is an error to detect multiple architectures at the same time, but OK to
|
|
248
307
|
// detect none of the above.
|
|
249
308
|
#if (HWY_ARCH_X86 + HWY_ARCH_PPC + HWY_ARCH_ARM + HWY_ARCH_ARM_OLD + \
|
|
250
|
-
HWY_ARCH_WASM +
|
|
309
|
+
HWY_ARCH_WASM + HWY_ARCH_RISCV + HWY_ARCH_S390X) > 1
|
|
251
310
|
#error "Must not detect more than one architecture"
|
|
252
311
|
#endif
|
|
253
312
|
|
|
313
|
+
//------------------------------------------------------------------------------
|
|
314
|
+
// Operating system
|
|
315
|
+
|
|
254
316
|
#if defined(_WIN32) || defined(_WIN64)
|
|
255
317
|
#define HWY_OS_WIN 1
|
|
256
318
|
#else
|
|
@@ -270,6 +332,18 @@
|
|
|
270
332
|
#define HWY_OS_APPLE 0
|
|
271
333
|
#endif
|
|
272
334
|
|
|
335
|
+
#if defined(__FreeBSD__)
|
|
336
|
+
#define HWY_OS_FREEBSD 1
|
|
337
|
+
#else
|
|
338
|
+
#define HWY_OS_FREEBSD 0
|
|
339
|
+
#endif
|
|
340
|
+
|
|
341
|
+
// It is an error to detect multiple OSes at the same time, but OK to
|
|
342
|
+
// detect none of the above.
|
|
343
|
+
#if (HWY_OS_WIN + HWY_OS_LINUX + HWY_OS_APPLE + HWY_OS_FREEBSD) > 1
|
|
344
|
+
#error "Must not detect more than one OS"
|
|
345
|
+
#endif
|
|
346
|
+
|
|
273
347
|
//------------------------------------------------------------------------------
|
|
274
348
|
// Endianness
|
|
275
349
|
|
|
@@ -62,7 +62,8 @@
|
|
|
62
62
|
// Bits 0..3 reserved (4 targets)
|
|
63
63
|
#define HWY_AVX3_SPR (1LL << 4)
|
|
64
64
|
// Bit 5 reserved (likely AVX10.2 with 256-bit vectors)
|
|
65
|
-
// Currently HWY_AVX3_DL plus a special case for CompressStore
|
|
65
|
+
// Currently HWY_AVX3_DL plus AVX512BF16 and a special case for CompressStore
|
|
66
|
+
// (10x as fast).
|
|
66
67
|
// We may later also use VPCONFLICT.
|
|
67
68
|
#define HWY_AVX3_ZEN4 (1LL << 6) // see HWY_WANT_AVX3_ZEN4 below
|
|
68
69
|
|
|
@@ -84,15 +85,22 @@
|
|
|
84
85
|
#define HWY_HIGHEST_TARGET_BIT_X86 14
|
|
85
86
|
|
|
86
87
|
// --------------------------- Arm: 15 targets (+ one fallback)
|
|
87
|
-
// Bits 15..
|
|
88
|
-
#define HWY_SVE2_128 (1LL <<
|
|
89
|
-
#define HWY_SVE_256 (1LL <<
|
|
90
|
-
|
|
91
|
-
#define
|
|
88
|
+
// Bits 15..17 reserved (3 targets)
|
|
89
|
+
#define HWY_SVE2_128 (1LL << 18) // specialized (e.g. Neoverse V2/N2/N3)
|
|
90
|
+
#define HWY_SVE_256 (1LL << 19) // specialized (Neoverse V1)
|
|
91
|
+
// Bits 20-22 reserved for later SVE (3 targets)
|
|
92
|
+
#define HWY_SVE2 (1LL << 23)
|
|
93
|
+
#define HWY_SVE (1LL << 24)
|
|
94
|
+
// Bit 25 reserved for NEON
|
|
95
|
+
#define HWY_NEON_BF16 (1LL << 26) // fp16/dot/bf16 (e.g. Neoverse V2/N2/N3)
|
|
96
|
+
// Bit 27 reserved for NEON
|
|
92
97
|
#define HWY_NEON (1LL << 28) // Implies support for AES
|
|
93
98
|
#define HWY_NEON_WITHOUT_AES (1LL << 29)
|
|
94
99
|
#define HWY_HIGHEST_TARGET_BIT_ARM 29
|
|
95
100
|
|
|
101
|
+
#define HWY_ALL_NEON (HWY_NEON_WITHOUT_AES | HWY_NEON | HWY_NEON_BF16)
|
|
102
|
+
#define HWY_ALL_SVE (HWY_SVE | HWY_SVE2 | HWY_SVE_256 | HWY_SVE2_128)
|
|
103
|
+
|
|
96
104
|
// --------------------------- RISC-V: 9 targets (+ one fallback)
|
|
97
105
|
// Bits 30..36 reserved (7 targets)
|
|
98
106
|
#define HWY_RVV (1LL << 37)
|
|
@@ -111,6 +119,8 @@
|
|
|
111
119
|
#define HWY_Z14 (1LL << 51) // Z14
|
|
112
120
|
#define HWY_HIGHEST_TARGET_BIT_PPC 51
|
|
113
121
|
|
|
122
|
+
#define HWY_ALL_PPC (HWY_PPC8 | HWY_PPC9 | HWY_PPC10)
|
|
123
|
+
|
|
114
124
|
// --------------------------- WebAssembly: 9 targets (+ one fallback)
|
|
115
125
|
// Bits 52..57 reserved (6 targets)
|
|
116
126
|
#define HWY_WASM_EMU256 (1LL << 58) // Experimental
|
|
@@ -188,7 +198,7 @@
|
|
|
188
198
|
|
|
189
199
|
// armv7be has not been tested and is not yet supported.
|
|
190
200
|
#if HWY_ARCH_ARM_V7 && HWY_IS_BIG_ENDIAN
|
|
191
|
-
#define HWY_BROKEN_ARM7_BIG_ENDIAN
|
|
201
|
+
#define HWY_BROKEN_ARM7_BIG_ENDIAN HWY_ALL_NEON
|
|
192
202
|
#else
|
|
193
203
|
#define HWY_BROKEN_ARM7_BIG_ENDIAN 0
|
|
194
204
|
#endif
|
|
@@ -199,11 +209,19 @@
|
|
|
199
209
|
#if HWY_ARCH_ARM_V7 && (__ARM_ARCH_PROFILE == 'A') && \
|
|
200
210
|
!defined(__ARM_VFPV4__) && \
|
|
201
211
|
!((__ARM_NEON_FP & 0x2 /* half-float */) && (__ARM_FEATURE_FMA == 1))
|
|
202
|
-
#define HWY_BROKEN_ARM7_WITHOUT_VFP4
|
|
212
|
+
#define HWY_BROKEN_ARM7_WITHOUT_VFP4 HWY_ALL_NEON
|
|
203
213
|
#else
|
|
204
214
|
#define HWY_BROKEN_ARM7_WITHOUT_VFP4 0
|
|
205
215
|
#endif
|
|
206
216
|
|
|
217
|
+
// HWY_NEON_BF16 requires recent compilers.
|
|
218
|
+
#if (HWY_COMPILER_CLANG != 0 && HWY_COMPILER_CLANG < 1700) || \
|
|
219
|
+
(HWY_COMPILER_GCC_ACTUAL != 0 && HWY_COMPILER_GCC_ACTUAL < 1302)
|
|
220
|
+
#define HWY_BROKEN_NEON_BF16 (HWY_NEON_BF16)
|
|
221
|
+
#else
|
|
222
|
+
#define HWY_BROKEN_NEON_BF16 0
|
|
223
|
+
#endif
|
|
224
|
+
|
|
207
225
|
// SVE[2] require recent clang or gcc versions.
|
|
208
226
|
#if (HWY_COMPILER_CLANG && HWY_COMPILER_CLANG < 1100) || \
|
|
209
227
|
(HWY_COMPILER_GCC_ACTUAL && HWY_COMPILER_GCC_ACTUAL < 1000)
|
|
@@ -247,7 +265,7 @@
|
|
|
247
265
|
(HWY_BROKEN_CLANG6 | HWY_BROKEN_32BIT | HWY_BROKEN_MSVC | \
|
|
248
266
|
HWY_BROKEN_AVX3_DL_ZEN4 | HWY_BROKEN_AVX3_SPR | \
|
|
249
267
|
HWY_BROKEN_ARM7_BIG_ENDIAN | HWY_BROKEN_ARM7_WITHOUT_VFP4 | \
|
|
250
|
-
HWY_BROKEN_SVE | HWY_BROKEN_PPC10)
|
|
268
|
+
HWY_BROKEN_NEON_BF16 | HWY_BROKEN_SVE | HWY_BROKEN_PPC10)
|
|
251
269
|
|
|
252
270
|
#endif // HWY_BROKEN_TARGETS
|
|
253
271
|
|
|
@@ -335,7 +353,10 @@
|
|
|
335
353
|
|
|
336
354
|
#if HWY_ARCH_ARM
|
|
337
355
|
|
|
338
|
-
|
|
356
|
+
// Also check compiler version as done for HWY_ATTAINABLE_SVE2 because the
|
|
357
|
+
// static target (influenced here) must be one of the attainable targets.
|
|
358
|
+
#if defined(__ARM_FEATURE_SVE2) && \
|
|
359
|
+
(HWY_COMPILER_CLANG >= 1400 || HWY_COMPILER_GCC_ACTUAL >= 1200)
|
|
339
360
|
#undef HWY_BASELINE_SVE2 // was 0, will be re-defined
|
|
340
361
|
// If user specified -msve-vector-bits=128, they assert the vector length is
|
|
341
362
|
// 128 bits and we should use the HWY_SVE2_128 (more efficient for some ops).
|
|
@@ -350,7 +371,8 @@
|
|
|
350
371
|
#endif // __ARM_FEATURE_SVE_BITS
|
|
351
372
|
#endif // __ARM_FEATURE_SVE2
|
|
352
373
|
|
|
353
|
-
#if defined(__ARM_FEATURE_SVE)
|
|
374
|
+
#if defined(__ARM_FEATURE_SVE) && \
|
|
375
|
+
(HWY_COMPILER_CLANG >= 900 || HWY_COMPILER_GCC_ACTUAL >= 800)
|
|
354
376
|
#undef HWY_BASELINE_SVE // was 0, will be re-defined
|
|
355
377
|
// See above. If user-specified vector length matches our optimization, use it.
|
|
356
378
|
#if defined(__ARM_FEATURE_SVE_BITS) && __ARM_FEATURE_SVE_BITS == 256
|
|
@@ -363,12 +385,17 @@
|
|
|
363
385
|
// GCC 4.5.4 only defines __ARM_NEON__; 5.4 defines both.
|
|
364
386
|
#if defined(__ARM_NEON__) || defined(__ARM_NEON)
|
|
365
387
|
#undef HWY_BASELINE_NEON
|
|
366
|
-
#if defined(__ARM_FEATURE_AES)
|
|
367
|
-
|
|
388
|
+
#if defined(__ARM_FEATURE_AES) && \
|
|
389
|
+
defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && \
|
|
390
|
+
defined(__ARM_FEATURE_DOTPROD) && \
|
|
391
|
+
defined(__ARM_FEATURE_BF16_VECTOR_ARITHMETIC)
|
|
392
|
+
#define HWY_BASELINE_NEON HWY_ALL_NEON
|
|
393
|
+
#elif defined(__ARM_FEATURE_AES)
|
|
394
|
+
#define HWY_BASELINE_NEON (HWY_NEON_WITHOUT_AES | HWY_NEON)
|
|
368
395
|
#else
|
|
369
396
|
#define HWY_BASELINE_NEON (HWY_NEON_WITHOUT_AES)
|
|
370
|
-
#endif
|
|
371
|
-
#endif
|
|
397
|
+
#endif // __ARM_FEATURE*
|
|
398
|
+
#endif // __ARM_NEON
|
|
372
399
|
|
|
373
400
|
#endif // HWY_ARCH_ARM
|
|
374
401
|
|
|
@@ -496,14 +523,16 @@
|
|
|
496
523
|
#define HWY_BASELINE_AVX3_ZEN4 0
|
|
497
524
|
#endif
|
|
498
525
|
|
|
499
|
-
#if HWY_BASELINE_AVX3_DL != 0 && defined(
|
|
526
|
+
#if HWY_BASELINE_AVX3_DL != 0 && defined(__AVX512BF16__) && \
|
|
527
|
+
defined(__AVX512FP16__)
|
|
500
528
|
#define HWY_BASELINE_AVX3_SPR HWY_AVX3_SPR
|
|
501
529
|
#else
|
|
502
530
|
#define HWY_BASELINE_AVX3_SPR 0
|
|
503
531
|
#endif
|
|
504
532
|
|
|
505
533
|
// RVV requires intrinsics 0.11 or later, see #1156.
|
|
506
|
-
#if
|
|
534
|
+
#if HWY_ARCH_RISCV && defined(__riscv_v_intrinsic) && \
|
|
535
|
+
__riscv_v_intrinsic >= 11000
|
|
507
536
|
#define HWY_BASELINE_RVV HWY_RVV
|
|
508
537
|
#else
|
|
509
538
|
#define HWY_BASELINE_RVV 0
|
|
@@ -548,19 +577,43 @@
|
|
|
548
577
|
#endif
|
|
549
578
|
// Defining one of HWY_COMPILE_ONLY_* will trump HWY_COMPILE_ALL_ATTAINABLE.
|
|
550
579
|
|
|
580
|
+
#ifndef HWY_HAVE_AUXV // allow override
|
|
581
|
+
#ifdef TOOLCHAIN_MISS_SYS_AUXV_H
|
|
582
|
+
#define HWY_HAVE_AUXV 0 // CMake failed to find the header
|
|
583
|
+
// glibc 2.16 added auxv, but checking for that requires features.h, and we do
|
|
584
|
+
// not want to include system headers here. Instead check for the header
|
|
585
|
+
// directly, which has been supported at least since GCC 5.4 and Clang 3.
|
|
586
|
+
#elif defined(__has_include) // note: wrapper macro fails on Clang ~17
|
|
587
|
+
// clang-format off
|
|
588
|
+
#if __has_include(<sys/auxv.h>)
|
|
589
|
+
// clang-format on
|
|
590
|
+
#define HWY_HAVE_AUXV 1 // header present
|
|
591
|
+
#else
|
|
592
|
+
#define HWY_HAVE_AUXV 0 // header not present
|
|
593
|
+
#endif // __has_include
|
|
594
|
+
#else // compiler lacks __has_include
|
|
595
|
+
#define HWY_HAVE_AUXV 0
|
|
596
|
+
#endif
|
|
597
|
+
#endif // HWY_HAVE_AUXV
|
|
598
|
+
|
|
599
|
+
// Allow opting out, and without a guarantee of success, opting-in.
|
|
600
|
+
#ifndef HWY_HAVE_RUNTIME_DISPATCH
|
|
551
601
|
// Clang, GCC and MSVC allow runtime dispatch on x86.
|
|
552
602
|
#if HWY_ARCH_X86
|
|
553
603
|
#define HWY_HAVE_RUNTIME_DISPATCH 1
|
|
554
|
-
// On Arm
|
|
555
|
-
//
|
|
556
|
-
#elif (HWY_ARCH_ARM || HWY_ARCH_PPC || HWY_ARCH_S390X) &&
|
|
557
|
-
(HWY_COMPILER_GCC_ACTUAL ||
|
|
558
|
-
|
|
559
|
-
|
|
604
|
+
// On Arm, PPC, S390X, and RISC-V: GCC and Clang 17+ do, and we require Linux
|
|
605
|
+
// to detect CPU capabilities.
|
|
606
|
+
#elif (HWY_ARCH_ARM || HWY_ARCH_PPC || HWY_ARCH_S390X || HWY_ARCH_RISCV) && \
|
|
607
|
+
(HWY_COMPILER_GCC_ACTUAL || HWY_COMPILER_CLANG >= 1700) && HWY_OS_LINUX && \
|
|
608
|
+
HWY_HAVE_AUXV
|
|
609
|
+
#define HWY_HAVE_RUNTIME_DISPATCH 1
|
|
610
|
+
#elif HWY_ARCH_ARM_A64 && HWY_OS_APPLE && \
|
|
611
|
+
(HWY_COMPILER_GCC_ACTUAL || HWY_COMPILER_CLANG >= 1700)
|
|
560
612
|
#define HWY_HAVE_RUNTIME_DISPATCH 1
|
|
561
613
|
#else
|
|
562
614
|
#define HWY_HAVE_RUNTIME_DISPATCH 0
|
|
563
|
-
#endif
|
|
615
|
+
#endif // HWY_ARCH_*
|
|
616
|
+
#endif // HWY_HAVE_RUNTIME_DISPATCH
|
|
564
617
|
|
|
565
618
|
// AVX3_DL is not widely available yet. To reduce code size and compile time,
|
|
566
619
|
// only include it in the set of attainable targets (for dynamic dispatch) if
|
|
@@ -572,22 +625,26 @@
|
|
|
572
625
|
#endif
|
|
573
626
|
|
|
574
627
|
#if HWY_ARCH_ARM_A64 && HWY_HAVE_RUNTIME_DISPATCH
|
|
575
|
-
#define HWY_ATTAINABLE_NEON
|
|
628
|
+
#define HWY_ATTAINABLE_NEON HWY_ALL_NEON
|
|
576
629
|
#elif HWY_ARCH_ARM // static dispatch, or HWY_ARCH_ARM_V7
|
|
577
630
|
#define HWY_ATTAINABLE_NEON (HWY_BASELINE_NEON)
|
|
578
631
|
#else
|
|
579
632
|
#define HWY_ATTAINABLE_NEON 0
|
|
580
633
|
#endif
|
|
581
634
|
|
|
582
|
-
#if HWY_ARCH_ARM_A64 &&
|
|
583
|
-
|
|
635
|
+
#if HWY_ARCH_ARM_A64 && \
|
|
636
|
+
(HWY_COMPILER_CLANG >= 900 || HWY_COMPILER_GCC_ACTUAL >= 800) && \
|
|
637
|
+
(HWY_HAVE_RUNTIME_DISPATCH || \
|
|
638
|
+
(HWY_ENABLED_BASELINE & (HWY_SVE | HWY_SVE_256)))
|
|
584
639
|
#define HWY_ATTAINABLE_SVE (HWY_SVE | HWY_SVE_256)
|
|
585
640
|
#else
|
|
586
641
|
#define HWY_ATTAINABLE_SVE 0
|
|
587
642
|
#endif
|
|
588
643
|
|
|
589
|
-
#if HWY_ARCH_ARM_A64 &&
|
|
590
|
-
|
|
644
|
+
#if HWY_ARCH_ARM_A64 && \
|
|
645
|
+
(HWY_COMPILER_CLANG >= 1400 || HWY_COMPILER_GCC_ACTUAL >= 1200) && \
|
|
646
|
+
(HWY_HAVE_RUNTIME_DISPATCH || \
|
|
647
|
+
(HWY_ENABLED_BASELINE & (HWY_SVE2 | HWY_SVE2_128)))
|
|
591
648
|
#define HWY_ATTAINABLE_SVE2 (HWY_SVE2 | HWY_SVE2_128)
|
|
592
649
|
#else
|
|
593
650
|
#define HWY_ATTAINABLE_SVE2 0
|
|
@@ -617,6 +674,12 @@
|
|
|
617
674
|
#define HWY_ATTAINABLE_S390X 0
|
|
618
675
|
#endif
|
|
619
676
|
|
|
677
|
+
#if HWY_ARCH_RISCV && HWY_HAVE_RUNTIME_DISPATCH
|
|
678
|
+
#define HWY_ATTAINABLE_RISCV (HWY_RVV)
|
|
679
|
+
#else
|
|
680
|
+
#define HWY_ATTAINABLE_RISCV 0
|
|
681
|
+
#endif
|
|
682
|
+
|
|
620
683
|
// Attainable means enabled and the compiler allows intrinsics (even when not
|
|
621
684
|
// allowed to autovectorize). Used in 3 and 4.
|
|
622
685
|
#if HWY_ARCH_X86
|
|
@@ -640,6 +703,9 @@
|
|
|
640
703
|
#elif HWY_ARCH_S390X
|
|
641
704
|
#define HWY_ATTAINABLE_TARGETS \
|
|
642
705
|
HWY_ENABLED(HWY_BASELINE_SCALAR | HWY_ATTAINABLE_S390X)
|
|
706
|
+
#elif HWY_ARCH_RVV
|
|
707
|
+
#define HWY_ATTAINABLE_TARGETS \
|
|
708
|
+
HWY_ENABLED(HWY_BASELINE_SCALAR | HWY_ATTAINABLE_RISCV)
|
|
643
709
|
#else
|
|
644
710
|
#define HWY_ATTAINABLE_TARGETS (HWY_ENABLED_BASELINE)
|
|
645
711
|
#endif // HWY_ARCH_*
|
|
@@ -168,6 +168,17 @@
|
|
|
168
168
|
#endif
|
|
169
169
|
#endif
|
|
170
170
|
|
|
171
|
+
#if (HWY_TARGETS & HWY_NEON_BF16) && (HWY_STATIC_TARGET != HWY_NEON_BF16)
|
|
172
|
+
#undef HWY_TARGET
|
|
173
|
+
#define HWY_TARGET HWY_NEON_BF16
|
|
174
|
+
#include HWY_TARGET_INCLUDE
|
|
175
|
+
#ifdef HWY_TARGET_TOGGLE
|
|
176
|
+
#undef HWY_TARGET_TOGGLE
|
|
177
|
+
#else
|
|
178
|
+
#define HWY_TARGET_TOGGLE
|
|
179
|
+
#endif
|
|
180
|
+
#endif
|
|
181
|
+
|
|
171
182
|
#if (HWY_TARGETS & HWY_SVE) && (HWY_STATIC_TARGET != HWY_SVE)
|
|
172
183
|
#undef HWY_TARGET
|
|
173
184
|
#define HWY_TARGET HWY_SVE
|
|
@@ -295,7 +306,7 @@
|
|
|
295
306
|
#endif
|
|
296
307
|
#endif
|
|
297
308
|
|
|
298
|
-
// ------------------------------
|
|
309
|
+
// ------------------------------ HWY_ARCH_RISCV
|
|
299
310
|
|
|
300
311
|
#if (HWY_TARGETS & HWY_RVV) && (HWY_STATIC_TARGET != HWY_RVV)
|
|
301
312
|
#undef HWY_TARGET
|