diff options
| author | Niyas Sait <niyas.sait@linaro.org> | 2021-07-27 21:08:31 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-27 14:08:31 -0600 |
| commit | 77bc3225e6f4badf83190ec300a0e10e56949644 (patch) | |
| tree | 965055d7cfa3ee1155be8ff090606dac0adea99e /numpy/random/src | |
| parent | 2a862700bd376800ff4495e572ca4c85c919a218 (diff) | |
| download | numpy-77bc3225e6f4badf83190ec300a0e10e56949644.tar.gz | |
ENH: Add support for windows on arm targets (#19513)
* add support for windows on arm targets
* Philox: Use _umulh intrinsic for ARM64 target
* CPU Detection: Refactor to avoid separate pre-processor definition for WoA
* adapt test_dragon4 to avoid using pow (**) to workaround issue in windows C RT for arm64
* Update numpy/core/include/numpy/npy_cpu.h
Co-authored-by: Matti Picus <matti.picus@gmail.com>
* add release note for numpy windows/arm64 support
* Update 19513.new_feature.rst
Co-authored-by: Matti Picus <matti.picus@gmail.com>
Co-authored-by: Charles Harris <charlesr.harris@gmail.com>
Diffstat (limited to 'numpy/random/src')
| -rw-r--r-- | numpy/random/src/philox/philox.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/numpy/random/src/philox/philox.h b/numpy/random/src/philox/philox.h index c72424a97..8844acc15 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 <intrin.h> #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) { |
