Skip to content

Commit 6b0b37b

Browse files
Raghuveer Devulapallisterrettm2
authored andcommitted
Use smart pivot in key-value
1 parent f99c392 commit 6b0b37b

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/avx512-64bit-common.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ struct ymm_vector<float> {
3434
using opmask_t = __mmask8;
3535
static const uint8_t numlanes = 8;
3636
static constexpr simd_type vec_type = simd_type::AVX512;
37+
using swizzle_ops = avx512_ymm_64bit_swizzle_ops;
3738

3839
using swizzle_ops = avx512_ymm_64bit_swizzle_ops;
3940

@@ -210,6 +211,9 @@ struct ymm_vector<float> {
210211
{
211212
return _mm256_castps_si256(v);
212213
}
214+
static bool all_false(opmask_t k){
215+
return k == 0;
216+
}
213217
static reg_t reverse(reg_t ymm)
214218
{
215219
const __m256i rev_index = _mm256_set_epi32(NETWORK_32BIT_AVX2_2);
@@ -232,6 +236,7 @@ struct ymm_vector<uint32_t> {
232236
using opmask_t = __mmask8;
233237
static const uint8_t numlanes = 8;
234238
static constexpr simd_type vec_type = simd_type::AVX512;
239+
using swizzle_ops = avx512_ymm_64bit_swizzle_ops;
235240

236241
using swizzle_ops = avx512_ymm_64bit_swizzle_ops;
237242

@@ -394,6 +399,9 @@ struct ymm_vector<uint32_t> {
394399
{
395400
return v;
396401
}
402+
static bool all_false(opmask_t k){
403+
return k == 0;
404+
}
397405
static reg_t reverse(reg_t ymm)
398406
{
399407
const __m256i rev_index = _mm256_set_epi32(NETWORK_32BIT_AVX2_2);
@@ -416,6 +424,7 @@ struct ymm_vector<int32_t> {
416424
using opmask_t = __mmask8;
417425
static const uint8_t numlanes = 8;
418426
static constexpr simd_type vec_type = simd_type::AVX512;
427+
using swizzle_ops = avx512_ymm_64bit_swizzle_ops;
419428

420429
using swizzle_ops = avx512_ymm_64bit_swizzle_ops;
421430

@@ -578,6 +587,9 @@ struct ymm_vector<int32_t> {
578587
{
579588
return v;
580589
}
590+
static bool all_false(opmask_t k){
591+
return k == 0;
592+
}
581593
static reg_t reverse(reg_t ymm)
582594
{
583595
const __m256i rev_index = _mm256_set_epi32(NETWORK_32BIT_AVX2_2);

src/xss-common-keyvaluesort.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,10 @@ X86_SIMD_SORT_INLINE void kvsort_(type1_t *keys,
392392
return;
393393
}
394394

395-
type1_t pivot = get_pivot_blocks<vtype1>(keys, left, right);
395+
type1_t pivot;
396+
auto pivot_result = get_pivot_smart<vtype1, type1_t>(keys, left, right);
397+
pivot = pivot_result.pivot;
398+
396399
type1_t smallest = vtype1::type_max();
397400
type1_t biggest = vtype1::type_min();
398401
arrsize_t pivot_index = kvpartition_unrolled<vtype1, vtype2, 4>(

0 commit comments

Comments
 (0)