BitMagic-C++
Namespaces | Macros | Functions
bmsse2.h File Reference

Compute functions for SSE2 SIMD instruction set (internal) More...

#include <mmintrin.h>
#include <emmintrin.h>
#include "bmdef.h"
#include "bmsse_util.h"
#include "bmutil.h"
Include dependency graph for bmsse2.h:

Go to the source code of this file.

Namespaces

 bm
 

Macros

#define VECT_XOR_ARR_2_MASK(dst, src, src_end, mask)   sse2_xor_arr_2_mask((__m128i*)(dst), (__m128i*)(src), (__m128i*)(src_end), (bm::word_t)mask)
 
#define VECT_ANDNOT_ARR_2_MASK(dst, src, src_end, mask)   sse2_andnot_arr_2_mask((__m128i*)(dst), (__m128i*)(src), (__m128i*)(src_end), (bm::word_t)mask)
 
#define VECT_BITCOUNT(first, last)   sse2_bit_count((__m128i*) (first), (__m128i*) (last))
 
#define VECT_BITCOUNT_AND(first, last, mask)   sse2_bit_count_op((__m128i*) (first), (__m128i*) (last), (__m128i*) (mask), sse2_and)
 
#define VECT_BITCOUNT_OR(first, last, mask)   sse2_bit_count_op((__m128i*) (first), (__m128i*) (last), (__m128i*) (mask), sse2_or)
 
#define VECT_BITCOUNT_XOR(first, last, mask)   sse2_bit_count_op((__m128i*) (first), (__m128i*) (last), (__m128i*) (mask), sse2_xor)
 
#define VECT_BITCOUNT_SUB(first, last, mask)   sse2_bit_count_op((__m128i*) (first), (__m128i*) (last), (__m128i*) (mask), sse2_sub)
 
#define VECT_INVERT_BLOCK(first)   sse2_invert_block((__m128i*)first);
 
#define VECT_AND_BLOCK(dst, src)   sse2_and_block((__m128i*) dst, (__m128i*) (src))
 
#define VECT_OR_BLOCK(dst, src)   sse2_or_block((__m128i*) dst, (__m128i*) (src))
 
#define VECT_OR_BLOCK_2WAY(dst, src1, src2)   sse2_or_block_2way((__m128i*) (dst), (__m128i*) (src1), (__m128i*) (src2))
 
#define VECT_OR_BLOCK_3WAY(dst, src1, src2)   sse2_or_block_3way((__m128i*) (dst), (__m128i*) (src1), (__m128i*) (src2))
 
#define VECT_OR_BLOCK_5WAY(dst, src1, src2, src3, src4)   sse2_or_block_5way((__m128i*) (dst), (__m128i*) (src1), (__m128i*) (src2), (__m128i*) (src3), (__m128i*) (src4))
 
#define VECT_SUB_BLOCK(dst, src)   sse2_sub_block((__m128i*) dst, (__m128i*) (src))
 
#define VECT_XOR_BLOCK(dst, src)   sse2_xor_block((__m128i*) dst, (__m128i*) (src))
 
#define VECT_XOR_BLOCK_2WAY(dst, src1, src2)   sse2_xor_block_2way((__m128i*) (dst), (const __m128i*) (src1), (const __m128i*) (src2))
 
#define VECT_COPY_BLOCK(dst, src)   sse2_copy_block((__m128i*) dst, (__m128i*) (src))
 
#define VECT_STREAM_BLOCK(dst, src)   sse2_stream_block((__m128i*) dst, (__m128i*) (src))
 
#define VECT_SET_BLOCK(dst, value)   sse2_set_block((__m128i*) dst, value)
 
#define VECT_GAP_BFIND(buf, pos, is_set)   sse2_gap_bfind(buf, pos, is_set)
 

Functions

bm::id_t bm::sse2_bit_count (const __m128i *block, const __m128i *block_end)
 
template<class Func >
bm::id_t bm::sse2_bit_count_op (const __m128i *BMRESTRICT block, const __m128i *BMRESTRICT block_end, const __m128i *BMRESTRICT mask_block, Func sse2_func)
 
bm::id_t bm::sse2_bit_block_calc_count_change (const __m128i *BMRESTRICT block, const __m128i *BMRESTRICT block_end, unsigned *BMRESTRICT bit_count)
 
unsigned bm::sse2_gap_find (const bm::gap_word_t *BMRESTRICT pbuf, const bm::gap_word_t pos, const unsigned size)
 
unsigned bm::sse2_gap_bfind (const unsigned short *BMRESTRICT buf, unsigned pos, unsigned *BMRESTRICT is_set)
 Hybrid binary search, starts as binary, then switches to linear scan. More...
 
unsigned bm::sse2_gap_test (const unsigned short *BMRESTRICT buf, unsigned pos)
 Hybrid binary search, starts as binary, then switches to scan. More...
 

Detailed Description

Compute functions for SSE2 SIMD instruction set (internal)

Definition in file bmsse2.h.

Macro Definition Documentation

◆ VECT_AND_BLOCK

#define VECT_AND_BLOCK (   dst,
  src 
)    sse2_and_block((__m128i*) dst, (__m128i*) (src))

Definition at line 498 of file bmsse2.h.

