Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flac
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
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
Stefan Strogin
flac
Commits
2f7293b0
Commit
2f7293b0
authored
Feb 12, 2005
by
Josh Coalson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add patch: on freebsd, detect via sysctl whether OS supports SSE
parent
302ed8c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
15 deletions
+29
-15
src/libFLAC/cpu.c
src/libFLAC/cpu.c
+29
-15
No files found.
src/libFLAC/cpu.c
View file @
2f7293b0
...
...
@@ -38,19 +38,25 @@
#endif
#if defined FLAC__CPU_PPC
#if !defined FLAC__NO_ASM
#if defined FLAC__SYS_DARWIN
#include <sys/sysctl.h>
#include <mach/mach.h>
#include <mach/mach_host.h>
#include <mach/host_info.h>
#include <mach/machine.h>
#ifndef CPU_SUBTYPE_POWERPC_970
#define CPU_SUBTYPE_POWERPC_970 ((cpu_subtype_t) 100)
#endif
#else
/* FLAC__SYS_DARWIN */
#include <signal.h>
#include <setjmp.h>
# if !defined FLAC__NO_ASM
# if defined FLAC__SYS_DARWIN
# include <sys/sysctl.h>
# include <mach/mach.h>
# include <mach/mach_host.h>
# include <mach/host_info.h>
# include <mach/machine.h>
# ifndef CPU_SUBTYPE_POWERPC_970
# define CPU_SUBTYPE_POWERPC_970 ((cpu_subtype_t) 100)
# endif
# else
/* FLAC__SYS_DARWIN */
# ifdef __FreeBSD__
# include <sys/types.h>
# include <sys/sysctl.h>
# endif
# include <signal.h>
# include <setjmp.h>
static
sigjmp_buf
jmpbuf
;
static
volatile
sig_atomic_t
canjump
=
0
;
...
...
@@ -64,8 +70,8 @@ static void sigill_handler (int sig)
canjump
=
0
;
siglongjmp
(
jmpbuf
,
1
);
}
#endif
/* FLAC__SYS_DARWIN */
#endif
/* FLAC__NO_ASM */
#
endif
/* FLAC__SYS_DARWIN */
#
endif
/* FLAC__NO_ASM */
#endif
/* FLAC__CPU_PPC */
const
unsigned
FLAC__CPUINFO_IA32_CPUID_CMOV
=
0x00008000
;
...
...
@@ -95,6 +101,14 @@ void FLAC__cpu_info(FLAC__CPUInfo *info)
#ifndef FLAC__SSE_OS
info
->
data
.
ia32
.
fxsr
=
info
->
data
.
ia32
.
sse
=
info
->
data
.
ia32
.
sse2
=
false
;
#elif defined(__FreeBSD__)
/* on FreeBSD we can double-check via sysctl whether the OS supports SSE */
{
int
sse
;
size_t
len
=
sizeof
(
sse
);
if
(
sysctlbyname
(
"hw.instruction_sse"
,
&
sse
,
&
len
,
NULL
,
0
)
||
!
sse
)
info
->
data
.
ia32
.
fxsr
=
info
->
data
.
ia32
.
sse
=
info
->
data
.
ia32
.
sse2
=
false
;
}
#endif
#ifdef FLAC__USE_3DNOW
...
...
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