From 22c2f02c0ccf4f56432ecbe3383113bfa2deee67 Mon Sep 17 00:00:00 2001 From: Raghuveer Devulapalli Date: Thu, 7 Sep 2023 13:37:01 -0700 Subject: [PATCH] Replace zmmi_t with regi_t --- src/avx512-64bit-common.h | 32 +++++++++++++------------- src/avx512-64bit-keyvalue-networks.hpp | 20 ++++++++-------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/avx512-64bit-common.h b/src/avx512-64bit-common.h index bbbd440b..3227e071 100644 --- a/src/avx512-64bit-common.h +++ b/src/avx512-64bit-common.h @@ -29,7 +29,7 @@ template <> struct ymm_vector { using type_t = float; using reg_t = __m256; - using zmmi_t = __m256i; + using regi_t = __m256i; using opmask_t = __mmask8; static const uint8_t numlanes = 8; @@ -45,7 +45,7 @@ struct ymm_vector { { return _mm256_set1_ps(type_max()); } - static zmmi_t + static regi_t seti(int v1, int v2, int v3, int v4, int v5, int v6, int v7, int v8) { return _mm256_set_epi32(v1, v2, v3, v4, v5, v6, v7, v8); @@ -189,7 +189,7 @@ template <> struct ymm_vector { using type_t = uint32_t; using reg_t = __m256i; - using zmmi_t = __m256i; + using regi_t = __m256i; using opmask_t = __mmask8; static const uint8_t numlanes = 8; @@ -206,7 +206,7 @@ struct ymm_vector { return _mm256_set1_epi32(type_max()); } - static zmmi_t + static regi_t seti(int v1, int v2, int v3, int v4, int v5, int v6, int v7, int v8) { return _mm256_set_epi32(v1, v2, v3, v4, v5, v6, v7, v8); @@ -335,7 +335,7 @@ template <> struct ymm_vector { using type_t = int32_t; using reg_t = __m256i; - using zmmi_t = __m256i; + using regi_t = __m256i; using opmask_t = __mmask8; static const uint8_t numlanes = 8; @@ -352,7 +352,7 @@ struct ymm_vector { return _mm256_set1_epi32(type_max()); } // TODO: this should broadcast bits as is? - static zmmi_t + static regi_t seti(int v1, int v2, int v3, int v4, int v5, int v6, int v7, int v8) { return _mm256_set_epi32(v1, v2, v3, v4, v5, v6, v7, v8); @@ -481,7 +481,7 @@ template <> struct zmm_vector { using type_t = int64_t; using reg_t = __m512i; - using zmmi_t = __m512i; + using regi_t = __m512i; using halfreg_t = __m512i; using opmask_t = __mmask8; static const uint8_t numlanes = 8; @@ -501,7 +501,7 @@ struct zmm_vector { return _mm512_set1_epi64(type_max()); } // TODO: this should broadcast bits as is? - static zmmi_t + static regi_t seti(int v1, int v2, int v3, int v4, int v5, int v6, int v7, int v8) { return _mm512_set_epi64(v1, v2, v3, v4, v5, v6, v7, v8); @@ -615,7 +615,7 @@ struct zmm_vector { } static reg_t reverse(reg_t zmm) { - const zmmi_t rev_index = seti(NETWORK_64BIT_2); + const regi_t rev_index = seti(NETWORK_64BIT_2); return permutexvar(rev_index, zmm); } static reg_t bitonic_merge(reg_t x) @@ -631,7 +631,7 @@ template <> struct zmm_vector { using type_t = uint64_t; using reg_t = __m512i; - using zmmi_t = __m512i; + using regi_t = __m512i; using halfreg_t = __m512i; using opmask_t = __mmask8; static const uint8_t numlanes = 8; @@ -651,7 +651,7 @@ struct zmm_vector { return _mm512_set1_epi64(type_max()); } - static zmmi_t + static regi_t seti(int v1, int v2, int v3, int v4, int v5, int v6, int v7, int v8) { return _mm512_set_epi64(v1, v2, v3, v4, v5, v6, v7, v8); @@ -753,7 +753,7 @@ struct zmm_vector { } static reg_t reverse(reg_t zmm) { - const zmmi_t rev_index = seti(NETWORK_64BIT_2); + const regi_t rev_index = seti(NETWORK_64BIT_2); return permutexvar(rev_index, zmm); } static reg_t bitonic_merge(reg_t x) @@ -769,7 +769,7 @@ template <> struct zmm_vector { using type_t = double; using reg_t = __m512d; - using zmmi_t = __m512i; + using regi_t = __m512i; using halfreg_t = __m512d; using opmask_t = __mmask8; static const uint8_t numlanes = 8; @@ -788,7 +788,7 @@ struct zmm_vector { { return _mm512_set1_pd(type_max()); } - static zmmi_t + static regi_t seti(int v1, int v2, int v3, int v4, int v5, int v6, int v7, int v8) { return _mm512_set_epi64(v1, v2, v3, v4, v5, v6, v7, v8); @@ -901,7 +901,7 @@ struct zmm_vector { } static reg_t reverse(reg_t zmm) { - const zmmi_t rev_index = seti(NETWORK_64BIT_2); + const regi_t rev_index = seti(NETWORK_64BIT_2); return permutexvar(rev_index, zmm); } static reg_t bitonic_merge(reg_t x) @@ -921,7 +921,7 @@ struct zmm_vector { template X86_SIMD_SORT_INLINE reg_t sort_zmm_64bit(reg_t zmm) { - const typename vtype::zmmi_t rev_index = vtype::seti(NETWORK_64BIT_2); + const typename vtype::regi_t rev_index = vtype::seti(NETWORK_64BIT_2); zmm = cmp_merge( zmm, vtype::template shuffle(zmm), 0xAA); zmm = cmp_merge( diff --git a/src/avx512-64bit-keyvalue-networks.hpp b/src/avx512-64bit-keyvalue-networks.hpp index 62da3f77..e9577b79 100644 --- a/src/avx512-64bit-keyvalue-networks.hpp +++ b/src/avx512-64bit-keyvalue-networks.hpp @@ -5,8 +5,8 @@ template X86_SIMD_SORT_INLINE reg_t sort_zmm_64bit(reg_t key_zmm, index_type &index_zmm) { - const typename vtype1::zmmi_t rev_index1 = vtype1::seti(NETWORK_64BIT_2); - const typename vtype2::zmmi_t rev_index2 = vtype2::seti(NETWORK_64BIT_2); + const typename vtype1::regi_t rev_index1 = vtype1::seti(NETWORK_64BIT_2); + const typename vtype2::regi_t rev_index2 = vtype2::seti(NETWORK_64BIT_2); key_zmm = cmp_merge( key_zmm, vtype1::template shuffle(key_zmm), @@ -87,8 +87,8 @@ X86_SIMD_SORT_INLINE void bitonic_merge_two_zmm_64bit(reg_t &key_zmm1, index_type &index_zmm1, index_type &index_zmm2) { - const typename vtype1::zmmi_t rev_index1 = vtype1::seti(NETWORK_64BIT_2); - const typename vtype2::zmmi_t rev_index2 = vtype2::seti(NETWORK_64BIT_2); + const typename vtype1::regi_t rev_index1 = vtype1::seti(NETWORK_64BIT_2); + const typename vtype2::regi_t rev_index2 = vtype2::seti(NETWORK_64BIT_2); // 1) First step of a merging network: coex of zmm1 and zmm2 reversed key_zmm2 = vtype1::permutexvar(rev_index1, key_zmm2); index_zmm2 = vtype2::permutexvar(rev_index2, index_zmm2); @@ -120,8 +120,8 @@ template