◆ VECT_ANDNOT_ARR_2_MASK

#define VECT_ANDNOT_ARR_2_MASK (   dst,
  src,
  src_end,
  mask 
)    sse2_andnot_arr_2_mask((__m128i*)(dst), (__m128i*)(src), (__m128i*)(src_end), (bm::word_t)mask)

Definition at line 477 of file bmsse2.h.

◆ VECT_BITCOUNT

#define VECT_BITCOUNT (   first,
  last 
)    sse2_bit_count((__m128i*) (first), (__m128i*) (last))

Definition at line 480 of file bmsse2.h.

◆ VECT_BITCOUNT_AND

#define VECT_BITCOUNT_AND (   first,
  last,
  mask 
)    sse2_bit_count_op((__m128i*) (first), (__m128i*) (last), (__m128i*) (mask), sse2_and)

Definition at line 483 of file bmsse2.h.

◆ VECT_BITCOUNT_OR

#define VECT_BITCOUNT_OR (   first,
  last,
  mask 
)    sse2_bit_count_op((__m128i*) (first), (__m128i*) (last), (__m128i*) (mask), sse2_or)

Definition at line 486 of file bmsse2.h.

◆ VECT_BITCOUNT_SUB

#define VECT_BITCOUNT_SUB (   first,
  last,
  mask 
)    sse2_bit_count_op((__m128i*) (first), (__m128i*) (last), (__m128i*) (mask), sse2_sub)

Definition at line 492 of file bmsse2.h.

◆ VECT_BITCOUNT_XOR

#define VECT_BITCOUNT_XOR (   first,
  last,
  mask 
)    sse2_bit_count_op((__m128i*) (first), (__m128i*) (last), (__m128i*) (mask), sse2_xor)

Definition at line 489 of file bmsse2.h.

◆ VECT_COPY_BLOCK

#define VECT_COPY_BLOCK (   dst,
  src 
)    sse2_copy_block((__m128i*) dst, (__m128i*) (src))

Definition at line 522 of file bmsse2.h.

◆ VECT_GAP_BFIND

#define VECT_GAP_BFIND (   buf,
  pos,
  is_set 
)    sse2_gap_bfind(buf, pos, is_set)

Definition at line 531 of file bmsse2.h.

◆ VECT_INVERT_BLOCK

#define VECT_INVERT_BLOCK (   first)    sse2_invert_block((__m128i*)first);

Definition at line 495 of file bmsse2.h.

◆ VECT_OR_BLOCK

#define VECT_OR_BLOCK (   dst,
  src 
)    sse2_or_block((__m128i*) dst, (__m128i*) (src))

Definition at line 501 of file bmsse2.h.

◆ VECT_OR_BLOCK_2WAY

#define VECT_OR_BLOCK_2WAY (   dst,
  src1,
  src2 
)    sse2_or_block_2way((__m128i*) (dst), (__m128i*) (src1), (__m128i*) (src2))

Definition at line 504 of file bmsse2.h.

◆ VECT_OR_BLOCK_3WAY

#define VECT_OR_BLOCK_3WAY (   dst,
  src1,
  src2 
)    sse2_or_block_3way((__m128i*) (dst), (__m128i*) (src1), (__m128i*) (src2))

Definition at line 507 of file bmsse2.h.

◆ VECT_OR_BLOCK_5WAY

#define VECT_OR_BLOCK_5WAY (   dst,
  src1,
  src2,
  src3,
  src4 
)    sse2_or_block_5way((__m128i*) (dst), (__m128i*) (src1), (__m128i*) (src2), (__m128i*) (src3), (__m128i*) (src4))

Definition at line 510 of file bmsse2.h.

◆ VECT_SET_BLOCK

#define VECT_SET_BLOCK (   dst,
  value 
)    sse2_set_block((__m128i*) dst, value)

Definition at line 528 of file bmsse2.h.

◆ VECT_STREAM_BLOCK

#define VECT_STREAM_BLOCK (   dst,
  src 
)    sse2_stream_block((__m128i*) dst, (__m128i*) (src))

Definition at line 525 of file bmsse2.h.

◆ VECT_SUB_BLOCK

#define VECT_SUB_BLOCK (   dst,
  src 
)    sse2_sub_block((__m128i*) dst, (__m128i*) (src))

Definition at line 513 of file bmsse2.h.

◆ VECT_XOR_ARR_2_MASK

#define VECT_XOR_ARR_2_MASK (   dst,
  src,
  src_end,
  mask 
)    sse2_xor_arr_2_mask((__m128i*)(dst), (__m128i*)(src), (__m128i*)(src_end), (bm::word_t)mask)

Definition at line 474 of file bmsse2.h.

◆ VECT_XOR_BLOCK

#define VECT_XOR_BLOCK (   dst,
  src 
)    sse2_xor_block((__m128i*) dst, (__m128i*) (src))

Definition at line 516 of file bmsse2.h.

◆ VECT_XOR_BLOCK_2WAY

#define VECT_XOR_BLOCK_2WAY (   dst,
  src1,
  src2 
)    sse2_xor_block_2way((__m128i*) (dst), (const __m128i*) (src1), (const __m128i*) (src2))

Definition at line 519 of file bmsse2.h.