diff options
author | Qiyu8 <fangchunlin@huawei.com> | 2020-08-20 19:48:12 +0800 |
---|---|---|
committer | Qiyu8 <fangchunlin@huawei.com> | 2020-08-20 19:48:12 +0800 |
commit | 81e08d9a04d2a7e2aab231ac86909e3837e5630e (patch) | |
tree | 75eb611d4ee12b210cbba069512b7d2b76983d6d | |
parent | 72a5a89865805a0a07d397e84d2897fc8c5f8557 (diff) | |
download | numpy-81e08d9a04d2a7e2aab231ac86909e3837e5630e.tar.gz |
remove npyv_cvt and fix typos.
-rw-r--r-- | numpy/core/src/common/simd/avx2/conversion.h | 4 | ||||
-rw-r--r-- | numpy/core/src/common/simd/avx512/conversion.h | 4 | ||||
-rw-r--r-- | numpy/core/src/common/simd/neon/conversion.h | 4 | ||||
-rw-r--r-- | numpy/core/src/common/simd/sse/conversion.h | 4 | ||||
-rw-r--r-- | numpy/core/src/common/simd/vsx/conversion.h | 4 | ||||
-rw-r--r-- | numpy/core/src/multiarray/compiled_base.dispatch.c | 12 |
6 files changed, 5 insertions, 27 deletions
diff --git a/numpy/core/src/common/simd/avx2/conversion.h b/numpy/core/src/common/simd/avx2/conversion.h index 86e7ab6eb..9fd86016d 100644 --- a/numpy/core/src/common/simd/avx2/conversion.h +++ b/numpy/core/src/common/simd/avx2/conversion.h @@ -29,8 +29,4 @@ #define npyv_cvt_b32_f32(BL) _mm256_castps_si256(BL) #define npyv_cvt_b64_f64(BL) _mm256_castpd_si256(BL) -// convert integer vectors between different sizes -#define npyv_cvt_u64_u8(A) A -#define npyv_cvt_u8_u64(A) A - #endif // _NPY_SIMD_AVX2_CVT_H diff --git a/numpy/core/src/common/simd/avx512/conversion.h b/numpy/core/src/common/simd/avx512/conversion.h index 1160480c1..0f7e27de3 100644 --- a/numpy/core/src/common/simd/avx512/conversion.h +++ b/numpy/core/src/common/simd/avx512/conversion.h @@ -51,8 +51,4 @@ #define npyv_cvt_b32_f32(A) npyv_cvt_b32_u32(_mm512_castps_si512(A)) #define npyv_cvt_b64_f64(A) npyv_cvt_b64_u64(_mm512_castpd_si512(A)) -// convert integer vectors between different sizes -#define npyv_cvt_u64_u8(A) A -#define npyv_cvt_u8_u64(A) A - #endif // _NPY_SIMD_AVX512_CVT_H diff --git a/numpy/core/src/common/simd/neon/conversion.h b/numpy/core/src/common/simd/neon/conversion.h index 60bc263b7..b286931d1 100644 --- a/numpy/core/src/common/simd/neon/conversion.h +++ b/numpy/core/src/common/simd/neon/conversion.h @@ -29,8 +29,4 @@ #define npyv_cvt_b32_f32(BL) vreinterpretq_u32_f32(BL) #define npyv_cvt_b64_f64(BL) vreinterpretq_u64_f64(BL) -// convert integer vectors between different sizes -#define npyv_cvt_u64_u8(A) vreinterpretq_u8_u64(A) -#define npyv_cvt_u8_u64(A) vreinterpretq_u64_u8(A) - #endif // _NPY_SIMD_NEON_CVT_H diff --git a/numpy/core/src/common/simd/sse/conversion.h b/numpy/core/src/common/simd/sse/conversion.h index 36ed18d8c..ea9660d13 100644 --- a/numpy/core/src/common/simd/sse/conversion.h +++ b/numpy/core/src/common/simd/sse/conversion.h @@ -29,8 +29,4 @@ #define npyv_cvt_b32_f32(A) _mm_castps_si128(A) #define npyv_cvt_b64_f64(A) _mm_castpd_si128(A) -// convert integer vectors between different sizes -#define npyv_cvt_u64_u8(A) A -#define npyv_cvt_u8_u64(A) A - #endif // _NPY_SIMD_SSE_CVT_H diff --git a/numpy/core/src/common/simd/vsx/conversion.h b/numpy/core/src/common/simd/vsx/conversion.h index 49e474136..6ed135990 100644 --- a/numpy/core/src/common/simd/vsx/conversion.h +++ b/numpy/core/src/common/simd/vsx/conversion.h @@ -29,8 +29,4 @@ #define npyv_cvt_b32_f32(A) ((npyv_b32) A) #define npyv_cvt_b64_f64(A) ((npyv_b64) A) -// convert integer vectors between different sizes -#define npyv_cvt_u64_u8(A) ((npyv_u8) A) -#define npyv_cvt_u8_u64(A) ((npyv_u64) A) - #endif // _NPY_SIMD_VSX_CVT_H diff --git a/numpy/core/src/multiarray/compiled_base.dispatch.c b/numpy/core/src/multiarray/compiled_base.dispatch.c index d288ebde3..1cdcc08af 100644 --- a/numpy/core/src/multiarray/compiled_base.dispatch.c +++ b/numpy/core/src/multiarray/compiled_base.dispatch.c @@ -1,7 +1,6 @@ /** * @targets $maxopt baseline * SSE2 AVX2 - * VSX VSX2 * NEON ASIMDDP */ #include "compiled_base.h" @@ -34,8 +33,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(compiled_base_pack_inner) for (index = 0; index < vn_out; index += vstep) { // Maximum paraller abillity: handle four 64bits at one time npy_uint64 a[4]; - unsigned int r; - for(int i = 0; i < vstep; i++) { + for (int i = 0; i < vstep; i++) { a[i] = *(npy_uint64*)(inptr + 8 * i); if (order == 'b') { a[i] = npy_bswap8(a[i]); @@ -49,10 +47,10 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(compiled_base_pack_inner) v = npyv_set_u64(a[0], a[1]); } /* false -> 0x00 and true -> 0xFF (there is no cmpneq) */ - v = npyv_cvt_u8_u64(npyv_cmpeq_u8(npyv_cvt_u64_u8(v), npyv_cvt_u64_u8(zero))); - v = npyv_cvt_u8_u64(npyv_cmpeq_u8(npyv_cvt_u64_u8(v), npyv_cvt_u64_u8(zero))); + v = npyv_reinterpret_u8_u64(npyv_cmpeq_u8(npyv_reinterpret_u8_u64(v), npyv_reinterpret_u8_u64(zero))); + v = npyv_reinterpret_u8_u64(npyv_cmpeq_u8(npyv_reinterpret_u8_u64(v), npyv_reinterpret_u8_u64(zero))); /* extract msb of 16 bytes and pack it into 16 bit */ - r = npyv_movemask_u8(npyv_cvt_u64_u8(v)); + unsigned int r = npyv_movemask_u8(npyv_reinterpret_u8_u64(v)); /* store result */ for (int i = 0; i < vstep; i++) { memcpy(outptr, (char*)&r + i, 1); @@ -98,4 +96,4 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(compiled_base_pack_inner) *outptr = (char)build; outptr += out_stride; } -}
\ No newline at end of file +} |