Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
dav1d
Commits
41fb5ec5
Verified
Commit
41fb5ec5
authored
Oct 01, 2018
by
James Almer
Browse files
attributes: fix clzll on 32-bit MSVC
parent
6153633d
Pipeline
#830
passed with stage
in 1 minute and 54 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
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
Supports
Markdown
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