Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
3b345d38
Commit
3b345d38
authored
Sep 28, 2017
by
James Almer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil/cpu: split flag checks per arch in av_cpu_max_align()
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
522f8770
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
72 additions
and
31 deletions
+72
-31
cpu.c
libavutil/aarch64/cpu.c
+10
-0
cpu.c
libavutil/arm/cpu.c
+10
-0
cpu.c
libavutil/cpu.c
+8
-31
cpu_internal.h
libavutil/cpu_internal.h
+5
-0
cpu.c
libavutil/ppc/cpu.c
+12
-0
cpu.c
libavutil/x86/cpu.c
+27
-0
No files found.
libavutil/aarch64/cpu.c
View file @
3b345d38
...
...
@@ -26,3 +26,13 @@ int ff_get_cpu_flags_aarch64(void)
AV_CPU_FLAG_NEON
*
HAVE_NEON
|
AV_CPU_FLAG_VFP
*
HAVE_VFP
;
}
size_t
ff_get_cpu_max_align_aarch64
(
void
)
{
int
flags
=
av_get_cpu_flags
();
if
(
flags
&
AV_CPU_FLAG_NEON
)
return
16
;
return
8
;
}
libavutil/arm/cpu.c
View file @
3b345d38
...
...
@@ -158,3 +158,13 @@ int ff_get_cpu_flags_arm(void)
}
#endif
size_t
ff_get_cpu_max_align_arm
(
void
)
{
int
flags
=
av_get_cpu_flags
();
if
(
flags
&
AV_CPU_FLAG_NEON
)
return
16
;
return
8
;
}
libavutil/cpu.c
View file @
3b345d38
...
...
@@ -304,37 +304,14 @@ int av_cpu_count(void)
size_t
av_cpu_max_align
(
void
)
{
int
av_unused
flags
=
av_get_cpu_flags
();
#if ARCH_ARM || ARCH_AARCH64
if
(
flags
&
AV_CPU_FLAG_NEON
)
return
16
;
#elif ARCH_PPC
if
(
flags
&
(
AV_CPU_FLAG_ALTIVEC
|
AV_CPU_FLAG_VSX
|
AV_CPU_FLAG_POWER8
))
return
16
;
#elif ARCH_X86
if
(
flags
&
(
AV_CPU_FLAG_AVX2
|
AV_CPU_FLAG_AVX
|
AV_CPU_FLAG_XOP
|
AV_CPU_FLAG_FMA4
|
AV_CPU_FLAG_FMA3
|
AV_CPU_FLAG_AVXSLOW
))
return
32
;
if
(
flags
&
(
AV_CPU_FLAG_AESNI
|
AV_CPU_FLAG_SSE42
|
AV_CPU_FLAG_SSE4
|
AV_CPU_FLAG_SSSE3
|
AV_CPU_FLAG_SSE3
|
AV_CPU_FLAG_SSE2
|
AV_CPU_FLAG_SSE
|
AV_CPU_FLAG_ATOM
|
AV_CPU_FLAG_SSSE3SLOW
|
AV_CPU_FLAG_SSE3SLOW
|
AV_CPU_FLAG_SSE2SLOW
))
return
16
;
#endif
if
(
ARCH_AARCH64
)
return
ff_get_cpu_max_align_aarch64
();
if
(
ARCH_ARM
)
return
ff_get_cpu_max_align_arm
();
if
(
ARCH_PPC
)
return
ff_get_cpu_max_align_ppc
();
if
(
ARCH_X86
)
return
ff_get_cpu_max_align_x86
();
return
8
;
}
libavutil/cpu_internal.h
View file @
3b345d38
...
...
@@ -44,4 +44,9 @@ int ff_get_cpu_flags_arm(void);
int
ff_get_cpu_flags_ppc
(
void
);
int
ff_get_cpu_flags_x86
(
void
);
size_t
ff_get_cpu_max_align_aarch64
(
void
);
size_t
ff_get_cpu_max_align_arm
(
void
);
size_t
ff_get_cpu_max_align_ppc
(
void
);
size_t
ff_get_cpu_max_align_x86
(
void
);
#endif
/* AVUTIL_CPU_INTERNAL_H */
libavutil/ppc/cpu.c
View file @
3b345d38
...
...
@@ -148,3 +148,15 @@ out:
#endif
/* HAVE_ALTIVEC */
return
0
;
}
size_t
ff_get_cpu_max_align_ppc
(
void
)
{
int
flags
=
av_get_cpu_flags
();
if
(
flags
&
(
AV_CPU_FLAG_ALTIVEC
|
AV_CPU_FLAG_VSX
|
AV_CPU_FLAG_POWER8
))
return
16
;
return
8
;
}
libavutil/x86/cpu.c
View file @
3b345d38
...
...
@@ -233,3 +233,30 @@ int ff_get_cpu_flags_x86(void)
return
rval
;
}
size_t
ff_get_cpu_max_align_x86
(
void
)
{
int
flags
=
av_get_cpu_flags
();
if
(
flags
&
(
AV_CPU_FLAG_AVX2
|
AV_CPU_FLAG_AVX
|
AV_CPU_FLAG_XOP
|
AV_CPU_FLAG_FMA4
|
AV_CPU_FLAG_FMA3
|
AV_CPU_FLAG_AVXSLOW
))
return
32
;
if
(
flags
&
(
AV_CPU_FLAG_AESNI
|
AV_CPU_FLAG_SSE42
|
AV_CPU_FLAG_SSE4
|
AV_CPU_FLAG_SSSE3
|
AV_CPU_FLAG_SSE3
|
AV_CPU_FLAG_SSE2
|
AV_CPU_FLAG_SSE
|
AV_CPU_FLAG_ATOM
|
AV_CPU_FLAG_SSSE3SLOW
|
AV_CPU_FLAG_SSE3SLOW
|
AV_CPU_FLAG_SSE2SLOW
))
return
16
;
return
8
;
}
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