From 7b329a816eb5c13fe0c462560a49f5835381f5a6 Mon Sep 17 00:00:00 2001 From: Awni Hannun Date: Mon, 20 Oct 2025 14:23:09 -0700 Subject: [PATCH] fix for older OS --- mlx/backend/cpu/unary_ops.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mlx/backend/cpu/unary_ops.h b/mlx/backend/cpu/unary_ops.h index e30b86d83..1d8c0a457 100644 --- a/mlx/backend/cpu/unary_ops.h +++ b/mlx/backend/cpu/unary_ops.h @@ -122,7 +122,9 @@ struct ToFP8 { Simd operator()(Simd f) { uint32_t fp8_max = 1087 << 20; auto denorm_mask = Simd(141 << 23); - auto f_bits = fp32_to_bits(Simd(f)); + Simd f_bits; + Simd f32 = f; + f_bits = fp32_to_bits(f32); Simd result = 0u; auto sign = f_bits & 0x80000000; f_bits = f_bits ^ sign;