From 9ab9fe5aa8eebd56eb9496fc6ec396e1a1a33d45 Mon Sep 17 00:00:00 2001 From: dragon-archer Date: Tue, 16 Sep 2025 21:43:49 +0800 Subject: [PATCH] [Compile Error] Fix type mismatch in bitmap.c `vzero12` is of type `uint16x8_t`, to narrow it to `uint8x8_t`, we should use `vmovn_u16` instead of `vmovn_u32`. With out this patch, mimalloc will failed to compile with `-DCMAKE_BUILD_TYPE=Release -DMI_OPT_ARCH=ON -DMI_OPT_SIMD=ON` cmake options and gcc 10.3.1 on aarch64 platforms --- src/bitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bitmap.c b/src/bitmap.c index 66ebc157..2021286b 100644 --- a/src/bitmap.c +++ b/src/bitmap.c @@ -655,7 +655,7 @@ static inline bool mi_bchunk_try_find_and_clear(mi_bchunk_t* chunk, size_t* pidx const uint32x4_t vzero1x = vreinterpretq_u32_u64(vshrq_n_u64(vreinterpretq_u64_u32(vzero1), 24)); // shift-right 2x32bit elem by 24: lo 16 bits contain the 2 lo bytes const uint32x4_t vzero2x = vreinterpretq_u32_u64(vshrq_n_u64(vreinterpretq_u64_u32(vzero2), 24)); const uint16x8_t vzero12 = vreinterpretq_u16_u32(vuzp1q_u32(vzero1x,vzero2x)); // unzip even 32-bit elements into one vector - const uint8x8_t vzero = vmovn_u32(vzero12); // narrow the bottom 16-bits + const uint8x8_t vzero = vmovn_u16(vzero12); // narrow the bottom 16-bits const uint64_t mask = ~vget_lane_u64(vreinterpret_u64_u8(vzero), 0); // 1 byte for each bfield (0xFF => bfield has a bit set) if (mask==0) return false; mi_assert_internal((mi_ctz(mask)%8) == 0); // tzcnt == 0, 8, 16, 24 , ..