Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Stefan Strogin
flac
Commits
42c5de6e
Commit
42c5de6e
authored
Jun 27, 2016
by
Julian Calaby
Committed by
Erik de Castro Lopo
Jun 28, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libFLAC/cpu.c: Inline *_disable_avx()
Also only print out OS AVX status if AVX is actually enabled.
parent
eae338e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
33 deletions
+14
-33
src/libFLAC/cpu.c
src/libFLAC/cpu.c
+14
-33
No files found.
src/libFLAC/cpu.c
View file @
42c5de6e
...
...
@@ -128,24 +128,6 @@ ia32_disable_sse(FLAC__CPUInfo *info)
info
->
ia32
.
sse41
=
false
;
info
->
ia32
.
sse42
=
false
;
}
static
void
ia32_disable_avx
(
FLAC__CPUInfo
*
info
)
{
info
->
ia32
.
avx
=
false
;
info
->
ia32
.
avx2
=
false
;
info
->
ia32
.
fma
=
false
;
}
#endif
#if defined FLAC__CPU_X86_64
static
void
x86_64_disable_avx
(
FLAC__CPUInfo
*
info
)
{
info
->
x86
.
avx
=
false
;
info
->
x86
.
avx2
=
false
;
info
->
x86
.
fma
=
false
;
}
#endif
#if defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64
...
...
@@ -334,16 +316,15 @@ ia32_cpu_info (FLAC__CPUInfo *info)
/*
* now have to check for OS support of AVX instructions
*/
if
(
FLAC__HAS_X86INTRIN
&&
info
->
ia32
.
avx
&&
ia32_osxsave
)
{
FLAC__uint32
ecr
=
cpu_xgetbv_x86
();
if
((
ecr
&
0x6
)
!=
0x6
)
ia32_disable_avx
(
info
);
dfprintf
(
stderr
,
" AVX OS sup . %c
\n
"
,
info
->
ia32
.
avx
?
'Y'
:
'n'
);
if
(
!
FLAC__HAS_X86INTRIN
||
!
info
->
ia32
.
avx
||
!
ia32_osxsave
||
(
cpu_xgetbv_x86
()
&
0x6
)
!=
0x6
)
{
/* no OS AVX support */
info
->
ia32
.
avx
=
false
;
info
->
ia32
.
avx2
=
false
;
info
->
ia32
.
fma
=
false
;
}
else
/* no OS AVX support */
ia32_disable_avx
(
info
);
if
(
FLAC__HAS_X86INTRIN
&&
FLAC__AVX_SUPPORTED
)
dfprintf
(
stderr
,
" AVX OS sup . %c
\n
"
,
info
->
ia32
.
avx
?
'Y'
:
'n'
);
#else
info
->
use_asm
=
false
;
#endif
...
...
@@ -396,15 +377,15 @@ x86_64_cpu_info (FLAC__CPUInfo *info)
/*
* now have to check for OS support of AVX instructions
*/
if
(
info
->
x86
.
avx
&&
x86_osxsave
)
{
FLAC__uint32
ecr
=
cpu_xgetbv_x86
();
if
((
ecr
&
0x6
)
!=
0x6
)
x86_64_disable_avx
(
info
);
if
(
!
info
->
x86
.
avx
||
!
x86_osxsave
||
(
cpu_xgetbv_x86
()
&
0x6
)
!=
0x6
)
{
/* no OS AVX support */
info
->
x86
.
avx
=
false
;
info
->
x86
.
avx2
=
false
;
info
->
x86
.
fma
=
false
;
}
if
(
FLAC__AVX_SUPPORTED
)
dfprintf
(
stderr
,
" AVX OS sup . %c
\n
"
,
info
->
x86
.
avx
?
'Y'
:
'n'
);
}
else
/* no OS AVX support */
x86_64_disable_avx
(
info
);
#endif
}
...
...
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