wyvrnpm 2.21.2 → 2.21.3

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.
@@ -161,6 +161,128 @@ else()
161
161
  message(STATUS "Unknown architecture")
162
162
  endif()
163
163
 
164
+ # ── CPU architecture detection ────────────────────────────────────────────────
165
+ # A parallel tier to WYVRN_PLATFORM_* above. CPU family is orthogonal to OS
166
+ # family (an ARM Mac and an x86 Mac are both DARWIN), so it is detected on its
167
+ # own axis rather than nested under any platform. Same idiom as the platform
168
+ # tier: default every leaf to FALSE, derive from the environment, then emit the
169
+ # survivors as compile definitions.
170
+ #
171
+ # WYVRN_CPU_X86_FAMILY – x86 / x86_64 (Intel/AMD)
172
+ # WYVRN_CPU_ARM_FAMILY – ARM / AArch64
173
+ #
174
+ # Derived vector-intrinsics selector — the SSE-vs-NEON switch a VectorRegister
175
+ # dispatch header keys off:
176
+ #
177
+ # WYVRN_ENABLE_VECTORINTRINSICS – SSE/AVX path available (x86 family)
178
+ # WYVRN_ENABLE_VECTORINTRINSICS_NEON – NEON path available (64-bit ARM)
179
+
180
+ set(WYVRN_CPU_X86_FAMILY FALSE)
181
+ set(WYVRN_CPU_ARM_FAMILY FALSE)
182
+ set(WYVRN_ENABLE_VECTORINTRINSICS FALSE)
183
+ set(WYVRN_ENABLE_VECTORINTRINSICS_NEON FALSE)
184
+
185
+ # CMAKE_SYSTEM_PROCESSOR is valid post-project(); its spelling varies by host
186
+ # (AMD64 on MSVC, x86_64 on Linux/Mac, ARM64 on Windows-on-ARM, aarch64 on
187
+ # Linux, arm64 on Apple). Lower-case before matching so one pattern covers all.
188
+ string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" _wyvrn_cpu_lc)
189
+ if(_wyvrn_cpu_lc MATCHES "^(x86_64|amd64|x64|em64t|i[3-6]86|x86)$")
190
+ set(WYVRN_CPU_X86_FAMILY TRUE)
191
+ elseif(_wyvrn_cpu_lc MATCHES "^(arm64|aarch64|armv8|armv7|arm)")
192
+ set(WYVRN_CPU_ARM_FAMILY TRUE)
193
+ endif()
194
+
195
+ if(WYVRN_CPU_X86_FAMILY)
196
+ set(WYVRN_ENABLE_VECTORINTRINSICS TRUE)
197
+ elseif(WYVRN_CPU_ARM_FAMILY AND WYVRN_64)
198
+ # 32-bit ARM makes NEON optional; only the 64-bit baseline guarantees it.
199
+ set(WYVRN_ENABLE_VECTORINTRINSICS_NEON TRUE)
200
+ endif()
201
+
202
+ # ── x86 minimum CPU architecture opt-in (analogue of UBT's -MinCpuArchX64) ────
203
+ # Raises the compile-time SIMD floor for the WHOLE build. Off by default (None)
204
+ # so produced binaries run on the broadest x86_64 baseline (SSE2). Selecting a
205
+ # level does two coupled things that MUST stay in lockstep:
206
+ # (a) emits the matching /arch (MSVC) or -m flags (Clang/GCC) so every
207
+ # translation unit is actually codegen'd for that ISA, and
208
+ # (b) raises WYVRN_ALWAYS_HAS_AVX[2|512]/_FMA3 so headers may assume the ISA
209
+ # unconditionally, with no runtime CPUID guard.
210
+ # Applied globally (add_compile_options / add_compile_definitions) because the
211
+ # macro and the codegen flag must agree across every TU — a header that emits an
212
+ # AVX intrinsic under WYVRN_ALWAYS_HAS_AVX must never reach a TU built without
213
+ # /arch:AVX. Runtime detection (GetCPUVendor / HasAVX2) is the separate,
214
+ # portable-dispatch mechanism and is unaffected by this floor.
215
+ # MINSPEC WARNING: a binary built with AVX2 will fault (#UD/SIGILL) on any CPU
216
+ # that lacks it. Raise this only when the deploy target's minimum spec
217
+ # guarantees the level.
218
+ set(WYVRN_MIN_CPU_ARCH_X64 "None" CACHE STRING
219
+ "Minimum x86_64 SIMD ISA the build may assume unconditionally (None|AVX|AVX2|AVX512)")
220
+ set_property(CACHE WYVRN_MIN_CPU_ARCH_X64 PROPERTY STRINGS None AVX AVX2 AVX512)
221
+
222
+ set(WYVRN_ALWAYS_HAS_AVX 0)
223
+ set(WYVRN_ALWAYS_HAS_AVX2 0)
224
+ set(WYVRN_ALWAYS_HAS_AVX512 0)
225
+ set(WYVRN_ALWAYS_HAS_FMA3 0)
226
+
227
+ if(WYVRN_CPU_X86_FAMILY AND NOT WYVRN_MIN_CPU_ARCH_X64 STREQUAL "None")
228
+ if(NOT WYVRN_MIN_CPU_ARCH_X64 MATCHES "^(AVX|AVX2|AVX512)$")
229
+ message(FATAL_ERROR "WYVRN_MIN_CPU_ARCH_X64 must be one of None|AVX|AVX2|AVX512 (got '${WYVRN_MIN_CPU_ARCH_X64}')")
230
+ endif()
231
+
232
+ set(_wyvrn_arch_flags)
233
+ if(MSVC)
234
+ # MSVC /arch is cumulative: /arch:AVX2 implies AVX, /arch:AVX512 implies AVX2.
235
+ list(APPEND _wyvrn_arch_flags /arch:${WYVRN_MIN_CPU_ARCH_X64})
236
+ else()
237
+ # Clang/GCC -m flags are not cumulative — name each level explicitly.
238
+ # FMA3 ships with Haswell-era AVX2, so -mfma rides along from AVX2 up.
239
+ if(WYVRN_MIN_CPU_ARCH_X64 STREQUAL "AVX")
240
+ list(APPEND _wyvrn_arch_flags -mavx)
241
+ elseif(WYVRN_MIN_CPU_ARCH_X64 STREQUAL "AVX2")
242
+ list(APPEND _wyvrn_arch_flags -mavx2 -mfma)
243
+ elseif(WYVRN_MIN_CPU_ARCH_X64 STREQUAL "AVX512")
244
+ list(APPEND _wyvrn_arch_flags -mavx512f -mavx2 -mfma)
245
+ endif()
246
+ endif()
247
+ add_compile_options(${_wyvrn_arch_flags})
248
+
249
+ # Raise the cumulative WYVRN_ALWAYS_HAS_* floor. FMA3 is guaranteed only from
250
+ # AVX2 up (both MSVC /arch:AVX2 and GCC/Clang -mfma).
251
+ set(WYVRN_ALWAYS_HAS_AVX 1)
252
+ if(WYVRN_MIN_CPU_ARCH_X64 STREQUAL "AVX2" OR WYVRN_MIN_CPU_ARCH_X64 STREQUAL "AVX512")
253
+ set(WYVRN_ALWAYS_HAS_AVX2 1)
254
+ set(WYVRN_ALWAYS_HAS_FMA3 1)
255
+ endif()
256
+ if(WYVRN_MIN_CPU_ARCH_X64 STREQUAL "AVX512")
257
+ set(WYVRN_ALWAYS_HAS_AVX512 1)
258
+ endif()
259
+ endif()
260
+
261
+ # -- Emit WYVRN_CPU_* + vector-intrinsics selector compile definitions --
262
+ foreach(_cpu X86_FAMILY ARM_FAMILY)
263
+ if(WYVRN_CPU_${_cpu})
264
+ add_compile_definitions(WYVRN_CPU_${_cpu}=1)
265
+ endif()
266
+ endforeach()
267
+ if(WYVRN_ENABLE_VECTORINTRINSICS)
268
+ add_compile_definitions(WYVRN_ENABLE_VECTORINTRINSICS=1)
269
+ endif()
270
+ if(WYVRN_ENABLE_VECTORINTRINSICS_NEON)
271
+ add_compile_definitions(WYVRN_ENABLE_VECTORINTRINSICS_NEON=1)
272
+ endif()
273
+
274
+ # The AVX floor is always emitted (0 or 1) so headers can `#if WYVRN_ALWAYS_HAS_AVX`
275
+ # without an #ifdef guard, mirroring UE's PLATFORM_ALWAYS_HAS_AVX.
276
+ add_compile_definitions(
277
+ WYVRN_ALWAYS_HAS_AVX=${WYVRN_ALWAYS_HAS_AVX}
278
+ WYVRN_ALWAYS_HAS_AVX2=${WYVRN_ALWAYS_HAS_AVX2}
279
+ WYVRN_ALWAYS_HAS_AVX512=${WYVRN_ALWAYS_HAS_AVX512}
280
+ WYVRN_ALWAYS_HAS_FMA3=${WYVRN_ALWAYS_HAS_FMA3}
281
+ )
282
+
283
+ message(STATUS "CPU family : X86=${WYVRN_CPU_X86_FAMILY} ARM=${WYVRN_CPU_ARM_FAMILY} (processor='${CMAKE_SYSTEM_PROCESSOR}')")
284
+ message(STATUS "CPU intrinsics : VECTORINTRINSICS=${WYVRN_ENABLE_VECTORINTRINSICS} NEON=${WYVRN_ENABLE_VECTORINTRINSICS_NEON} MIN_CPU_ARCH_X64=${WYVRN_MIN_CPU_ARCH_X64} (AVX=${WYVRN_ALWAYS_HAS_AVX} AVX2=${WYVRN_ALWAYS_HAS_AVX2} AVX512=${WYVRN_ALWAYS_HAS_AVX512} FMA3=${WYVRN_ALWAYS_HAS_FMA3})")
285
+
164
286
  # Put compiled artefacts inside the CMake binary dir so `wyvrnpm clean --all`
165
287
  # (which sweeps `<binaryDirRoot>/wyvrn-*/`) catches them. Pre-2.17 wyvrnpm
166
288
  # put these under `${CMAKE_SOURCE_DIR}/output/<bin|lib>${WYVRN_ARCH_SUFFIX}/`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wyvrnpm",
3
- "version": "2.21.2",
3
+ "version": "2.21.3",
4
4
  "description": "A simple, static-hosting-compatible C++ package manager",
5
5
  "keywords": [
6
6
  "c++",