Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
ffmpeg
Commits
216cc1f6
Commit
216cc1f6
authored
Oct 16, 2015
by
Matt Oliver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavu/intmath.h: Add msvc/icl ctzll optimisations.
Signed-off-by:
Matt Oliver
<
protogonoi@gmail.com
>
parent
ce0a117e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
intmath.h
libavutil/x86/intmath.h
+35
-0
No files found.
libavutil/x86/intmath.h
View file @
216cc1f6
...
@@ -24,6 +24,41 @@
...
@@ -24,6 +24,41 @@
#include <stdint.h>
#include <stdint.h>
#include "config.h"
#include "config.h"
#if HAVE_FAST_CLZ
#if defined(__INTEL_COMPILER)
# define ff_ctzll ff_ctzll_x86
static
av_always_inline
av_const
int
ff_ctzll_x86
(
long
long
v
)
{
# if ARCH_X86_64
uint64_t
c
;
__asm__
(
"bsfq %1,%0"
:
"=r"
(
c
)
:
"r"
(
v
));
return
c
;
# else
return
((
uint32_t
)
v
==
0
)
?
_bit_scan_forward
((
uint32_t
)(
v
>>
32
))
+
32
:
_bit_scan_forward
((
uint32_t
)
v
);
# endif
}
#elif defined(_MSC_VER)
# define ff_ctzll ff_ctzll_x86
static
av_always_inline
av_const
int
ff_ctzll_x86
(
long
long
v
)
{
unsigned
long
c
;
# if ARCH_X86_64
_BitScanForward64
(
&
c
,
v
);
# else
if
((
uint32_t
)
v
==
0
)
{
_BitScanForward
(
&
c
,
(
uint32_t
)(
v
>>
32
));
c
+=
32
;
}
else
{
_BitScanForward
(
&
c
,
(
uint32_t
)
v
);
}
# endif
return
c
;
}
#endif
/* __INTEL_COMPILER */
#endif
/* HAVE_FAST_CLZ */
#if defined(__GNUC__)
#if defined(__GNUC__)
/* Our generic version of av_popcount is faster than GCC's built-in on
/* Our generic version of av_popcount is faster than GCC's built-in on
...
...
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