BitMagic-C++
Functions
SSE4.2 funcions (internal)

Processor specific optimizations for SSE4.2 instructions (internals) More...

Functions

bm::id_t bm::sse4_bit_count (const __m128i *block, const __m128i *block_end)
 
bool bm::sse4_is_all_zero (const __m128i *BMRESTRICT block)
 check if block is all zero bits More...
 
bool bm::sse4_is_digest_zero (const __m128i *BMRESTRICT block)
 check if digest stride is all zero bits More...
 
void bm::sse4_block_set_digest (__m128i *dst, unsigned value)
 set digest stride to 0xFF.. or 0x0 value More...
 
unsigned bm::sse4_and_block (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src)
 AND blocks2 dst &= *src. More...
 
bool bm::sse4_and_digest (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src)
 AND block digest stride dst &= *src. More...
 
bool bm::sse4_and_digest_2way (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src1, const __m128i *BMRESTRICT src2)
 AND block digest stride dst = *src1 & src2. More...
 
bool bm::sse4_and_digest_5way (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src1, const __m128i *BMRESTRICT src2, const __m128i *BMRESTRICT src3, const __m128i *BMRESTRICT src4)
 AND block digest stride. More...
 
bool bm::sse4_sub_digest (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src)
 SUB (AND NOT) block digest stride dst &= ~*src. More...
 
bool bm::sse4_sub_digest_2way (__m128i *BMRESTRICT dst, const __m128i *BMRESTRICT src1, const __m128i *BMRESTRICT src2)
 2-operand SUB (AND NOT) block digest stride dst = src1 & ~*src2 More...
 
bool bm::sse4_is_all_one (const __m128i *BMRESTRICT block)
 check if block is all zero bits More...
 
BMFORCEINLINE bool bm::sse42_test_all_zero_wave (const void *ptr)
 check if wave of pointers is all NULL More...
 
BMFORCEINLINE bool bm::sse42_test_all_zero_wave2 (const void *ptr0, const void *ptr1)
 check if 2 waves of pointers are all NULL More...
 
BMFORCEINLINE bool bm::sse42_test_all_eq_wave2 (const void *ptr0, const void *ptr1)
 check if wave of 2 pointers are the same (null or FULL) More...
 
unsigned bm::sse42_bit_block_calc_change (const __m128i *BMRESTRICT block)
 
unsigned bm::sse4_gap_find (const bm::gap_word_t *BMRESTRICT pbuf, const bm::gap_word_t pos, const unsigned size)
 
int bm::sse42_cmpge_u32 (__m128i vect4, unsigned value)
 Experimental (test) function to do SIMD vector search (lower bound) in sorted, growing array. More...
 
unsigned bm::sse4_lower_bound_scan_u32 (const unsigned *BMRESTRICT arr, unsigned target, unsigned from, unsigned to)
 lower bound (great or equal) linear scan in ascending order sorted array More...
 
bool bm::sse42_shift_l1 (__m128i *block, unsigned *empty_acc, unsigned co1)
 block shift left by 1 More...
 
bool bm::sse42_shift_r1 (__m128i *block, unsigned *empty_acc, unsigned co1)
 block shift right by 1 More...
 
bool bm::sse42_shift_r1_and (__m128i *block, bm::word_t co1, const __m128i *BMRESTRICT mask_block, bm::id64_t *digest)
 block shift right by 1 plus AND More...
 

Detailed Description

Processor specific optimizations for SSE4.2 instructions (internals)

Function Documentation

◆ sse42_bit_block_calc_change()

unsigned bm::sse42_bit_block_calc_change ( const __m128i *BMRESTRICT  block)
inline

SSE4.2 calculate number of bit changes from 0 to 1

Definition at line 622 of file bmsse4.h.

References bm::set_block_size.

◆ sse42_cmpge_u32()

int bm::sse42_cmpge_u32 ( __m128i  vect4,
unsigned  value 
)
inline

Experimental (test) function to do SIMD vector search (lower bound) in sorted, growing array.

Definition at line 767 of file bmsse4.h.

◆ sse42_shift_l1()

bool bm::sse42_shift_l1 ( __m128i *  block,
unsigned *  empty_acc,
unsigned  co1 
)
inline

block shift left by 1

Definition at line 1081 of file bmsse4.h.

References bm::set_block_size.

◆ sse42_shift_r1()

bool bm::sse42_shift_r1 ( __m128i *  block,
unsigned *  empty_acc,
unsigned  co1 
)
inline

block shift right by 1

Definition at line 1131 of file bmsse4.h.

References bm::set_block_size.

◆ sse42_shift_r1_and()

bool bm::sse42_shift_r1_and ( __m128i *  block,
bm::word_t  co1,
const __m128i *BMRESTRICT  mask_block,
bm::id64_t digest 
)
inline

block shift right by 1 plus AND

Returns
carry over flag

Definition at line 1181 of file bmsse4.h.

References BM_ASSERT, bm::id_max, and bm::set_block_digest_wave_size.

◆ sse42_test_all_eq_wave2()

BMFORCEINLINE bool bm::sse42_test_all_eq_wave2 ( const void *  ptr0,
const void *  ptr1 
)

