diff --git a/doc/release/upcoming_changes/19513.new_feature.rst b/doc/release/upcoming_changes/19513.new_feature.rst new file mode 100644 index 000000000000..5f945cea2b68 --- /dev/null +++ b/doc/release/upcoming_changes/19513.new_feature.rst @@ -0,0 +1,4 @@ +Preliminary support for `windows/arm64` target +---------------------------------------------- +``numpy`` added support for windows/arm64 target. Please note +``OpenBLAS`` support is not yet available for windows/arm64 target. diff --git a/numpy/core/include/numpy/npy_cpu.h b/numpy/core/include/numpy/npy_cpu.h index 065176ac5fb6..bc1fad72f768 100644 --- a/numpy/core/include/numpy/npy_cpu.h +++ b/numpy/core/include/numpy/npy_cpu.h @@ -63,7 +63,8 @@ #define NPY_CPU_HPPA #elif defined(__alpha__) #define NPY_CPU_ALPHA -#elif defined(__arm__) || defined(__aarch64__) +#elif defined(__arm__) || defined(__aarch64__) || defined(_M_ARM64) + /* _M_ARM64 is defined in MSVC for ARM64 compilation on Windows */ #if defined(__ARMEB__) || defined(__AARCH64EB__) #if defined(__ARM_32BIT_STATE) #define NPY_CPU_ARMEB_AARCH32 @@ -72,10 +73,10 @@ #else #define NPY_CPU_ARMEB #endif - #elif defined(__ARMEL__) || defined(__AARCH64EL__) + #elif defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) #if defined(__ARM_32BIT_STATE) #define NPY_CPU_ARMEL_AARCH32 - #elif defined(__ARM_64BIT_STATE) + #elif defined(__ARM_64BIT_STATE) || defined(_M_ARM64) #define NPY_CPU_ARMEL_AARCH64 #else #define NPY_CPU_ARMEL diff --git a/numpy/core/tests/test_scalarprint.py b/numpy/core/tests/test_scalarprint.py index 620472683391..2f1c3bc5e309 100644 --- a/numpy/core/tests/test_scalarprint.py +++ b/numpy/core/tests/test_scalarprint.py @@ -154,7 +154,8 @@ def test_dragon4(self): "0.00000000000000000000000000000000000000000000140129846432" "4817070923729583289916131280261941876515771757068283889791" "08268586060148663818836212158203125") - assert_equal(fpos64(0.5**(1022 + 52), unique=False, precision=1074), + + assert_equal(fpos64(5e-324, unique=False, precision=1074), "0.00000000000000000000000000000000000000000000000000000000" "0000000000000000000000000000000000000000000000000000000000" "0000000000000000000000000000000000000000000000000000000000" diff --git a/numpy/random/src/philox/philox.h b/numpy/random/src/philox/philox.h index c72424a975ef..8844acc15725 100644 --- a/numpy/random/src/philox/philox.h +++ b/numpy/random/src/philox/philox.h @@ -33,10 +33,16 @@ static NPY_INLINE uint64_t mulhilo64(uint64_t a, uint64_t b, uint64_t *hip) { return (uint64_t)product; } #else -#ifdef _WIN32 +#if defined(_WIN32) #include #if defined(_WIN64) && defined(_M_AMD64) #pragma intrinsic(_umul128) +#elif defined(_WIN64) && defined(_M_ARM64) +#pragma intrinsic(__umulh) +static NPY_INLINE uint64_t _umul128(uint64_t a, uint64_t b, uint64_t *high) { + *high = __umulh(a, b); + return a * b; +} #else #pragma intrinsic(__emulu) static NPY_INLINE uint64_t _umul128(uint64_t a, uint64_t b, uint64_t *high) {