Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dav1d
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Konstantin Pavlov
dav1d
Commits
41fb5ec5
Verified
Commit
41fb5ec5
authored
Oct 01, 2018
by
James Almer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
attributes: fix clzll on 32-bit MSVC
parent
6153633d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
include/common/attributes.h
include/common/attributes.h
+9
-0
No files found.
include/common/attributes.h
View file @
41fb5ec5
...
...
@@ -87,11 +87,20 @@ static inline int clz(const unsigned int mask) {
return
(
31
-
leading_zero
);
}
#ifndef _M_IX86
static
inline
int
clzll
(
const
unsigned
long
long
mask
)
{
unsigned
long
leading_zero
=
0
;
_BitScanReverse64
(
&
leading_zero
,
mask
);
return
(
63
-
leading_zero
);
}
#else
/* _M_IX86 */
static
inline
int
clzll
(
const
unsigned
long
long
mask
)
{
if
(
mask
>>
32
)
return
clz
((
unsigned
)(
mask
>>
32
));
else
return
clz
((
unsigned
)
mask
)
+
32
;
}
#endif
/* _M_IX86 */
#else
/* !_MSC_VER */
static
inline
int
ctz
(
const
unsigned
int
mask
)
{
return
__builtin_ctz
(
mask
);
...
...
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