@revizly/sharp-libvips-dev 1.0.31 → 1.0.32

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.
Files changed (54) hide show
  1. package/include/expat.h +14 -2
  2. package/include/expat_config.h +6 -3
  3. package/include/expat_external.h +3 -2
  4. package/include/glib-2.0/glib/gvarianttype.h +16 -16
  5. package/include/glib-2.0/glib/gversionmacros.h +13 -0
  6. package/include/harfbuzz/hb-cplusplus.hh +9 -1
  7. package/include/harfbuzz/hb-draw.h +52 -0
  8. package/include/harfbuzz/hb-paint.h +209 -2
  9. package/include/harfbuzz/hb-version.h +2 -2
  10. package/include/hwy/aligned_allocator.h +44 -2
  11. package/include/hwy/auto_tune.h +22 -6
  12. package/include/hwy/base.h +60 -90
  13. package/include/hwy/bit_set.h +410 -0
  14. package/include/hwy/cache_control.h +3 -2
  15. package/include/hwy/detect_compiler_arch.h +134 -14
  16. package/include/hwy/detect_targets.h +82 -36
  17. package/include/hwy/highway.h +15 -0
  18. package/include/hwy/nanobenchmark.h +12 -3
  19. package/include/hwy/ops/arm_neon-inl.h +96 -25
  20. package/include/hwy/ops/arm_sve-inl.h +250 -95
  21. package/include/hwy/ops/emu128-inl.h +12 -7
  22. package/include/hwy/ops/generic_ops-inl.h +271 -131
  23. package/include/hwy/ops/loongarch_lasx-inl.h +31 -9
  24. package/include/hwy/ops/loongarch_lsx-inl.h +33 -12
  25. package/include/hwy/ops/ppc_vsx-inl.h +99 -19
  26. package/include/hwy/ops/rvv-inl.h +239 -130
  27. package/include/hwy/ops/scalar-inl.h +22 -7
  28. package/include/hwy/ops/set_macros-inl.h +158 -107
  29. package/include/hwy/ops/wasm_128-inl.h +13 -22
  30. package/include/hwy/ops/x86_128-inl.h +223 -120
  31. package/include/hwy/ops/x86_256-inl.h +70 -134
  32. package/include/hwy/ops/x86_512-inl.h +130 -134
  33. package/include/hwy/print-inl.h +2 -0
  34. package/include/hwy/profiler.h +355 -264
  35. package/include/hwy/robust_statistics.h +3 -1
  36. package/include/hwy/timer.h +44 -0
  37. package/include/lcms2.h +34 -4
  38. package/include/libexif/exif-utils.h +1 -1
  39. package/include/libheif/heif_context.h +13 -0
  40. package/include/libheif/heif_sequences.h +12 -2
  41. package/include/libheif/heif_uncompressed.h +14 -10
  42. package/include/libheif/heif_uncompressed_types.h +27 -27
  43. package/include/libpng16/png.h +7 -7
  44. package/include/libpng16/pngconf.h +1 -1
  45. package/include/libpng16/pnglibconf.h +1 -1
  46. package/include/libxml2/libxml/xmlversion.h +4 -4
  47. package/include/png.h +7 -7
  48. package/include/pngconf.h +1 -1
  49. package/include/pnglibconf.h +1 -1
  50. package/include/tiffconf.h +9 -10
  51. package/include/tiffio.h +9 -9
  52. package/include/tiffvers.h +1 -1
  53. package/package.json +1 -1
  54. package/versions.json +10 -10
@@ -25,7 +25,18 @@
25
25
 
26
26
  #include "hwy/aligned_allocator.h" // Span
27
27
  #include "hwy/base.h" // HWY_MIN
28
- #include "hwy/contrib/sort/vqsort.h"
28
+
29
+ // configuration to allow auto_tune to use std::sort instead of VQSort
30
+ // (also enabled in header only mode).
31
+ #if defined(HWY_HEADER_ONLY)
32
+ #define HWY_AUTOTUNE_STDSORT
33
+ #endif
34
+
35
+ #ifdef HWY_AUTOTUNE_STDSORT
36
+ #include <algorithm> // std::sort
37
+ #else
38
+ #include "hwy/contrib/sort/vqsort.h" // VQSort
39
+ #endif
29
40
 
