mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 03:17:15 +02:00
streamlined unprotected_bulk_visit
This commit is contained in:
@ -1318,11 +1318,8 @@ private:
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
template<typename GroupAccessMode,
|
template<typename GroupAccessMode,typename FwdIterator,typename F>
|
||||||
typename FwdIterator,typename F
|
BOOST_FORCEINLINE std::size_t unprotected_bulk_visit(
|
||||||
>
|
|
||||||
BOOST_FORCEINLINE
|
|
||||||
std::size_t unprotected_bulk_visit(
|
|
||||||
GroupAccessMode access_mode,FwdIterator first,std::size_t m,F&& f)const
|
GroupAccessMode access_mode,FwdIterator first,std::size_t m,F&& f)const
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(s<2*bulk_visit_size);
|
BOOST_ASSERT(s<2*bulk_visit_size);
|
||||||
@ -1356,21 +1353,10 @@ private:
|
|||||||
auto pg=this->arrays.groups()+pos;
|
auto pg=this->arrays.groups()+pos;
|
||||||
auto mask=masks[i];
|
auto mask=masks[i];
|
||||||
element_type *p;
|
element_type *p;
|
||||||
if(mask){
|
if(!mask)goto post_mask;
|
||||||
p=this->arrays.elements()+pos*N;
|
p=this->arrays.elements()+pos*N;
|
||||||
goto post_prefetch;
|
for(;;){
|
||||||
}
|
{
|
||||||
else{
|
|
||||||
goto post_mask;
|
|
||||||
}
|
|
||||||
do{
|
|
||||||
pos=pb.get();
|
|
||||||
pg=this->arrays.groups()+pos;
|
|
||||||
mask=pg->match(hashes[i]);
|
|
||||||
if(BOOST_UNLIKELY(mask!=0)){ /* unlikely bc we're past the 1st probe */
|
|
||||||
p=this->arrays.elements()+pos*N;
|
|
||||||
BOOST_UNORDERED_PREFETCH_ELEMENTS(p,N);
|
|
||||||
post_prefetch:
|
|
||||||
auto lck=access(access_mode,pos);
|
auto lck=access(access_mode,pos);
|
||||||
do{
|
do{
|
||||||
auto n=unchecked_countr_zero(mask);
|
auto n=unchecked_countr_zero(mask);
|
||||||
@ -1385,11 +1371,17 @@ private:
|
|||||||
}while(mask);
|
}while(mask);
|
||||||
}
|
}
|
||||||
post_mask:
|
post_mask:
|
||||||
if(BOOST_LIKELY(pg->is_not_overflowed(hashes[i]))){
|
if(BOOST_LIKELY(pg->is_not_overflowed(hashes[i]))||
|
||||||
|
BOOST_UNLIKELY(!pb.next(this->arrays.groups_size_mask))){
|
||||||
goto next_key;
|
goto next_key;
|
||||||
}
|
}
|
||||||
|
pos=pb.get();
|
||||||
|
pg=this->arrays.groups()+pos;
|
||||||
|
mask=pg->match(hashes[i]);
|
||||||
|
if(BOOST_LIKELY(mask==0))goto next_key;
|
||||||
|
p=this->arrays.elements()+pos*N;
|
||||||
|
BOOST_UNORDERED_PREFETCH_ELEMENTS(p,N);
|
||||||
}
|
}
|
||||||
while(BOOST_LIKELY(pb.next(this->arrays.groups_size_mask)));
|
|
||||||
next_key:;
|
next_key:;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
Reference in New Issue
Block a user