Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
sse-util.h File Reference
#include <emmintrin.h>
Include dependency graph for sse-util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 impala
 This file contains type definitions that are used throughout the code base.
 
 impala::SSEUtil
 This class contains constants useful for text processing with SSE4.2 intrinsics.
 

Macros

#define SSE_ALWAYS_INLINE   inline __attribute__ ((__always_inline__))
 

Functions

static SSE_ALWAYS_INLINE __m128i impala::SSE4_cmpestrm (__m128i str1, int len1, __m128i str2, int len2, const int mode)
 
static SSE_ALWAYS_INLINE int impala::SSE4_cmpestri (__m128i str1, int len1, __m128i str2, int len2, const int mode)
 
static uint32_t impala::SSE4_crc32_u8 (uint32_t crc, uint8_t v)
 
static uint32_t impala::SSE4_crc32_u32 (uint32_t crc, uint32_t v)
 
static int64_t impala::POPCNT_popcnt_u64 (uint64_t a)
 

Variables

static const int impala::SSEUtil::CHARS_PER_64_BIT_REGISTER = 8
 
static const int impala::SSEUtil::CHARS_PER_128_BIT_REGISTER = 16
 
static const int impala::SSEUtil::PCMPSTR_EQUAL_ANY = 0x00
 
static const int impala::SSEUtil::PCMPSTR_EQUAL_EACH = 0x08
 
static const int impala::SSEUtil::PCMPSTR_UBYTE_OPS = 0x00
 
static const int impala::SSEUtil::PCMPSTR_NEG_POLARITY = 0x10
 
static const int impala::SSEUtil::STRCHR_MODE = PCMPSTR_EQUAL_ANY | PCMPSTR_UBYTE_OPS
 
static const int impala::SSEUtil::STRCMP_MODE
 
static const int impala::SSEUtil::SSE_BITMASK [CHARS_PER_128_BIT_REGISTER]
 Precomputed mask values up to 16 bits. More...
 

Macro Definition Documentation

#define SSE_ALWAYS_INLINE   inline __attribute__ ((__always_inline__))

Define the SSE 4.2 intrinsics. The caller must first verify at runtime (or codegen IR load time) that the processor supports SSE 4.2 before calling these. These are defined outside the namespace because the IR w/ SSE 4.2 case needs to use macros. When compiling to native code (i.e. not IR), we cannot use the -msse4.2 compiler flag. Otherwise, the compiler will emit SSE 4.2 instructions outside of the runtime SSE 4.2 checks and Impala will crash on CPUs that don't support SSE 4.2 (IMPALA-1399/1646). The compiler intrinsics cannot be used without -msse4.2, so we define our own implementations of the intrinsics instead. The PCMPxSTRy instructions require that the control byte 'mode' be encoded as an immediate. So, those need to be always inlined in order to always propagate the mode constant into the inline asm.

Definition at line 87 of file sse-util.h.