@img/sharp-libvips-dev 0.0.1 → 0.0.2
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/README.md +2 -2
- package/cplusplus/VConnection.cpp +54 -54
- package/cplusplus/VError.cpp +20 -18
- package/cplusplus/VImage.cpp +636 -589
- package/cplusplus/VInterpolate.cpp +22 -22
- package/cplusplus/VRegion.cpp +4 -4
- package/cplusplus/vips-operators.cpp +2326 -2301
- package/include/aom/aom_codec.h +10 -6
- package/include/aom/aom_decoder.h +1 -1
- package/include/aom/aom_encoder.h +9 -2
- package/include/aom/aomcx.h +72 -3
- package/include/cairo/cairo-ft.h +1 -1
- package/include/cairo/cairo-gobject.h +8 -0
- package/include/cairo/cairo-svg.h +3 -3
- package/include/cairo/cairo-version.h +2 -2
- package/include/cairo/cairo.h +91 -24
- package/include/harfbuzz/hb-version.h +2 -2
- package/include/hwy/aligned_allocator.h +211 -0
- package/include/hwy/base.h +1517 -0
- package/include/hwy/cache_control.h +108 -0
- package/include/hwy/detect_compiler_arch.h +281 -0
- package/include/hwy/detect_targets.h +644 -0
- package/include/hwy/foreach_target.h +340 -0
- package/include/hwy/highway.h +435 -0
- package/include/hwy/highway_export.h +74 -0
- package/include/hwy/nanobenchmark.h +171 -0
- package/include/hwy/ops/arm_neon-inl.h +8913 -0
- package/include/hwy/ops/arm_sve-inl.h +5105 -0
- package/include/hwy/ops/emu128-inl.h +2811 -0
- package/include/hwy/ops/generic_ops-inl.h +4745 -0
- package/include/hwy/ops/ppc_vsx-inl.h +5716 -0
- package/include/hwy/ops/rvv-inl.h +5070 -0
- package/include/hwy/ops/scalar-inl.h +1995 -0
- package/include/hwy/ops/set_macros-inl.h +578 -0
- package/include/hwy/ops/shared-inl.h +539 -0
- package/include/hwy/ops/tuple-inl.h +125 -0
- package/include/hwy/ops/wasm_128-inl.h +5917 -0
- package/include/hwy/ops/x86_128-inl.h +11173 -0
- package/include/hwy/ops/x86_256-inl.h +7529 -0
- package/include/hwy/ops/x86_512-inl.h +6849 -0
- package/include/hwy/per_target.h +44 -0
- package/include/hwy/print-inl.h +62 -0
- package/include/hwy/print.h +75 -0
- package/include/hwy/robust_statistics.h +148 -0
- package/include/hwy/targets.h +338 -0
- package/include/hwy/timer-inl.h +200 -0
- package/include/hwy/timer.h +55 -0
- package/include/jconfig.h +2 -2
- package/include/jpeglib.h +3 -2
- package/include/libheif/heif.h +443 -377
- package/include/libheif/heif_cxx.h +4 -1
- package/include/libheif/heif_plugin.h +1 -1
- package/include/libheif/heif_properties.h +138 -0
- package/include/libheif/heif_regions.h +866 -0
- package/include/libheif/heif_version.h +3 -3
- package/include/vips/VConnection8.h +43 -49
- package/include/vips/VError8.h +27 -24
- package/include/vips/VImage8.h +4861 -4597
- package/include/vips/VInterpolate8.h +24 -27
- package/include/vips/VRegion8.h +32 -33
- package/include/vips/arithmetic.h +169 -169
- package/include/vips/basic.h +33 -33
- package/include/vips/buf.h +56 -54
- package/include/vips/colour.h +95 -95
- package/include/vips/connection.h +190 -193
- package/include/vips/conversion.h +91 -91
- package/include/vips/convolution.h +36 -30
- package/include/vips/create.h +63 -63
- package/include/vips/dbuf.h +35 -37
- package/include/vips/debug.h +65 -33
- package/include/vips/draw.h +41 -41
- package/include/vips/enumtypes.h +54 -51
- package/include/vips/error.h +63 -63
- package/include/vips/foreign.h +263 -223
- package/include/vips/format.h +48 -48
- package/include/vips/freqfilt.h +22 -22
- package/include/vips/gate.h +55 -47
- package/include/vips/generate.h +34 -34
- package/include/vips/header.h +111 -101
- package/include/vips/histogram.h +28 -28
- package/include/vips/image.h +213 -213
- package/include/vips/interpolate.h +40 -41
- package/include/vips/memory.h +61 -52
- package/include/vips/morphology.h +24 -24
- package/include/vips/mosaicing.h +32 -33
- package/include/vips/object.h +371 -357
- package/include/vips/operation.h +68 -67
- package/include/vips/private.h +76 -76
- package/include/vips/rect.h +26 -26
- package/include/vips/region.h +92 -92
- package/include/vips/resample.h +38 -38
- package/include/vips/sbuf.h +53 -54
- package/include/vips/semaphore.h +24 -24
- package/include/vips/thread.h +30 -27
- package/include/vips/threadpool.h +48 -49
- package/include/vips/transform.h +39 -39
- package/include/vips/type.h +90 -85
- package/include/vips/util.h +274 -229
- package/include/vips/vector.h +24 -144
- package/include/vips/version.h +9 -9
- package/include/vips/vips.h +41 -40
- package/package.json +1 -1
- package/versions.json +7 -7
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// Copyright 2020 Google LLC
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
|
|
16
|
+
#ifndef HIGHWAY_HWY_CACHE_CONTROL_H_
|
|
17
|
+
#define HIGHWAY_HWY_CACHE_CONTROL_H_
|
|
18
|
+
|
|
19
|
+
#include "hwy/base.h"
|
|
20
|
+
|
|
21
|
+
// Requires SSE2; fails to compile on 32-bit Clang 7 (see
|
|
22
|
+
// https://github.com/gperftools/gperftools/issues/946).
|
|
23
|
+
#if !defined(__SSE2__) || (HWY_COMPILER_CLANG && HWY_ARCH_X86_32)
|
|
24
|
+
#undef HWY_DISABLE_CACHE_CONTROL
|
|
25
|
+
#define HWY_DISABLE_CACHE_CONTROL
|
|
26
|
+
#endif
|
|
27
|
+
|
|
28
|
+
// intrin.h is sufficient on MSVC and already included by base.h.
|
|
29
|
+
#if HWY_ARCH_X86 && !defined(HWY_DISABLE_CACHE_CONTROL) && !HWY_COMPILER_MSVC
|
|
30
|
+
#include <emmintrin.h> // SSE2
|
|
31
|
+
#include <xmmintrin.h> // _mm_prefetch
|
|
32
|
+
#endif
|
|
33
|
+
|
|
34
|
+
namespace hwy {
|
|
35
|
+
|
|
36
|
+
// Even if N*sizeof(T) is smaller, Stream may write a multiple of this size.
|
|
37
|
+
#define HWY_STREAM_MULTIPLE 16
|
|
38
|
+
|
|
39
|
+
// The following functions may also require an attribute.
|
|
40
|
+
#if HWY_ARCH_X86 && !defined(HWY_DISABLE_CACHE_CONTROL) && !HWY_COMPILER_MSVC
|
|
41
|
+
#define HWY_ATTR_CACHE __attribute__((target("sse2")))
|
|
42
|
+
#else
|
|
43
|
+
#define HWY_ATTR_CACHE
|
|
44
|
+
#endif
|
|
45
|
+
|
|
46
|
+
// Windows.h #defines this, which causes infinite recursion. Temporarily
|
|
47
|
+
// undefine to avoid conflict with our function.
|
|
48
|
+
// TODO(janwas): remove when this function is removed.
|
|
49
|
+
#pragma push_macro("LoadFence")
|
|
50
|
+
#undef LoadFence
|
|
51
|
+
|
|
52
|
+
// Delays subsequent loads until prior loads are visible. Beware of potentially
|
|
53
|
+
// differing behavior across architectures and vendors: on Intel but not
|
|
54
|
+
// AMD CPUs, also serves as a full fence (waits for all prior instructions to
|
|
55
|
+
// complete).
|
|
56
|
+
HWY_INLINE HWY_ATTR_CACHE void LoadFence() {
|
|
57
|
+
#if HWY_ARCH_X86 && !defined(HWY_DISABLE_CACHE_CONTROL)
|
|
58
|
+
_mm_lfence();
|
|
59
|
+
#endif
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// TODO(janwas): remove when this function is removed. (See above.)
|
|
63
|
+
#pragma pop_macro("LoadFence")
|
|
64
|
+
|
|
65
|
+
// Ensures values written by previous `Stream` calls are visible on the current
|
|
66
|
+
// core. This is NOT sufficient for synchronizing across cores; when `Stream`
|
|
67
|
+
// outputs are to be consumed by other core(s), the producer must publish
|
|
68
|
+
// availability (e.g. via mutex or atomic_flag) after `FlushStream`.
|
|
69
|
+
HWY_INLINE HWY_ATTR_CACHE void FlushStream() {
|
|
70
|
+
#if HWY_ARCH_X86 && !defined(HWY_DISABLE_CACHE_CONTROL)
|
|
71
|
+
_mm_sfence();
|
|
72
|
+
#endif
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Optionally begins loading the cache line containing "p" to reduce latency of
|
|
76
|
+
// subsequent actual loads.
|
|
77
|
+
template <typename T>
|
|
78
|
+
HWY_INLINE HWY_ATTR_CACHE void Prefetch(const T* p) {
|
|
79
|
+
#if HWY_ARCH_X86 && !defined(HWY_DISABLE_CACHE_CONTROL)
|
|
80
|
+
_mm_prefetch(reinterpret_cast<const char*>(p), _MM_HINT_T0);
|
|
81
|
+
#elif HWY_COMPILER_GCC // includes clang
|
|
82
|
+
// Hint=0 (NTA) behavior differs, but skipping outer caches is probably not
|
|
83
|
+
// desirable, so use the default 3 (keep in caches).
|
|
84
|
+
__builtin_prefetch(p, /*write=*/0, /*hint=*/3);
|
|
85
|
+
#else
|
|
86
|
+
(void)p;
|
|
87
|
+
#endif
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Invalidates and flushes the cache line containing "p", if possible.
|
|
91
|
+
HWY_INLINE HWY_ATTR_CACHE void FlushCacheline(const void* p) {
|
|
92
|
+
#if HWY_ARCH_X86 && !defined(HWY_DISABLE_CACHE_CONTROL)
|
|
93
|
+
_mm_clflush(p);
|
|
94
|
+
#else
|
|
95
|
+
(void)p;
|
|
96
|
+
#endif
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// When called inside a spin-loop, may reduce power consumption.
|
|
100
|
+
HWY_INLINE HWY_ATTR_CACHE void Pause() {
|
|
101
|
+
#if HWY_ARCH_X86 && !defined(HWY_DISABLE_CACHE_CONTROL)
|
|
102
|
+
_mm_pause();
|
|
103
|
+
#endif
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
} // namespace hwy
|
|
107
|
+
|
|
108
|
+
#endif // HIGHWAY_HWY_CACHE_CONTROL_H_
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
// Copyright 2020 Google LLC
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
|
|
16
|
+
#ifndef HIGHWAY_HWY_DETECT_COMPILER_ARCH_H_
|
|
17
|
+
#define HIGHWAY_HWY_DETECT_COMPILER_ARCH_H_
|
|
18
|
+
|
|
19
|
+
// Detects compiler and arch from predefined macros. Zero dependencies for
|
|
20
|
+
// inclusion by foreach_target.h.
|
|
21
|
+
|
|
22
|
+
// Add to #if conditions to prevent IDE from graying out code.
|
|
23
|
+
#if (defined __CDT_PARSER__) || (defined __INTELLISENSE__) || \
|
|
24
|
+
(defined Q_CREATOR_RUN) || (defined __CLANGD__) || \
|
|
25
|
+
(defined GROK_ELLIPSIS_BUILD)
|
|
26
|
+
#define HWY_IDE 1
|
|
27
|
+
#else
|
|
28
|
+
#define HWY_IDE 0
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
//------------------------------------------------------------------------------
|
|
32
|
+
// Compiler
|
|
33
|
+
|
|
34
|
+
// Actual MSVC, not clang-cl, which defines _MSC_VER but doesn't behave like
|
|
35
|
+
// MSVC in other aspects (e.g. HWY_DIAGNOSTICS).
|
|
36
|
+
#if defined(_MSC_VER) && !defined(__clang__)
|
|
37
|
+
#define HWY_COMPILER_MSVC _MSC_VER
|
|
38
|
+
#else
|
|
39
|
+
#define HWY_COMPILER_MSVC 0
|
|
40
|
+
#endif
|
|
41
|
+
|
|
42
|
+
#if defined(_MSC_VER) && defined(__clang__)
|
|
43
|
+
#define HWY_COMPILER_CLANGCL _MSC_VER
|
|
44
|
+
#else
|
|
45
|
+
#define HWY_COMPILER_CLANGCL 0
|
|
46
|
+
#endif
|
|
47
|
+
|
|
48
|
+
#ifdef __INTEL_COMPILER
|
|
49
|
+
#define HWY_COMPILER_ICC __INTEL_COMPILER
|
|
50
|
+
#else
|
|
51
|
+
#define HWY_COMPILER_ICC 0
|
|
52
|
+
#endif
|
|
53
|
+
|
|
54
|
+
#ifdef __INTEL_LLVM_COMPILER
|
|
55
|
+
#define HWY_COMPILER_ICX __INTEL_LLVM_COMPILER
|
|
56
|
+
#else
|
|
57
|
+
#define HWY_COMPILER_ICX 0
|
|
58
|
+
#endif
|
|
59
|
+
|
|
60
|
+
// HWY_COMPILER_GCC is a generic macro for all compilers implementing the GNU
|
|
61
|
+
// compiler extensions (eg. Clang, Intel...)
|
|
62
|
+
#ifdef __GNUC__
|
|
63
|
+
#define HWY_COMPILER_GCC (__GNUC__ * 100 + __GNUC_MINOR__)
|
|
64
|
+
#else
|
|
65
|
+
#define HWY_COMPILER_GCC 0
|
|
66
|
+
#endif
|
|
67
|
+
|
|
68
|
+
// Clang or clang-cl, not GCC.
|
|
69
|
+
#ifdef __clang__
|
|
70
|
+
// In case of Apple LLVM (whose version number is unrelated to that of LLVM) or
|
|
71
|
+
// an invalid version number, deduce it from the presence of warnings.
|
|
72
|
+
// Originally based on
|
|
73
|
+
// https://github.com/simd-everywhere/simde/blob/47d6e603de9d04ee05cdfbc57cf282a02be1bf2a/simde/simde-detect-clang.h#L59.
|
|
74
|
+
// Please send updates below to them as well, thanks!
|
|
75
|
+
#if defined(__apple_build_version__) || __clang_major__ >= 999
|
|
76
|
+
#if __has_attribute(nouwtable) // no new warnings in 16.0
|
|
77
|
+
#define HWY_COMPILER_CLANG 1600
|
|
78
|
+
#elif __has_warning("-Warray-parameter")
|
|
79
|
+
#define HWY_COMPILER_CLANG 1500
|
|
80
|
+
#elif __has_warning("-Wbitwise-instead-of-logical")
|
|
81
|
+
#define HWY_COMPILER_CLANG 1400
|
|
82
|
+
#elif __has_warning("-Wreserved-identifier")
|
|
83
|
+
#define HWY_COMPILER_CLANG 1300
|
|
84
|
+
#elif __has_warning("-Wformat-insufficient-args")
|
|
85
|
+
#define HWY_COMPILER_CLANG 1200
|
|
86
|
+
#elif __has_warning("-Wimplicit-const-int-float-conversion")
|
|
87
|
+
#define HWY_COMPILER_CLANG 1100
|
|
88
|
+
#elif __has_warning("-Wmisleading-indentation")
|
|
89
|
+
#define HWY_COMPILER_CLANG 1000
|
|
90
|
+
#elif defined(__FILE_NAME__)
|
|
91
|
+
#define HWY_COMPILER_CLANG 900
|
|
92
|
+
#elif __has_warning("-Wextra-semi-stmt") || \
|
|
93
|
+
__has_builtin(__builtin_rotateleft32)
|
|
94
|
+
#define HWY_COMPILER_CLANG 800
|
|
95
|
+
// For reasons unknown, XCode 10.3 (Apple LLVM version 10.0.1) is apparently
|
|
96
|
+
// based on Clang 7, but does not support the warning we test.
|
|
97
|
+
// See https://en.wikipedia.org/wiki/Xcode#Toolchain_versions and
|
|
98
|
+
// https://trac.macports.org/wiki/XcodeVersionInfo.
|
|
99
|
+
#elif __has_warning("-Wc++98-compat-extra-semi") || \
|
|
100
|
+
(defined(__apple_build_version__) && __apple_build_version__ >= 10010000)
|
|
101
|
+
#define HWY_COMPILER_CLANG 700
|
|
102
|
+
#else // Anything older than 7.0 is not recommended for Highway.
|
|
103
|
+
#define HWY_COMPILER_CLANG 600
|
|
104
|
+
#endif // __has_warning chain
|
|
105
|
+
#define HWY_COMPILER3_CLANG (HWY_COMPILER_CLANG * 100)
|
|
106
|
+
#else // use normal version
|
|
107
|
+
#define HWY_COMPILER_CLANG (__clang_major__ * 100 + __clang_minor__)
|
|
108
|
+
#define HWY_COMPILER3_CLANG \
|
|
109
|
+
(__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
|
|
110
|
+
#endif
|
|
111
|
+
#else // Not clang
|
|
112
|
+
#define HWY_COMPILER_CLANG 0
|
|
113
|
+
#define HWY_COMPILER3_CLANG 0
|
|
114
|
+
#endif
|
|
115
|
+
|
|
116
|
+
#if HWY_COMPILER_GCC && !HWY_COMPILER_CLANG && !HWY_COMPILER_ICC
|
|
117
|
+
#define HWY_COMPILER_GCC_ACTUAL HWY_COMPILER_GCC
|
|
118
|
+
#else
|
|
119
|
+
#define HWY_COMPILER_GCC_ACTUAL 0
|
|
120
|
+
#endif
|
|
121
|
+
|
|
122
|
+
// More than one may be nonzero, but we want at least one.
|
|
123
|
+
#if 0 == (HWY_COMPILER_MSVC + HWY_COMPILER_CLANGCL + HWY_COMPILER_ICC + \
|
|
124
|
+
HWY_COMPILER_GCC + HWY_COMPILER_CLANG)
|
|
125
|
+
#error "Unsupported compiler"
|
|
126
|
+
#endif
|
|
127
|
+
|
|
128
|
+
// We should only detect one of these (only clang/clangcl overlap)
|
|
129
|
+
#if 1 < \
|
|
130
|
+
(!!HWY_COMPILER_MSVC + !!HWY_COMPILER_ICC + !!HWY_COMPILER_GCC_ACTUAL + \
|
|
131
|
+
!!(HWY_COMPILER_CLANGCL | HWY_COMPILER_CLANG))
|
|
132
|
+
#error "Detected multiple compilers"
|
|
133
|
+
#endif
|
|
134
|
+
|
|
135
|
+
#ifdef __has_builtin
|
|
136
|
+
#define HWY_HAS_BUILTIN(name) __has_builtin(name)
|
|
137
|
+
#else
|
|
138
|
+
#define HWY_HAS_BUILTIN(name) 0
|
|
139
|
+
#endif
|
|
140
|
+
|
|
141
|
+
#ifdef __has_attribute
|
|
142
|
+
#define HWY_HAS_ATTRIBUTE(name) __has_attribute(name)
|
|
143
|
+
#else
|
|
144
|
+
#define HWY_HAS_ATTRIBUTE(name) 0
|
|
145
|
+
#endif
|
|
146
|
+
|
|
147
|
+
#ifdef __has_cpp_attribute
|
|
148
|
+
#define HWY_HAS_CPP_ATTRIBUTE(name) __has_cpp_attribute(name)
|
|
149
|
+
#else
|
|
150
|
+
#define HWY_HAS_CPP_ATTRIBUTE(name) 0
|
|
151
|
+
#endif
|
|
152
|
+
|
|
153
|
+
#ifdef __has_feature
|
|
154
|
+
#define HWY_HAS_FEATURE(name) __has_feature(name)
|
|
155
|
+
#else
|
|
156
|
+
#define HWY_HAS_FEATURE(name) 0
|
|
157
|
+
#endif
|
|
158
|
+
|
|
159
|
+
//------------------------------------------------------------------------------
|
|
160
|
+
// Architecture
|
|
161
|
+
|
|
162
|
+
#if defined(__i386__) || defined(_M_IX86)
|
|
163
|
+
#define HWY_ARCH_X86_32 1
|
|
164
|
+
#else
|
|
165
|
+
#define HWY_ARCH_X86_32 0
|
|
166
|
+
#endif
|
|
167
|
+
|
|
168
|
+
#if defined(__x86_64__) || defined(_M_X64)
|
|
169
|
+
#define HWY_ARCH_X86_64 1
|
|
170
|
+
#else
|
|
171
|
+
#define HWY_ARCH_X86_64 0
|
|
172
|
+
#endif
|
|
173
|
+
|
|
174
|
+
#if HWY_ARCH_X86_32 && HWY_ARCH_X86_64
|
|
175
|
+
#error "Cannot have both x86-32 and x86-64"
|
|
176
|
+
#endif
|
|
177
|
+
|
|
178
|
+
#if HWY_ARCH_X86_32 || HWY_ARCH_X86_64
|
|
179
|
+
#define HWY_ARCH_X86 1
|
|
180
|
+
#else
|
|
181
|
+
#define HWY_ARCH_X86 0
|
|
182
|
+
#endif
|
|
183
|
+
|
|
184
|
+
#if defined(__powerpc64__) || defined(_M_PPC) || defined(__powerpc__)
|
|
185
|
+
#define HWY_ARCH_PPC 1
|
|
186
|
+
#else
|
|
187
|
+
#define HWY_ARCH_PPC 0
|
|
188
|
+
#endif
|
|
189
|
+
|
|
190
|
+
// aarch32 is currently not supported; please raise an issue if you want it.
|
|
191
|
+
#if defined(__ARM_ARCH_ISA_A64) || defined(__aarch64__) || defined(_M_ARM64)
|
|
192
|
+
#define HWY_ARCH_ARM_A64 1
|
|
193
|
+
#else
|
|
194
|
+
#define HWY_ARCH_ARM_A64 0
|
|
195
|
+
#endif
|
|
196
|
+
|
|
197
|
+
#if (defined(__ARM_ARCH) && __ARM_ARCH == 7) || (defined(_M_ARM) && _M_ARM == 7)
|
|
198
|
+
#define HWY_ARCH_ARM_V7 1
|
|
199
|
+
#else
|
|
200
|
+
#define HWY_ARCH_ARM_V7 0
|
|
201
|
+
#endif
|
|
202
|
+
|
|
203
|
+
#if HWY_ARCH_ARM_A64 && HWY_ARCH_ARM_V7
|
|
204
|
+
#error "Cannot have both A64 and V7"
|
|
205
|
+
#endif
|
|
206
|
+
|
|
207
|
+
// Any *supported* version of Arm, i.e. 7 or later
|
|
208
|
+
#if HWY_ARCH_ARM_A64 || HWY_ARCH_ARM_V7
|
|
209
|
+
#define HWY_ARCH_ARM 1
|
|
210
|
+
#else
|
|
211
|
+
#define HWY_ARCH_ARM 0
|
|
212
|
+
#endif
|
|
213
|
+
|
|
214
|
+
// Older than Armv7 (e.g. armel aka Armv5) => we do not support SIMD.
|
|
215
|
+
#if (defined(__arm__) || defined(_M_ARM)) && !HWY_ARCH_ARM
|
|
216
|
+
#define HWY_ARCH_ARM_OLD 1
|
|
217
|
+
#else
|
|
218
|
+
#define HWY_ARCH_ARM_OLD 0
|
|
219
|
+
#endif
|
|
220
|
+
|
|
221
|
+
#if defined(__EMSCRIPTEN__) || defined(__wasm__) || defined(__WASM__)
|
|
222
|
+
#define HWY_ARCH_WASM 1
|
|
223
|
+
#else
|
|
224
|
+
#define HWY_ARCH_WASM 0
|
|
225
|
+
#endif
|
|
226
|
+
|
|
227
|
+
#ifdef __riscv
|
|
228
|
+
#define HWY_ARCH_RVV 1
|
|
229
|
+
#else
|
|
230
|
+
#define HWY_ARCH_RVV 0
|
|
231
|
+
#endif
|
|
232
|
+
|
|
233
|
+
// It is an error to detect multiple architectures at the same time, but OK to
|
|
234
|
+
// detect none of the above.
|
|
235
|
+
#if (HWY_ARCH_X86 + HWY_ARCH_PPC + HWY_ARCH_ARM + HWY_ARCH_ARM_OLD + \
|
|
236
|
+
HWY_ARCH_WASM + HWY_ARCH_RVV) > 1
|
|
237
|
+
#error "Must not detect more than one architecture"
|
|
238
|
+
#endif
|
|
239
|
+
|
|
240
|
+
#if defined(_WIN32) || defined(_WIN64)
|
|
241
|
+
#define HWY_OS_WIN 1
|
|
242
|
+
#else
|
|
243
|
+
#define HWY_OS_WIN 0
|
|
244
|
+
#endif
|
|
245
|
+
|
|
246
|
+
#if defined(linux) || defined(__linux__)
|
|
247
|
+
#define HWY_OS_LINUX 1
|
|
248
|
+
#else
|
|
249
|
+
#define HWY_OS_LINUX 0
|
|
250
|
+
#endif
|
|
251
|
+
|
|
252
|
+
//------------------------------------------------------------------------------
|
|
253
|
+
// Endianness
|
|
254
|
+
|
|
255
|
+
#if HWY_COMPILER_MSVC
|
|
256
|
+
#if HWY_ARCH_PPC && defined(_XBOX_VER) && _XBOX_VER >= 200
|
|
257
|
+
// XBox 360 is big-endian
|
|
258
|
+
#define HWY_IS_LITTLE_ENDIAN 0
|
|
259
|
+
#define HWY_IS_BIG_ENDIAN 1
|
|
260
|
+
#else
|
|
261
|
+
// All other targets supported by MSVC are little-endian
|
|
262
|
+
#define HWY_IS_LITTLE_ENDIAN 1
|
|
263
|
+
#define HWY_IS_BIG_ENDIAN 0
|
|
264
|
+
#endif // HWY_ARCH_PPC && defined(_XBOX_VER) && _XBOX_VER >= 200
|
|
265
|
+
#elif defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \
|
|
266
|
+
__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
|
267
|
+
#define HWY_IS_LITTLE_ENDIAN 1
|
|
268
|
+
#define HWY_IS_BIG_ENDIAN 0
|
|
269
|
+
#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && \
|
|
270
|
+
__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
|
271
|
+
#define HWY_IS_LITTLE_ENDIAN 0
|
|
272
|
+
#define HWY_IS_BIG_ENDIAN 1
|
|
273
|
+
#else
|
|
274
|
+
#error "Unable to detect endianness or unsupported byte order"
|
|
275
|
+
#endif
|
|
276
|
+
|
|
277
|
+
#if (HWY_IS_LITTLE_ENDIAN + HWY_IS_BIG_ENDIAN) != 1
|
|
278
|
+
#error "Must only detect one byte order"
|
|
279
|
+
#endif
|
|
280
|
+
|
|
281
|
+
#endif // HIGHWAY_HWY_DETECT_COMPILER_ARCH_H_
|