]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Test building with ClangCl for Windows ARM64
authorMika Lindqvist <postmaster@raasu.org>
Mon, 4 May 2026 15:08:08 +0000 (18:08 +0300)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Mon, 18 May 2026 18:57:20 +0000 (20:57 +0200)
.github/workflows/cmake.yml
arch/arm/acle_intrins.h
arch/arm/crc32_armv8_pmull_eor3.c
arch/arm/neon_intrins.h
cmake/detect-intrinsics.cmake

index 306b2169457fb8ba569af9907cf63584ba493e7a..b240f4699cf27edb8fbdac1405aac27e4ed5cd75 100644 (file)
@@ -590,6 +590,11 @@ jobs:
             cmake-args: -A ARM64EC
             # Coverage disabled for msvc
 
+          - name: Windows ClangCl ARM64
+            os: windows-11-arm
+            cmake-args: -T ClangCl -A ARM64
+            # Coverage disabled for clangcl
+
           - name: Windows ClangCl Win32
             os: windows-latest
             cmake-args: -T ClangCl -A Win32
index 16f5e2c77cd7ae3e081c6290abb69653ebcd82a0..e2b6035af27cb1c976ccc91d147d31c71c46ac7d 100644 (file)
@@ -2,7 +2,7 @@
 #define ARM_ACLE_INTRINS_H
 
 #include <stdint.h>
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && !defined(__clang__)
 #  include <intrin.h>
 #elif defined(HAVE_ARM_ACLE_H)
 #  include <arm_acle.h>
index 0e6b2bce4f62f77a4a00a4c1649647d408d6b72e..ad72e593020462cb5e4fe0a4c2d8c5a2f4134b6a 100644 (file)
@@ -17,7 +17,7 @@
 
 /* Carryless multiply low 64 bits: a[0] * b[0] */
 static inline uint64x2_t clmul_lo(uint64x2_t a, uint64x2_t b) {
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && !defined(__clang__)
     return vreinterpretq_u64_p128(vmull_p64(
         vget_low_p64(vreinterpret_p64_u64(a)),
         vget_low_p64(vreinterpret_p64_u64(b))));
@@ -35,7 +35,7 @@ static inline uint64x2_t clmul_hi(uint64x2_t a, uint64x2_t b) {
 
 /* Carryless multiply of two 32-bit scalars: a * b (returns 64-bit result in 128-bit vector) */
 static inline uint64x2_t clmul_scalar(uint32_t a, uint32_t b) {
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && !defined(__clang__)
     return vreinterpretq_u64_p128(vmull_p64(vdup_n_p64((poly64_t)a), vdup_n_p64((poly64_t)b)));
 #else
     return vreinterpretq_u64_p128(vmull_p64((poly64_t)a, (poly64_t)b));
index 449916e0b7ac5e1f4d092dd78c33586e6fb605d3..97072ba554431697f619edd669acdc8082bce87b 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef ARM_NEON_INTRINS_H
 #define ARM_NEON_INTRINS_H
 
-#if defined(_MSC_VER) && defined(ARCH_ARM) && defined(ARCH_64BIT)
+#if defined(_MSC_VER) && !defined(__clang__) && defined(ARCH_ARM) && defined(ARCH_64BIT)
 /* arm64_neon.h is MSVC specific */
 #  include <arm64_neon.h>
 #else
@@ -63,12 +63,12 @@ static inline void vst1q_u16_x4(uint16_t *p, uint16x8x4_t a) {
 }
 #  endif // HASLD4 check
 
-#  ifndef _MSC_VER
+#  if !defined(_MSC_VER) || defined(__clang__)
 #    define vld1_u8_ex(p, align) vld1_u8(HINT_ALIGNED((p), (align)/8))
 #    define vld1q_u8_ex(p, align) vld1q_u8(HINT_ALIGNED((p), (align)/8))
 #    define vld1q_u64_ex(p, align) vld1q_u64(HINT_ALIGNED((p), (align)/8))
 #  endif
-#  if !defined(_MSC_VER) || !defined(ARM_NEON_HASLD4)
+#  if !defined(_MSC_VER) || !defined(ARM_NEON_HASLD4) || defined(__clang__)
 #    define vld1q_u8_x4_ex(p, align) vld1q_u8_x4(HINT_ALIGNED((p), (align)/8))
 #    define vld1q_u16_x4_ex(p, align) vld1q_u16_x4(HINT_ALIGNED((p), (align)/8))
 #    define vst1q_u16_x4_ex(p, a, align) vst1q_u16_x4(HINT_ALIGNED((p), (align)/8), a)
index bc68c04f5fc6b37d86029398d372c01766dfed8d..56bd7ca7b77a219888d972d41b33875b12af3107 100644 (file)
@@ -42,7 +42,7 @@ macro(check_armv8_compiler_flag)
     )
     # Check whether compiler supports ARMv8 intrinsics
     check_c_source_compiles(
-        "#if defined(_MSC_VER)
+        "#if defined(_MSC_VER) && !defined(__clang__)
         #include <intrin.h>
         #else
         #include <arm_acle.h>
@@ -73,12 +73,12 @@ macro(check_armv8_pmull_eor3_compiler_flag)
     # Check whether compiler supports ARMv8 PMULL + EOR3 intrinsics
     set(CMAKE_REQUIRED_FLAGS "${PMULLEOR3FLAG} ${NATIVEFLAG} ${ZNOLTOFLAG}")
     check_c_source_compiles(
-        "#if defined(_MSC_VER) && (defined(_M_ARM64) || defined(_M_ARM64EC))
+        "#if defined(_MSC_VER) && !defined(__clang__) && (defined(_M_ARM64) || defined(_M_ARM64EC))
         #  include <arm64_neon.h>
         #else
         #  include <arm_neon.h>
         #endif
-        #ifdef _MSC_VER
+        #if defined(_MSC_VER) && !defined(__clang__)
         __n128 f(__n64 a, __n64 b) {
         #else
         poly128_t f(poly64_t a, poly64_t b) {
@@ -260,7 +260,7 @@ macro(check_neon_compiler_flag)
     # Check whether compiler supports NEON flag
     set(CMAKE_REQUIRED_FLAGS "${NEONFLAG} ${NATIVEFLAG} ${ZNOLTOFLAG}")
     check_c_source_compiles(
-        "#if defined(_M_ARM64) || defined(_M_ARM64EC)
+        "#if defined(_MSC_VER) && !defined(__clang__) && (defined(_M_ARM64) || defined(_M_ARM64EC))
         #  include <arm64_neon.h>
         #else
         #  include <arm_neon.h>
@@ -323,7 +323,7 @@ macro(check_neon_ld4_intrinsics)
     # Check whether compiler supports loading 4 neon vecs into a register range
     set(CMAKE_REQUIRED_FLAGS "${NEONFLAG} ${NATIVEFLAG} ${ZNOLTOFLAG}")
     check_c_source_compiles(
-        "#if defined(_MSC_VER) && (defined(_M_ARM64) || defined(_M_ARM64EC))
+        "#if defined(_MSC_VER) && !defined(__clang__) && (defined(_M_ARM64) || defined(_M_ARM64EC))
         #  include <arm64_neon.h>
         #else
         #  include <arm_neon.h>