Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
X
x264
Manage
Activity
Members
Labels
Plan
Issues
26
Issue boards
Milestones
Wiki
Code
Merge requests
16
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
x264
Commits
b1d2de88
Commit
b1d2de88
authored
4 months ago
by
Brad Smith
Committed by
Anton Mitrofanov
4 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Use getauxval() on Linux and elf_aux_info() on FreeBSD/OpenBSD on arm/ppc
parent
3a21e97b
No related branches found
Branches containing commit
No related tags found
1 merge request
!159
Use getauxval() on Linux and elf_aux_info() on FreeBSD/OpenBSD on arm/ppc
Pipeline
#527260
passed with stages
Stage:
Stage:
Stage:
in 3 minutes and 49 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/cpu.c
+27
-2
27 additions, 2 deletions
common/cpu.c
with
27 additions
and
2 deletions
common/cpu.c
+
27
−
2
View file @
b1d2de88
...
...
@@ -123,7 +123,7 @@ static unsigned long x264_getauxval( unsigned long type )
#endif
}
#if (HAVE_ALTIVEC && SYS_LINUX) || (HAVE_ARMV6 && !HAVE_NEON)
#if
(
(HAVE_ALTIVEC && SYS_LINUX) || (HAVE_ARMV6 && !HAVE_NEON)
) && !(HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO)
#include
<signal.h>
#include
<setjmp.h>
static
sigjmp_buf
jmpbuf
;
...
...
@@ -326,7 +326,23 @@ uint32_t x264_cpu_detect( void )
#elif HAVE_ALTIVEC
#if SYS_MACOSX || SYS_OPENBSD || SYS_FREEBSD || SYS_NETBSD
#if HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
#define HWCAP_PPC_ALTIVEC (1U << 28)
uint32_t
x264_cpu_detect
(
void
)
{
uint32_t
flags
=
0
;
unsigned
long
hwcap
=
x264_getauxval
(
AT_HWCAP
);
if
(
hwcap
&
HWCAP_PPC_ALTIVEC
)
flags
|=
X264_CPU_ALTIVEC
;
return
flags
;
}
#elif SYS_MACOSX || SYS_OPENBSD || SYS_FREEBSD || SYS_NETBSD
uint32_t
x264_cpu_detect
(
void
)
{
...
...
@@ -396,11 +412,19 @@ uint32_t x264_cpu_detect( void )
void
x264_cpu_neon_test
(
void
);
int
x264_cpu_fast_neon_mrc_test
(
void
);
#define HWCAP_ARM_NEON (1U << 12)
uint32_t
x264_cpu_detect
(
void
)
{
uint32_t
flags
=
0
;
flags
|=
X264_CPU_ARMV6
;
#if HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
unsigned
long
hwcap
=
x264_getauxval
(
AT_HWCAP
);
if
(
hwcap
&
HWCAP_ARM_NEON
)
flags
|=
X264_CPU_NEON
;
#else
// don't do this hack if compiled with -mfpu=neon
#if !HAVE_NEON
static
void
(
*
oldsig
)(
int
);
...
...
@@ -418,6 +442,7 @@ uint32_t x264_cpu_detect( void )
#endif
flags
|=
X264_CPU_NEON
;
#endif
// fast neon -> arm (Cortex-A9) detection relies on user access to the
// cycle counter; this assumes ARMv7 performance counters.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment