Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
3bc25406
Commit
3bc25406
authored
Aug 04, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define CPU capabilities for AVX, AVX2, XOP and FMA4
parent
0fbbb451
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
8 deletions
+40
-8
include/vlc_cpu.h
include/vlc_cpu.h
+28
-0
src/misc/cpu.c
src/misc/cpu.c
+12
-8
No files found.
include/vlc_cpu.h
View file @
3bc25406
...
@@ -40,6 +40,10 @@ VLC_API unsigned vlc_CPU(void);
...
@@ -40,6 +40,10 @@ VLC_API unsigned vlc_CPU(void);
# define VLC_CPU_SSE4_1 1024
# define VLC_CPU_SSE4_1 1024
# define VLC_CPU_SSE4_2 2048
# define VLC_CPU_SSE4_2 2048
# define VLC_CPU_SSE4A 4096
# define VLC_CPU_SSE4A 4096
# define VLC_CPU_AVX 8192
# define VLC_CPU_AVX2 16384
# define VLC_CPU_XOP 32768
# define VLC_CPU_FMA4 65536
# if defined (__MMX__)
# if defined (__MMX__)
# define vlc_CPU_MMX() (1)
# define vlc_CPU_MMX() (1)
...
@@ -103,12 +107,36 @@ VLC_API unsigned vlc_CPU(void);
...
@@ -103,12 +107,36 @@ VLC_API unsigned vlc_CPU(void);
# define vlc_CPU_SSE4A() ((vlc_CPU() & VLC_CPU_SSE4A) != 0)
# define vlc_CPU_SSE4A() ((vlc_CPU() & VLC_CPU_SSE4A) != 0)
# endif
# endif
# ifdef __AVX__
# define vlc_CPU_AVX() (1)
# else
# define vlc_CPU_AVX() ((vlc_CPU() & VLC_CPU_AVX) != 0)
# endif
# ifdef __AVX2__
# define vlc_CPU_AVX2() (1)
# else
# define vlc_CPU_AVX2() ((vlc_CPU() & VLC_CPU_AVX2) != 0)
# endif
# ifdef __3dNOW__
# ifdef __3dNOW__
# define vlc_CPU_3dNOW() (1)
# define vlc_CPU_3dNOW() (1)
# else
# else
# define vlc_CPU_3dNOW() ((vlc_CPU() & VLC_CPU_3dNOW) != 0)
# define vlc_CPU_3dNOW() ((vlc_CPU() & VLC_CPU_3dNOW) != 0)
# endif
# endif
# ifdef __XOP__
# define vlc_CPU_XOP() (1)
# else
# define vlc_CPU_XOP() ((vlc_CPU() & VLC_CPU_XOP) != 0)
# endif
# ifdef __FMA4__
# define vlc_CPU_FMA4() (1)
# else
# define vlc_CPU_FMA4() ((vlc_CPU() & VLC_CPU_FMA4) != 0)
# endif
# elif defined (__ppc__) || defined (__ppc64__) || defined (__powerpc__)
# elif defined (__ppc__) || defined (__ppc64__) || defined (__powerpc__)
# define HAVE_FPU 1
# define HAVE_FPU 1
# define VLC_CPU_ALTIVEC 2
# define VLC_CPU_ALTIVEC 2
...
...
src/misc/cpu.c
View file @
3bc25406
...
@@ -330,14 +330,18 @@ void vlc_CPU_dump (vlc_object_t *obj)
...
@@ -330,14 +330,18 @@ void vlc_CPU_dump (vlc_object_t *obj)
#if defined (__i386__) || defined (__x86_64__)
#if defined (__i386__) || defined (__x86_64__)
if
(
vlc_CPU_MMX
())
p
+=
sprintf
(
p
,
"MMX "
);
if
(
vlc_CPU_MMX
())
p
+=
sprintf
(
p
,
"MMX "
);
if
(
vlc_CPU_MMXEXT
())
p
+=
sprintf
(
p
,
"MMXEXT "
);
if
(
vlc_CPU_MMXEXT
())
p
+=
sprintf
(
p
,
"MMXEXT "
);
if
(
vlc_CPU_SSE
())
p
+=
sprintf
(
p
,
"SSE "
);;
if
(
vlc_CPU_SSE
())
p
+=
sprintf
(
p
,
"SSE "
);
if
(
vlc_CPU_SSE2
())
p
+=
sprintf
(
p
,
"SSE2 "
);;
if
(
vlc_CPU_SSE2
())
p
+=
sprintf
(
p
,
"SSE2 "
);
if
(
vlc_CPU_SSE3
())
p
+=
sprintf
(
p
,
"SSE2 "
);;
if
(
vlc_CPU_SSE3
())
p
+=
sprintf
(
p
,
"SSE2 "
);
if
(
vlc_CPU_SSSE3
())
p
+=
sprintf
(
p
,
"SSSE3 "
);;
if
(
vlc_CPU_SSSE3
())
p
+=
sprintf
(
p
,
"SSSE3 "
);
if
(
vlc_CPU_SSE4_1
())
p
+=
sprintf
(
p
,
"SSE4.1 "
);;
if
(
vlc_CPU_SSE4_1
())
p
+=
sprintf
(
p
,
"SSE4.1 "
);
if
(
vlc_CPU_SSE4_2
())
p
+=
sprintf
(
p
,
"SSE4.2 "
);;
if
(
vlc_CPU_SSE4_2
())
p
+=
sprintf
(
p
,
"SSE4.2 "
);
if
(
vlc_CPU_SSE4A
())
p
+=
sprintf
(
p
,
"SSE4A "
);;
if
(
vlc_CPU_SSE4A
())
p
+=
sprintf
(
p
,
"SSE4A "
);
if
(
vlc_CPU_3dNOW
())
p
+=
sprintf
(
p
,
"3DNow! "
);;
if
(
vlc_CPU_AVX
())
p
+=
sprintf
(
p
,
"AVX "
);
if
(
vlc_CPU_AVX2
())
p
+=
sprintf
(
p
,
"AVX "
);
if
(
vlc_CPU_3dNOW
())
p
+=
sprintf
(
p
,
"3DNow! "
);
if
(
vlc_CPU_XOP
())
p
+=
sprintf
(
p
,
"XOP "
);
if
(
vlc_CPU_FMA4
())
p
+=
sprintf
(
p
,
"FMA4 "
);
#elif defined (__powerpc__) || defined (__ppc__) || defined (__ppc64__)
#elif defined (__powerpc__) || defined (__ppc__) || defined (__ppc64__)
if
(
vlc_CPU_ALTIVEC
())
p
+=
sprintf
(
p
,
"AltiVec"
);
if
(
vlc_CPU_ALTIVEC
())
p
+=
sprintf
(
p
,
"AltiVec"
);
...
...
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