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
a08e90c4
Commit
a08e90c4
authored
Jun 26, 2016
by
Erik de Castro Lopo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libFLAC/cpu.c: Fixes for MSVC
MSVC is strange and perverse.
parent
162a4492
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
src/libFLAC/cpu.c
src/libFLAC/cpu.c
+18
-4
No files found.
src/libFLAC/cpu.c
View file @
a08e90c4
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#endif
#endif
#include "private/cpu.h"
#include "private/cpu.h"
#include "share/compat.h"
#include <stdlib.h>
#include <stdlib.h>
#include <memory.h>
#include <memory.h>
...
@@ -453,6 +454,21 @@ void FLAC__cpu_info (FLAC__CPUInfo *info)
...
@@ -453,6 +454,21 @@ void FLAC__cpu_info (FLAC__CPUInfo *info)
#if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && FLAC__HAS_X86INTRIN
#if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && FLAC__HAS_X86INTRIN
#if defined _MSC_VER || defined __INTEL_COMPILER
static
inline
void
cpu_id_ex
(
int
*
cpuinfo
,
int
result
)
{
// Stupid MSVC doesn't know how to optimise out:
// if (FLAC_AVC_SUPPORTER)
// __cpuidex(cpuinfo, level, 0); /* for AVX2 detection */
#if FLAC__AVX_SUPPORTED
__cpuidex
(
cpuinfo
,
result
,
0
);
/* for AVX2 detection */
#else
__cpuid
(
cpuinfo
,
result
);
/* some old compilers don't support __cpuidex */
#endif
}
#endif
void
FLAC__cpu_info_x86
(
FLAC__uint32
level
,
FLAC__uint32
*
eax
,
FLAC__uint32
*
ebx
,
FLAC__uint32
*
ecx
,
FLAC__uint32
*
edx
)
void
FLAC__cpu_info_x86
(
FLAC__uint32
level
,
FLAC__uint32
*
eax
,
FLAC__uint32
*
ebx
,
FLAC__uint32
*
ecx
,
FLAC__uint32
*
edx
)
{
{
#if defined _MSC_VER || defined __INTEL_COMPILER
#if defined _MSC_VER || defined __INTEL_COMPILER
...
@@ -463,10 +479,8 @@ void FLAC__cpu_info_x86(FLAC__uint32 level, FLAC__uint32 *eax, FLAC__uint32 *ebx
...
@@ -463,10 +479,8 @@ void FLAC__cpu_info_x86(FLAC__uint32 level, FLAC__uint32 *eax, FLAC__uint32 *ebx
*
eax
=
*
ebx
=
*
ecx
=
*
edx
=
0
;
*
eax
=
*
ebx
=
*
ecx
=
*
edx
=
0
;
return
;
return
;
}
}
if
(
FLAC__AVX_SUPPORTED
)
__cpuidex
(
cpuinfo
,
level
,
0
);
/* for AVX2 detection */
cpu_id_ex
(
cpuinfo
,
ext
);
else
__cpuid
(
cpuinfo
,
level
);
/* some old compilers don't support __cpuidex */
*
eax
=
cpuinfo
[
0
];
*
ebx
=
cpuinfo
[
1
];
*
ecx
=
cpuinfo
[
2
];
*
edx
=
cpuinfo
[
3
];
*
eax
=
cpuinfo
[
0
];
*
ebx
=
cpuinfo
[
1
];
*
ecx
=
cpuinfo
[
2
];
*
edx
=
cpuinfo
[
3
];
#elif defined __GNUC__ && defined HAVE_CPUID_H
#elif defined __GNUC__ && defined HAVE_CPUID_H
...
...
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