Fixed issue where Clang on FreeBSD failed to compile mlx/backend/cpu/quantized.cpp (#1890)

This commit is contained in:
Jesper Stemann Andersen 2025-02-20 21:02:12 +01:00 committed by GitHub
parent bbda0fdbdb
commit 0ebc8a3d25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -164,8 +164,8 @@ simd::Simd<uint32_t, S> extract_bits_simd(const uint32_t* w) {
} else if constexpr (bits == 8 && S == 8) { } else if constexpr (bits == 8 && S == 8) {
constexpr std::array<uint32_t, 8> shifts_ = {{0, 8, 16, 24, 0, 8, 16, 24}}; constexpr std::array<uint32_t, 8> shifts_ = {{0, 8, 16, 24, 0, 8, 16, 24}};
auto shifts(*(simd::Simd<uint32_t, S>*)&shifts_); auto shifts(*(simd::Simd<uint32_t, S>*)&shifts_);
auto l = simd::Simd<uint32_t, 4>(*w++); auto l = simd::Simd<uint32_t, S / 2>(*w++);
auto r = simd::Simd<uint32_t, 4>(*w); auto r = simd::Simd<uint32_t, S / 2>(*w);
wi = simd::Simd<uint32_t, S>(l, r); wi = simd::Simd<uint32_t, S>(l, r);
wi = wi >> shifts; wi = wi >> shifts;
wi = wi & bitmask; wi = wi & bitmask;