zupt/vendor/vuptsdk/include/zupt_cpuid.h
Cristian Cezar Moisés 59f9ebc59e codec: update vendored VaptVupt codec 2.65.0 -> 2.65.3
From vaptvupt-codec tag v2.65.3. Output is byte-identical to 2.65.0 (same
ratio, wire format v1.6 unchanged) but extreme-mode encode is ~1.6-2x faster
(Sprint 132 optimal-parser speedup) and the extreme prepass window allocation
is capped at wlog=20 = 8 MiB virtual instead of up to 128 MiB (Sprint 133
memory hygiene). Our AVX2 offset-read decoder guard is now UPSTREAM (dropped
from the local patch set); the ANS safe-zone 2*SAFEZONE_MAX_RUN reserve is
re-applied on top (still not upstream). make check 16/16, KAT 16/16, cross-
version roundtrip with 5.1.0 archives verified.
2026-07-12 14:47:40 -03:00

33 lines
1.1 KiB
C

/*
* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (c) 2026 Cristian Cezar Moisés
*
* Zupt — CPU Feature Detection
* Copyright (c) 2026 Cristian Cezar Moisés — AGPL-3.0-or-later
*/
#ifndef ZUPT_CPUID_H
#define ZUPT_CPUID_H
#include <stdint.h>
typedef struct {
int has_aesni; /* CPUID.01H:ECX[25] — AES-NI instructions */
int has_avx; /* AVX (VEX-encoded SSE) — requires CPUID + OS XSAVE */
int has_pclmul; /* CPUID.01H:ECX[1] — CLMUL (carry-less multiply) */
int has_avx2; /* CPUID.07H:EBX[5] — AVX2 (256-bit SIMD) */
int has_sse41; /* CPUID.01H:ECX[19] — SSE4.1 */
} zupt_cpu_features_t;
/*@ assigns f->has_aesni, f->has_avx, f->has_pclmul, f->has_avx2, f->has_sse41;
@ ensures f->has_aesni == 0 || f->has_aesni == 1;
@ ensures f->has_avx == 0 || f->has_avx == 1;
@ ensures f->has_pclmul == 0 || f->has_pclmul == 1;
@ ensures f->has_avx2 == 0 || f->has_avx2 == 1;
@ ensures f->has_sse41 == 0 || f->has_sse41 == 1;
*/
void zupt_detect_cpu(zupt_cpu_features_t *f);
/* Global instance — set once at program start */
extern zupt_cpu_features_t zupt_cpu;
#endif /* ZUPT_CPUID_H */