diff --git a/bottleneck/src/bn_config.py b/bottleneck/src/bn_config.py index 43264c5a6..b3f1f7de4 100644 --- a/bottleneck/src/bn_config.py +++ b/bottleneck/src/bn_config.py @@ -3,6 +3,7 @@ """ import os import sys +import platform import textwrap from distutils.command.config import config as Config from typing import List @@ -11,7 +12,9 @@ ("HAVE_ATTRIBUTE_OPTIMIZE_OPT_3", '__attribute__((optimize("O3")))') ] -OPTIONAL_HEADERS = [("HAVE_SSE2", "emmintrin.h")] +OPTIONAL_HEADERS = ( + [] if platform.machine() == "arm64" else [("HAVE_SSE2", "emmintrin.h")] +) OPTIONAL_INTRINSICS = [ ("HAVE___BUILTIN_ISNAN", "__builtin_isnan", "0."), diff --git a/bottleneck/src/reduce_template.c b/bottleneck/src/reduce_template.c index f80d96ab0..6ef249ae9 100644 --- a/bottleneck/src/reduce_template.c +++ b/bottleneck/src/reduce_template.c @@ -1313,7 +1313,7 @@ REDUCE_ONE(anynan, DTYPE0) { #else for (npy_intp i = 0; (i < loop_count) && (f == 0); i++) { for (npy_intp j = 0; j < LOOP_SIZE; j++) { - ai = pa[vector_offset + i * LOOP_SIZE + j]; + const npy_DTYPE0 ai = pa[vector_offset + i * LOOP_SIZE + j]; f += bn_isnan(ai); } } @@ -1517,7 +1517,7 @@ REDUCE_ONE(allnan, DTYPE0) { #else for (npy_intp i = 0; (i < loop_count) && (f == 0); i++) { for (npy_intp j = 0; j < LOOP_SIZE; j++) { - ai = pa[vector_offset + i * LOOP_SIZE + j]; + const npy_DTYPE0 ai = pa[vector_offset + i * LOOP_SIZE + j]; f += !bn_isnan(ai); } }