Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
450
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
e75a33e4
Commit
e75a33e4
authored
3 years ago
by
Rémi Denis-Courmont
Browse files
Options
Downloads
Patches
Plain Diff
linux: use getauxval() for POWER CPU detection
parent
4aea7124
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1439
linux: use auxv for CPU detection
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/linux/cpu.c
+12
-7
12 additions, 7 deletions
src/linux/cpu.c
with
12 additions
and
7 deletions
src/linux/cpu.c
+
12
−
7
View file @
e75a33e4
...
...
@@ -70,14 +70,23 @@ unsigned vlc_CPU_raw(void)
return
flags
;
}
#elif defined (__powerpc__)
/* both 32- and 64-bit */
unsigned
vlc_CPU_raw
(
void
)
{
const
unsigned
long
hwcap
=
getauxval
(
AT_HWCAP
);
unsigned
int
flags
=
0
;
if
(
hwcap
&
PPC_FEATURE_HAS_ALTIVEC
)
flags
|=
VLC_CPU_ALTIVEC
;
return
flags
;
}
#else
#undef CPU_FLAGS
#if defined (__i386__) || defined (__x86_64__)
# define CPU_FLAGS "flags"
#elif defined (__powerpc__) || defined (__powerpc64__)
# define CPU_FLAGS "cpu"
#elif defined (__riscv)
# include <vlc_strings.h>
# define CPU_FLAGS "isa"
...
...
@@ -197,10 +206,6 @@ unsigned vlc_CPU_raw(void)
core_caps
|=
VLC_CPU_XOP
;
if
(
!
strcmp
(
cap
,
"fma4"
))
core_caps
|=
VLC_CPU_FMA4
;
#elif defined (__powerpc__) || defined (__powerpc64__)
if
(
!
strcmp
(
cap
,
"altivec supported"
))
core_caps
|=
VLC_CPU_ALTIVEC
;
#endif
}
#endif
...
...
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