-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStr_AVX.cpp
More file actions
56 lines (51 loc) · 1.03 KB
/
Str_AVX.cpp
File metadata and controls
56 lines (51 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//---------------------------------------------------------------
// Name: Ren's String Library
//
// A standalone string class not relying on STL.
// Speed may be sacrificed for code size and readibility, but I've
// also included some assembly optimizations which may speed things up.
//
// Using id's string library as inspiration
//
// This file contains AVX assembly methods.
// Note: I don't have a sandy bridge CPU, so these are untested
//---------------------------------------------------------------
#include "Str.h"
#ifdef _AVX_
void rStr::toLower_avx(void)
{
}
void rStr::toUpper_avx(void)
{
}
bool rStr::hasLower_avx(void)
{
}
bool rStr::hasUpper_avx(void)
{
}
void rStr::fill_avx(const char c)
{
}
void rStr::r_memset_avx(char* text, char c, int length)
{
}
//Derived from r_strlen_sse42
int rStr::r_strlen_avx(const char* src)
{
int i;
__asm
{
mov esi, src
mov eax, -32
pxor ymm0, ymm0
STRLEN_LOOP:
add eax, 32
PcmpIstrI ymm0, 32[esi + eax], 1000b
jnz STRLEN_LOOP
add eax, 32
mov i, eax
}
return i;
}
#endif