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
78b320f2
Commit
78b320f2
authored
Aug 19, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move CPU capabilities debug to src/misc/cpu.c
parent
1081b213
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
39 deletions
+41
-39
src/libvlc.c
src/libvlc.c
+1
-39
src/libvlc.h
src/libvlc.h
+2
-0
src/misc/cpu.c
src/misc/cpu.c
+38
-0
No files found.
src/libvlc.c
View file @
78b320f2
...
...
@@ -666,45 +666,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
if
(
priv
->
b_color
)
priv
->
b_color
=
var_InheritBool
(
p_libvlc
,
"color"
);
char
p_capabilities
[
200
];
#define PRINT_CAPABILITY( capability, string ) \
if( vlc_CPU() & capability ) \
{ \
strncat( p_capabilities, string " ", \
sizeof(p_capabilities) - strlen(p_capabilities) ); \
p_capabilities[sizeof(p_capabilities) - 1] = '\0'; \
}
p_capabilities
[
0
]
=
'\0'
;
#if defined( __i386__ ) || defined( __x86_64__ )
PRINT_CAPABILITY
(
CPU_CAPABILITY_MMX
,
"MMX"
);
PRINT_CAPABILITY
(
CPU_CAPABILITY_3DNOW
,
"3DNow!"
);
PRINT_CAPABILITY
(
CPU_CAPABILITY_MMXEXT
,
"MMXEXT"
);
PRINT_CAPABILITY
(
CPU_CAPABILITY_SSE
,
"SSE"
);
PRINT_CAPABILITY
(
CPU_CAPABILITY_SSE2
,
"SSE2"
);
PRINT_CAPABILITY
(
CPU_CAPABILITY_SSE3
,
"SSE3"
);
PRINT_CAPABILITY
(
CPU_CAPABILITY_SSSE3
,
"SSSE3"
);
PRINT_CAPABILITY
(
CPU_CAPABILITY_SSE4_1
,
"SSE4.1"
);
PRINT_CAPABILITY
(
CPU_CAPABILITY_SSE4_2
,
"SSE4.2"
);
PRINT_CAPABILITY
(
CPU_CAPABILITY_SSE4A
,
"SSE4A"
);
#elif defined( __powerpc__ ) || defined( __ppc__ ) || defined( __ppc64__ )
PRINT_CAPABILITY
(
CPU_CAPABILITY_ALTIVEC
,
"AltiVec"
);
#elif defined( __arm__ )
PRINT_CAPABILITY
(
CPU_CAPABILITY_NEON
,
"NEONv1"
);
#endif
#if HAVE_FPU
strncat
(
p_capabilities
,
"FPU "
,
sizeof
(
p_capabilities
)
-
strlen
(
p_capabilities
)
);
p_capabilities
[
sizeof
(
p_capabilities
)
-
1
]
=
'\0'
;
#endif
if
(
p_capabilities
[
0
])
msg_Dbg
(
p_libvlc
,
"CPU has capabilities %s"
,
p_capabilities
);
vlc_CPU_dump
(
VLC_OBJECT
(
p_libvlc
)
);
/*
* Choose the best memcpy module
*/
...
...
src/libvlc.h
View file @
78b320f2
...
...
@@ -41,6 +41,8 @@ void system_Init ( void );
void
system_Configure
(
libvlc_int_t
*
,
int
,
const
char
*
const
[]
);
void
system_End
(
void
);
void
vlc_CPU_dump
(
vlc_object_t
*
);
/*
* Threads subsystem
*/
...
...
src/misc/cpu.c
View file @
78b320f2
...
...
@@ -336,6 +336,44 @@ unsigned vlc_CPU (void)
return
cpu_flags
;
}
void
vlc_CPU_dump
(
vlc_object_t
*
obj
)
{
const
unsigned
flags
=
vlc_CPU
();
char
buf
[
200
],
*
p
=
buf
;
#define PRINT_CAPABILITY( capability, string ) \
if (flags & (capability)) \
p += sprintf (p, "%s ", (string) )
#if defined (__i386__) || defined (__x86_64__)
PRINT_CAPABILITY
(
CPU_CAPABILITY_MMX
,
"MMX"
);
PRINT_CAPABILITY
(
CPU_CAPABILITY_3DNOW
,
"3DNow!"
);
PRINT_CAPABILITY
(
CPU_CAPABILITY_MMXEXT
,
"MMXEXT"
);
PRINT_CAPABILITY
(
CPU_CAPABILITY_SSE
,
"SSE"
);
PRINT_CAPABILITY
(
CPU_CAPABILITY_SSE2
,
"SSE2"
);
PRINT_CAPABILITY
(
CPU_CAPABILITY_SSE3
,
"SSE3"
);
PRINT_CAPABILITY
(
CPU_CAPABILITY_SSSE3
,
"SSSE3"
);
PRINT_CAPABILITY
(
CPU_CAPABILITY_SSE4_1
,
"SSE4.1"
);
PRINT_CAPABILITY
(
CPU_CAPABILITY_SSE4_2
,
"SSE4.2"
);
PRINT_CAPABILITY
(
CPU_CAPABILITY_SSE4A
,
"SSE4A"
);
#elif defined (__powerpc__) || defined (__ppc__) || defined (__ppc64__)
PRINT_CAPABILITY
(
CPU_CAPABILITY_ALTIVEC
,
"AltiVec"
);
#elif defined (__arm__)
PRINT_CAPABILITY
(
CPU_CAPABILITY_NEON
,
"NEONv1"
);
#endif
#if HAVE_FPU
p
+=
sprintf
(
p
,
"FPU "
);
#endif
if
(
p
>
buf
)
msg_Dbg
(
obj
,
"CPU has capabilities %s"
,
buf
);
}
static
vlc_memcpy_t
pf_vlc_memcpy
=
memcpy
;
void
vlc_fastmem_register
(
vlc_memcpy_t
cpy
)
...
...
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