30
41
  // Infrastructure for auto-tuning (choosing optimal parameters at runtime).
31
42
 
@@ -104,6 +115,10 @@ class CostDistribution {
104
115
  private:
105
116
  static double Median(double* to_sort, size_t n) {
106
117
  HWY_DASSERT(n >= 2);
118
+
119
+ #ifdef HWY_AUTOTUNE_STDSORT
120
+ std::sort(to_sort, to_sort + n);
121
+ #else
107
122
  // F64 is supported everywhere except Armv7.
108
123
  #if !HWY_ARCH_ARM_V7
109
124
  VQSort(to_sort, n, SortAscending());
@@ -112,6 +127,8 @@ class CostDistribution {
112
127
  // equivalent.
113
128
  VQSort(reinterpret_cast<uint64_t*>(to_sort), n, SortAscending());
114
129
  #endif
130
+ #endif
131
+
115
132
  if (n & 1) return to_sort[n / 2];
116
133
  // Even length: average of two middle elements.
117
134
  return (to_sort[n / 2] + to_sort[n / 2 - 1]) * 0.5;
@@ -405,10 +422,9 @@ class AutoTune {
405
422
  const Config* Best() const { return best_; }
406
423
 
407
424
  // If false, caller must call `SetCandidates` before `NextConfig`.
408
- bool HasCandidates() const {
409
- HWY_DASSERT(!Best());
410
- return !candidates_.empty();
411
- }
425
+ // NOTE: also called after Best() is non-null.
426
+ bool HasCandidates() const { return !candidates_.empty(); }
427
+
412
428
  // WARNING: invalidates `Best()`, do not call if that is non-null.
413
429
  void SetCandidates(std::vector<Config> candidates) {
414
430
  HWY_DASSERT(!Best() && !HasCandidates());
@@ -429,7 +445,7 @@ class AutoTune {
429
445
 
430
446
  // Returns the current `Config` to measure.
431
447
  const Config& NextConfig() const {
432
- HWY_DASSERT(!Best() && HasCandidates());
448
+ HWY_DASSERT(HasCandidates());
433
449
  return candidates_[config_idx_];
434
450
  }
435
451
 
@@ -22,8 +22,8 @@
22
22
  #include <stddef.h>
23
23
  #include <stdint.h>
24
24
  #if defined(HWY_HEADER_ONLY)
25
- #include <cstdarg>
26
- #include <cstdio>
25
+ #include <stdarg.h>
26
+ #include <stdio.h>
27
27
  #endif
28
28
 
29
29
  #if !defined(HWY_NO_LIBCXX)
@@ -33,9 +33,10 @@
33
33
  #include "hwy/detect_compiler_arch.h"
34
34
  #include "hwy/highway_export.h"
35
35
 
36
- // API version (https://semver.org/); keep in sync with CMakeLists.txt.
36
+ // API version (https://semver.org/); keep in sync with CMakeLists.txt and
37
+ // meson.build.
37
38
  #define HWY_MAJOR 1
38
- #define HWY_MINOR 3
39
+ #define HWY_MINOR 4
39
40
  #define HWY_PATCH 0
40
41
 
41
42
  // True if the Highway version >= major.minor.0. Added in 1.2.0.
@@ -57,7 +58,7 @@
57
58
 
58
59
  #endif // !HWY_IDE
59
60
 
60
- #if (HWY_ARCH_X86 && !defined(HWY_NO_LIBCXX)) || HWY_COMPILER_MSVC
61
+ #if !defined(HWY_NO_LIBCXX) || HWY_COMPILER_MSVC
61
62
  #include <atomic>
62
63
  #endif
63
64
 
@@ -148,6 +149,21 @@
148
149
 
149
150
  #endif // !HWY_COMPILER_MSVC
150
151
 
152
+ #if (HWY_COMPILER_GCC_ACTUAL && HWY_COMPILER_GCC_ACTUAL < 1200) || \
153
+ (HWY_COMPILER_ICC && !HWY_COMPILER_ICX)
154
+ // The use of __attribute__((unused)) in private class member variables triggers
155
+ // a compiler warning with GCC 11 and earlier and ICC
156
+
157
+ // GCC 11 and earlier and ICC also do not emit -Wunused-private-field warnings
158
+ // for unused private class member variables
159
+ #define HWY_MEMBER_VAR_MAYBE_UNUSED
160
+ #else
161
+ // Clang and ICX need __attribute__((unused)) in unused private class member
162
+ // variables to suppress -Wunused-private-field warnings unless this warning is
163
+ // ignored by using HWY_DIAGNOSTICS_OFF
164
+ #define HWY_MEMBER_VAR_MAYBE_UNUSED HWY_MAYBE_UNUSED
165
+ #endif
166
+
151
167
  //------------------------------------------------------------------------------
152
168
  // Builtin/attributes (no more #include after this point due to namespace!)
153
169
 
@@ -202,7 +218,9 @@ namespace hwy {
202
218
  //------------------------------------------------------------------------------
203
219
  // Macros
204
220
 
205
- #define HWY_API static HWY_INLINE HWY_FLATTEN HWY_MAYBE_UNUSED
221
+ // Note: it is safe to remove `static` for users who want to use modules, but
222
+ // that might be a breaking change for some users, hence we do not by default.
223
+ #define HWY_API static HWY_INLINE HWY_FLATTEN
206
224
 
207
225
  #define HWY_CONCAT_IMPL(a, b) a##b
208
226
  #define HWY_CONCAT(a, b) HWY_CONCAT_IMPL(a, b)
@@ -349,60 +367,20 @@ HWY_DLLEXPORT HWY_NORETURN void HWY_FORMAT(3, 4)
349
367
  } while (0)
350
368
  #define HWY_ASSERT(condition) HWY_ASSERT_M(condition, "")
351
369
 
352
- #if HWY_HAS_FEATURE(memory_sanitizer) || defined(MEMORY_SANITIZER) || \
353
- defined(__SANITIZE_MEMORY__)
354
- #define HWY_IS_MSAN 1
355
- #else
356
- #define HWY_IS_MSAN 0
357
- #endif
358
-
359
- #if HWY_HAS_FEATURE(address_sanitizer) || defined(ADDRESS_SANITIZER) || \
360
- defined(__SANITIZE_ADDRESS__)
361
- #define HWY_IS_ASAN 1
362
- #else
363
- #define HWY_IS_ASAN 0
364
- #endif
365
-
366
- #if HWY_HAS_FEATURE(hwaddress_sanitizer) || defined(HWADDRESS_SANITIZER) || \
367
- defined(__SANITIZE_HWADDRESS__)
368
- #define HWY_IS_HWASAN 1
369
- #else
370
- #define HWY_IS_HWASAN 0
371
- #endif
372
-
373
- #if HWY_HAS_FEATURE(thread_sanitizer) || defined(THREAD_SANITIZER) || \
374
- defined(__SANITIZE_THREAD__)
375
- #define HWY_IS_TSAN 1
376
- #else
377
- #define HWY_IS_TSAN 0
378
- #endif
379
-
380
- #if HWY_HAS_FEATURE(undefined_behavior_sanitizer) || \
381
- defined(UNDEFINED_BEHAVIOR_SANITIZER)
382
- #define HWY_IS_UBSAN 1
383
- #else
384
- #define HWY_IS_UBSAN 0
385
- #endif
386
-
387
- // MSAN may cause lengthy build times or false positives e.g. in AVX3 DemoteTo.
388
- // You can disable MSAN by adding this attribute to the function that fails.
389
- #if HWY_IS_MSAN
390
- #define HWY_ATTR_NO_MSAN __attribute__((no_sanitize_memory))
391
- #else
392
- #define HWY_ATTR_NO_MSAN
393
- #endif
394
-
395
- #if HWY_IS_ASAN || HWY_IS_HWASAN || HWY_IS_MSAN || HWY_IS_TSAN || HWY_IS_UBSAN
396
- #define HWY_IS_SANITIZER 1
397
- #else
398
- #define HWY_IS_SANITIZER 0
399
- #endif
400
-
401
370
  // For enabling HWY_DASSERT and shortening tests in slower debug builds
371
+ //
372
+ // Note: `HWY_IS_UBSAN` is specifically excluded from engaging debug
373
+ // builds. This is in service of Chromium's `-fsanitize=array-bounds` by
374
+ // default, where we don't want Highway to unconditionally build in
375
+ // debug mode.
376
+ //
377
+ // See also:
378
+ // https://docs.google.com/document/d/1eCtY4AZF-SiFHxhIYWzEytdIx3C24de7ccD6Y5Gn2H8/edit?tab=t.9zkn85hr82ms#heading=h.efcshvfql42c
402
379
  #if !defined(HWY_IS_DEBUG_BUILD)
403
380
  // Clang does not define NDEBUG, but it and GCC define __OPTIMIZE__, and recent
404
381
  // MSVC defines NDEBUG (if not, could instead check _DEBUG).
405
- #if (!defined(__OPTIMIZE__) && !defined(NDEBUG)) || HWY_IS_SANITIZER || \
382
+ #if (!defined(__OPTIMIZE__) && !defined(NDEBUG)) || \
383
+ (HWY_IS_ASAN || (HWY_IS_SANITIZER && !HWY_IS_UBSAN)) || \
406
384
  defined(__clang_analyzer__)
407
385
  #define HWY_IS_DEBUG_BUILD 1
408
386
  #else
@@ -455,21 +433,22 @@ HWY_API void CopySameSize(const From* HWY_RESTRICT from, To* HWY_RESTRICT to) {
455
433
  CopyBytes<sizeof(From)>(from, to);
456
434
  }
457
435
 
458
- template <size_t kBytes, typename To>
459
- HWY_API void ZeroBytes(To* to) {
436
+ // Sets each byte to `byte_value`, which must be between 0 and 255.
437
+ HWY_API void FillBytes(void* to, int byte_value, size_t num_bytes) {
460
438
  #if HWY_COMPILER_MSVC
461
- memset(to, 0, kBytes);
439
+ memset(to, byte_value, num_bytes);
462
440
  #else
463
- __builtin_memset(to, 0, kBytes);
441
+ __builtin_memset(to, byte_value, num_bytes);
464
442
  #endif
465
443
  }
466
444
 
467
445
  HWY_API void ZeroBytes(void* to, size_t num_bytes) {
468
- #if HWY_COMPILER_MSVC
469
- memset(to, 0, num_bytes);
470
- #else
471
- __builtin_memset(to, 0, num_bytes);
472
- #endif
446
+ FillBytes(to, 0, num_bytes);
447
+ }
448
+
449
+ template <size_t kBytes, typename To>
450
+ HWY_API void ZeroBytes(To* to) {
451
+ ZeroBytes(to, kBytes);
473
452
  }
474
453
 
475
454
  //------------------------------------------------------------------------------
@@ -1699,28 +1678,14 @@ HWY_F16_CONSTEXPR inline std::partial_ordering operator<=>(
1699
1678
  //------------------------------------------------------------------------------
1700
1679
  // BF16 lane type
1701
1680
 
1702
- // Compiler supports ACLE __bf16, not necessarily with operators.
1703
-
1704
- // Disable the __bf16 type on AArch64 with GCC 13 or earlier as there is a bug
1705
- // in GCC 13 and earlier that sometimes causes BF16 constant values to be
1706
- // incorrectly loaded on AArch64, and this GCC bug on AArch64 is
1707
- // described at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111867.
1708
-
1709
- #if HWY_ARCH_ARM_A64 && \
1710
- (HWY_COMPILER_CLANG >= 1700 || HWY_COMPILER_GCC_ACTUAL >= 1400)
1711
- #define HWY_ARM_HAVE_SCALAR_BF16_TYPE 1
1712
- #else
1713
- #define HWY_ARM_HAVE_SCALAR_BF16_TYPE 0
1714
- #endif
1715
-
1716
1681
  // x86 compiler supports __bf16, not necessarily with operators.
1717
1682
  // Disable in debug builds due to clang miscompiles as of 2025-07-22: casting
1718
1683
  // bf16 <-> f32 in convert_test results in 0x2525 for 1.0 instead of 0x3f80.
1719
1684
  // Reported at https://github.com/llvm/llvm-project/issues/151692.
1720
1685
  #ifndef HWY_SSE2_HAVE_SCALAR_BF16_TYPE
1721
- #if HWY_ARCH_X86 && defined(__SSE2__) && \
1722
- ((HWY_COMPILER_CLANG >= 1700 && !HWY_COMPILER_CLANGCL && \
1723
- !HWY_IS_DEBUG_BUILD) || \
1686
+ #if HWY_ARCH_X86 && defined(__SSE2__) && \
1687
+ ((HWY_COMPILER_CLANG >= 1700 && !HWY_COMPILER_CLANGCL && \
1688
+ (!HWY_IS_DEBUG_BUILD || HWY_COMPILER3_CLANG >= 220101)) || \
1724
1689
  HWY_COMPILER_GCC_ACTUAL >= 1300)
1725
1690
  #define HWY_SSE2_HAVE_SCALAR_BF16_TYPE 1
1726
1691
  #else
@@ -1738,7 +1703,11 @@ HWY_F16_CONSTEXPR inline std::partial_ordering operator<=>(
1738
1703
  #ifndef HWY_HAVE_SCALAR_BF16_OPERATORS
1739
1704
  // Recent enough compiler also has operators. aarch64 clang 18 hits internal
1740
1705
  // compiler errors on bf16 ToString, hence only enable on GCC for now.
1741
- #if HWY_HAVE_SCALAR_BF16_TYPE && (HWY_COMPILER_GCC_ACTUAL >= 1300)
1706
+ // GCC >= 13 will insert a function call to the __extendbfsf2 helper function
1707
+ // for scalar conversions from __bf16 to float. This is prohibitively expensive,
1708
+ // so refrain from using scalar BF16 operators on these compiler versions.
1709
+ // See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121853
1710
+ #if HWY_HAVE_SCALAR_BF16_TYPE && (HWY_COMPILER_GCC_ACTUAL >= 1700)
1742
1711
  #define HWY_HAVE_SCALAR_BF16_OPERATORS 1
1743
1712
  #else
1744
1713
  #define HWY_HAVE_SCALAR_BF16_OPERATORS 0
@@ -2734,7 +2703,7 @@ HWY_API constexpr TTo ConvertScalarTo(TFrom in) {
2734
2703
  template <typename T1, typename T2>
2735
2704
  constexpr inline T1 DivCeil(T1 a, T2 b) {
2736
2705
  #if HWY_CXX_LANG >= 201703L
2737
- HWY_DASSERT(b != 0);
2706
+ HWY_DASSERT(b != T2{0});
2738
2707
  #endif
2739
2708
  return (a + b - 1) / b;
2740
2709
  }
@@ -2957,9 +2926,10 @@ HWY_INLINE constexpr T AddWithWraparound(T t, T2 n) {
2957
2926
  // 64 x 64 = 128 bit multiplication
2958
2927
  HWY_API uint64_t Mul128(uint64_t a, uint64_t b, uint64_t* HWY_RESTRICT upper) {
2959
2928
  #if defined(__SIZEOF_INT128__)
2960
- __uint128_t product = (__uint128_t)a * (__uint128_t)b;
2961
- *upper = (uint64_t)(product >> 64);
2962
- return (uint64_t)(product & 0xFFFFFFFFFFFFFFFFULL);
2929
+ __uint128_t product =
2930
+ static_cast<__uint128_t>(a) * static_cast<__uint128_t>(b);
2931
+ *upper = static_cast<uint64_t>(product >> 64);
2932
+ return static_cast<uint64_t>(product & 0xFFFFFFFFFFFFFFFFULL);
2963
2933
  #elif HWY_COMPILER_MSVC && HWY_ARCH_X86_64
2964
2934
  return _umul128(a, b, upper);
2965
2935
  #else
@@ -2976,9 +2946,9 @@ HWY_API uint64_t Mul128(uint64_t a, uint64_t b, uint64_t* HWY_RESTRICT upper) {
2976
2946
 
2977
2947
  HWY_API int64_t Mul128(int64_t a, int64_t b, int64_t* HWY_RESTRICT upper) {
2978
2948
  #if defined(__SIZEOF_INT128__)
2979
- __int128_t product = (__int128_t)a * (__int128_t)b;
2980
- *upper = (int64_t)(product >> 64);
2981
- return (int64_t)(product & 0xFFFFFFFFFFFFFFFFULL);
2949
+ __int128_t product = static_cast<__int128_t>(a) * static_cast<__int128_t>(b);
2950
+ *upper = static_cast<int64_t>(product >> 64);
2951
+ return static_cast<int64_t>(product & 0xFFFFFFFFFFFFFFFFULL);
2982
2952
  #elif HWY_COMPILER_MSVC && HWY_ARCH_X86_64
2983
2953
  return _mul128(a, b, upper);
2984
2954
  #else