check if wave of 2 pointers are the same (null or FULL)

Definition at line 608 of file bmsse4.h.

Referenced by bm::bvector<>::combine_operation_or().

◆ sse42_test_all_zero_wave()

BMFORCEINLINE bool bm::sse42_test_all_zero_wave ( const void *  ptr)

check if wave of pointers is all NULL

Definition at line 584 of file bmsse4.h.

Referenced by bm::bvector<>::combine_operation_and(), bm::bvector<>::combine_operation_sub(), bm::for_each_bit(), and bm::for_each_nzblock().

◆ sse42_test_all_zero_wave2()

BMFORCEINLINE bool bm::sse42_test_all_zero_wave2 ( const void *  ptr0,
const void *  ptr1 
)

check if 2 waves of pointers are all NULL

Definition at line 595 of file bmsse4.h.

Referenced by bm::bvector<>::combine_operation_xor().

◆ sse4_and_block()

unsigned bm::sse4_and_block ( __m128i *BMRESTRICT  dst,
const __m128i *BMRESTRICT  src 
)
inline

AND blocks2 dst &= *src.

Returns
0 if no bits were set

Definition at line 237 of file bmsse4.h.

References BMRESTRICT, and bm::set_block_size.

◆ sse4_and_digest()

bool bm::sse4_and_digest ( __m128i *BMRESTRICT  dst,
const __m128i *BMRESTRICT  src 
)
inline

AND block digest stride dst &= *src.

Returns
true if stide is all zero

Definition at line 284 of file bmsse4.h.

◆ sse4_and_digest_2way()

bool bm::sse4_and_digest_2way ( __m128i *BMRESTRICT  dst,
const __m128i *BMRESTRICT  src1,
const __m128i *BMRESTRICT  src2 
)
inline

AND block digest stride dst = *src1 & src2.

Returns
true if stide is all zero

Definition at line 332 of file bmsse4.h.

◆ sse4_and_digest_5way()

bool bm::sse4_and_digest_5way ( __m128i *BMRESTRICT  dst,
const __m128i *BMRESTRICT  src1,
const __m128i *BMRESTRICT  src2,
const __m128i *BMRESTRICT  src3,
const __m128i *BMRESTRICT  src4 
)
inline

AND block digest stride.

Returns
true if stide is all zero

Definition at line 379 of file bmsse4.h.

◆ sse4_bit_count()

bm::id_t bm::sse4_bit_count ( const __m128i *  block,
const __m128i *  block_end 
)
inline

SSE4.2 optimized bitcounting .

Definition at line 78 of file bmsse4.h.

◆ sse4_block_set_digest()

void bm::sse4_block_set_digest ( __m128i *  dst,
unsigned  value 
)
inline

set digest stride to 0xFF.. or 0x0 value

Definition at line 219 of file bmsse4.h.

◆ sse4_gap_find()

unsigned bm::sse4_gap_find ( const bm::gap_word_t *BMRESTRICT  pbuf,
const bm::gap_word_t  pos,
const unsigned  size 
)
inline

SSE4.2 check for one to two (variable len) 128 bit SSE lines for gap search results (8 elements)

Definition at line 706 of file bmsse4.h.

References BM_ASSERT, and BMRESTRICT.

Referenced by bm::gap_test_unr().

◆ sse4_is_all_one()

bool bm::sse4_is_all_one ( const __m128i *BMRESTRICT  block)
inline

check if block is all zero bits

Definition at line 559 of file bmsse4.h.

References BMRESTRICT, and bm::set_block_size.

◆ sse4_is_all_zero()

bool bm::sse4_is_all_zero ( const __m128i *BMRESTRICT  block)
inline

check if block is all zero bits

Definition at line 175 of file bmsse4.h.

References BMRESTRICT, and bm::set_block_size.

◆ sse4_is_digest_zero()

bool bm::sse4_is_digest_zero ( const __m128i *BMRESTRICT  block)
inline

check if digest stride is all zero bits

Definition at line 200 of file bmsse4.h.

◆ sse4_lower_bound_scan_u32()

unsigned bm::sse4_lower_bound_scan_u32 ( const unsigned *BMRESTRICT  arr,
unsigned  target,
unsigned  from,
unsigned  to 
)
inline

lower bound (great or equal) linear scan in ascending order sorted array

Definition at line 798 of file bmsse4.h.

References BMRESTRICT.

◆ sse4_sub_digest()

bool bm::sse4_sub_digest ( __m128i *BMRESTRICT  dst,
const __m128i *BMRESTRICT  src 
)
inline

SUB (AND NOT) block digest stride dst &= ~*src.

Returns
true if stide is all zero

Definition at line 462 of file bmsse4.h.

◆ sse4_sub_digest_2way()

bool bm::sse4_sub_digest_2way ( __m128i *BMRESTRICT  dst,
const __m128i *BMRESTRICT  src1,
const __m128i *BMRESTRICT  src2 
)
inline

2-operand SUB (AND NOT) block digest stride dst = src1 & ~*src2

Returns
true if stide is all zero

Definition at line 511 of file bmsse4.h.