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
ceb2efd4
Commit
ceb2efd4
authored
Sep 22, 2009
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SSE3 detection (runtime)
Isn't fork() supposed to be slow on Windows?
parent
8146a7f0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
0 deletions
+29
-0
src/libvlc-module.c
src/libvlc-module.c
+8
-0
src/libvlc.c
src/libvlc.c
+3
-0
src/misc/cpu.c
src/misc/cpu.c
+18
-0
No files found.
src/libvlc-module.c
View file @
ceb2efd4
...
...
@@ -1009,6 +1009,12 @@ static const char *const ppsz_clock_descriptions[] =
"If your processor supports the SSE2 instructions set, VLC can take " \
"advantage of them.")
#define SSE3_TEXT N_("Enable CPU SSE3 support")
#define SSE3_LONGTEXT N_( \
"If your processor supports the SSE3 instructions set, VLC can take " \
"advantage of them.")
#define ALTIVEC_TEXT N_("Enable CPU AltiVec support")
#define ALTIVEC_LONGTEXT N_( \
"If your processor supports the AltiVec instructions set, VLC can take " \
...
...
@@ -1927,6 +1933,8 @@ vlc_module_begin ()
change_need_restart
()
add_bool
(
"sse2"
,
1
,
NULL
,
SSE2_TEXT
,
SSE2_LONGTEXT
,
true
)
change_need_restart
()
add_bool
(
"sse3"
,
1
,
NULL
,
SSE3_TEXT
,
SSE3_LONGTEXT
,
true
)
change_need_restart
()
#endif
#if defined( __powerpc__ ) || defined( __ppc__ ) || defined( __ppc64__ )
add_bool
(
"altivec"
,
1
,
NULL
,
ALTIVEC_TEXT
,
ALTIVEC_LONGTEXT
,
true
)
...
...
src/libvlc.c
View file @
ceb2efd4
...
...
@@ -761,12 +761,15 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
cpu_flags
&=
~
CPU_CAPABILITY_SSE
;
if
(
!
config_GetInt
(
p_libvlc
,
"sse2"
)
)
cpu_flags
&=
~
CPU_CAPABILITY_SSE2
;
if
(
!
config_GetInt
(
p_libvlc
,
"sse3"
)
)
cpu_flags
&=
~
CPU_CAPABILITY_SSE3
;
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"
);
#elif defined( __powerpc__ ) || defined( __ppc__ ) || defined( __ppc64__ )
if
(
!
config_GetInt
(
p_libvlc
,
"altivec"
)
)
...
...
src/misc/cpu.c
View file @
ceb2efd4
...
...
@@ -201,6 +201,24 @@ uint32_t CPUCapabilities( void )
}
# endif
# if defined (__SSE3__)
i_capabilities
|=
CPU_CAPABILITY_SSE3
;
# elif defined (CAN_COMPILE_SSE3)
if
(
i_ecx
&
0x00000001
)
{
/* We test if OS supports the SSE3 instructions */
pid_t
pid
=
fork
();
if
(
pid
==
0
)
{
/* Test a SSE3 instruction */
__asm__
__volatile__
(
"movsldup %%xmm1, %%xmm0
\n
"
:
:
);
exit
(
0
);
}
if
(
check_OS_capability
(
"SSE3"
,
pid
)
)
i_capabilities
|=
CPU_CAPABILITY_SSE3
;
}
# endif
/* test for additional capabilities */
cpuid
(
0x80000000
);
...
...
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