From: Nathan Moinvaziri Date: Sun, 25 Jan 2026 02:00:50 +0000 (-0800) Subject: Check cpuid availability on FreeBSD/OpenBSD when detecting fast/pmull X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36df93cb3ce42f829c5076afcfaf382fbdff9c50;p=thirdparty%2Fzlib-ng.git Check cpuid availability on FreeBSD/OpenBSD when detecting fast/pmull --- diff --git a/arch/arm/arm_features.c b/arch/arm/arm_features.c index 96e7679fe..20a363eb8 100644 --- a/arch/arm/arm_features.c +++ b/arch/arm/arm_features.c @@ -279,11 +279,10 @@ static inline int arm_cpu_has_fast_pmull(void) { /* On macOS, all Apple Silicon has fast PMULL */ has_fast_pmull = 1; #elif defined(ARCH_64BIT) && !defined(_WIN32) -# if defined(__linux__) - /* We have to support the CPUID feature in HWCAP */ + /* We need CPUID feature to read MIDR register */ if (!arm_has_cpuid()) return has_fast_pmull; -# endif + uint64_t midr; __asm__ ("mrs %0, midr_el1" : "=r" (midr));