From 3d67b717a05764a510481a22d29c5931a5c19d06 Mon Sep 17 00:00:00 2001 From: Ronan Collobert Date: Wed, 29 Oct 2025 16:43:18 -0700 Subject: [PATCH] the cpu simd case --- mlx/backend/cpu/simd/accelerate_simd.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mlx/backend/cpu/simd/accelerate_simd.h b/mlx/backend/cpu/simd/accelerate_simd.h index 914831055..21c9d590d 100644 --- a/mlx/backend/cpu/simd/accelerate_simd.h +++ b/mlx/backend/cpu/simd/accelerate_simd.h @@ -253,12 +253,12 @@ Simd pow(Simd base, Simd exp) { } else { Simd res = 1; // Raising an integer to a negative power is undefined - if (any(exp < 0)) { + if (any(exp < static_cast(0))) { return 0; } - while (any(exp > 0)) { + while (any(exp > static_cast(0))) { res = select((exp & 1) != 0, res * base, res); - base = select(exp > 0, base * base, base); + base = select(exp > static_cast(0), base * base, base); exp = exp >> 1; } return res;