20#pragma warning(disable:__WARNING_POTENTIAL_BUFFER_OVERFLOW_NULLTERMINATED)
21#pragma warning(disable:__WARNING_RETURNING_BAD_RESULT)
29 #define ROUTINE _STRCSPN
30#elif defined (SSTRPBRK)
31 #define ROUTINE _STRPBRK
33 #define ROUTINE _STRSPN
34 #define STRSPN_USE_SSE2
103#if ROUTINE == _STRSPN
104#if defined(STRSPN_USE_SSE2)
106static size_t __cdecl fallbackMethod(
113static size_t __cdecl fallbackMethod(
120static char *
__cdecl fallbackMethod(
129 const unsigned char *
str = (
unsigned char const*)
string;
130 const unsigned char *
ctrl = (
unsigned char const*)
control;
132 unsigned char map[32];
146#if ROUTINE == _STRSPN
152 while (
map[*
str >> 3] & (1 << (*
str & 7)))
161#elif ROUTINE == _STRCSPN
166 while (!(
map[*
str >> 3] & (1 << (*
str & 7))))
188#if defined(STRSPN_USE_SSE2)
191#pragma intrinsic(_BitScanForward)
192#pragma optimize("t", on)
195#if ROUTINE == _STRSPN
203const char *
string,
const char *
control)
213 __m128i
temp, tempMask, smearedChar;
214 unsigned int mask, terminatorSeen = 0;
215 unsigned long bitCount;
280 terminatorSeen = (
shift == 0) ? 1 : (bitCount < (16 -
shift));
282 switch (16 - bitCount)
354 if (*(alignedControl + 1) == 0)
362 return fallbackMethod(
string,
control);
372 alignedControl += 16;
380 return fallbackMethod(
string,
control);
385 if ((16 -
shift + bitCount) > 16)
387 return fallbackMethod(
string,
control);
391 switch (16 - bitCount)
449#if (ROUTINE == _STRSPN) || (ROUTINE == _STRCSPN)
454 int smear = (
int) *
string;
467#if (ROUTINE == _STRSPN)
476#elif (ROUTINE == _STRCSPN)
496#if (ROUTINE == _STRSPN) || (ROUTINE == _STRCSPN)
char * strpbrk(const char *String, const char *Delimiters)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
__m128i _mm_slli_si128(__m128i a, int i)
__m128i _mm_xor_si128(__m128i a, __m128i b)
__m128i _mm_cmpeq_epi8(__m128i a, __m128i b)
__m128i _mm_cvtsi32_si128(int a)
__m128i _mm_or_si128(__m128i a, __m128i b)
int _mm_movemask_epi8(__m128i a)
__m128i _mm_srli_si128(__m128i a, int imm)
__m128i _mm_unpacklo_epi8(__m128i a, __m128i b)
#define _mm_shuffle_epi32(a, imm)
__m128i _mm_loadu_si128(__m128i_u const *p)
void __declspec(noinline) __cdecl _free_base(void *const block)
GLuint GLuint GLsizei count
unsigned char _BitScanForward(unsigned long *_Index, unsigned long _Mask)
static short search(int val, const short *table, int size)
_Check_return_ _CRTIMP size_t __cdecl strcspn(_In_z_ const char *_Str, _In_z_ const char *_Control)
size_t __cdecl strspn(const char *string, const char *control)