Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
59bcebbf
Commit
59bcebbf
authored
Oct 18, 2016
by
Milo Yip
Committed by
GitHub
Oct 18, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #773 from bluehero/master
use _mm_cmpistri
parents
97fb9bc8
31ace3b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
20 deletions
+6
-20
reader.h
include/rapidjson/reader.h
+6
-20
No files found.
include/rapidjson/reader.h
View file @
59bcebbf
...
...
@@ -299,16 +299,9 @@ inline const char *SkipWhitespace_SIMD(const char* p) {
for
(;;
p
+=
16
)
{
const
__m128i
s
=
_mm_load_si128
(
reinterpret_cast
<
const
__m128i
*>
(
p
));
const
int
r
=
_mm_cvtsi128_si32
(
_mm_cmpistrm
(
w
,
s
,
_SIDD_UBYTE_OPS
|
_SIDD_CMP_EQUAL_ANY
|
_SIDD_BIT_MASK
|
_SIDD_NEGATIVE_POLARITY
));
if
(
r
!=
0
)
{
// some of characters is non-whitespace
#ifdef _MSC_VER // Find the index of first non-whitespace
unsigned
long
offset
;
_BitScanForward
(
&
offset
,
r
);
return
p
+
offset
;
#else
return
p
+
__builtin_ffs
(
r
)
-
1
;
#endif
}
const
int
r
=
_mm_cmpistri
(
w
,
s
,
_SIDD_UBYTE_OPS
|
_SIDD_CMP_EQUAL_ANY
|
_SIDD_LEAST_SIGNIFICANT
|
_SIDD_NEGATIVE_POLARITY
);
if
(
r
!=
16
)
// some of characters is non-whitespace
return
p
+
r
;
}
}
...
...
@@ -325,16 +318,9 @@ inline const char *SkipWhitespace_SIMD(const char* p, const char* end) {
for
(;
p
<=
end
-
16
;
p
+=
16
)
{
const
__m128i
s
=
_mm_loadu_si128
(
reinterpret_cast
<
const
__m128i
*>
(
p
));
const
int
r
=
_mm_cvtsi128_si32
(
_mm_cmpistrm
(
w
,
s
,
_SIDD_UBYTE_OPS
|
_SIDD_CMP_EQUAL_ANY
|
_SIDD_BIT_MASK
|
_SIDD_NEGATIVE_POLARITY
));
if
(
r
!=
0
)
{
// some of characters is non-whitespace
#ifdef _MSC_VER // Find the index of first non-whitespace
unsigned
long
offset
;
_BitScanForward
(
&
offset
,
r
);
return
p
+
offset
;
#else
return
p
+
__builtin_ffs
(
r
)
-
1
;
#endif
}
const
int
r
=
_mm_cmpistri
(
w
,
s
,
_SIDD_UBYTE_OPS
|
_SIDD_CMP_EQUAL_ANY
|
_SIDD_LEAST_SIGNIFICANT
|
_SIDD_NEGATIVE_POLARITY
);
if
(
r
!=
16
)
// some of characters is non-whitespace
return
p
+
r
;
}
return
SkipWhitespace
(
p
,
end
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment