Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksoid <aleksoid@users.sourceforge.net>2010-04-09 07:29:45 +0400
committerAleksoid <aleksoid@users.sourceforge.net>2010-04-09 07:29:45 +0400
commitdf6b139a6d9027156f614b68687e039e3a5854db (patch)
tree9dec640ca3a1dc232ee070125f4ad2f0e759120b /src/filters/renderer/MpcAudioRenderer/SoundTouch
parenta9b7bf3fb3e1334d8defd05ca4cfae870b4912e5 (diff)
Fix : 1783 rev. compile error;
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1784 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/renderer/MpcAudioRenderer/SoundTouch')
-rw-r--r--src/filters/renderer/MpcAudioRenderer/SoundTouch/source/cpu_detect_x86_win.cpp94
1 files changed, 35 insertions, 59 deletions
diff --git a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/cpu_detect_x86_win.cpp b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/cpu_detect_x86_win.cpp
index 1863a8f4d..c6c542467 100644
--- a/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/cpu_detect_x86_win.cpp
+++ b/src/filters/renderer/MpcAudioRenderer/SoundTouch/source/cpu_detect_x86_win.cpp
@@ -2,8 +2,8 @@
///
/// Win32 version of the x86 CPU detect routine.
///
-/// This file is to be compiled in Windows platform with Microsoft Visual C++
-/// Compiler. Please see 'cpu_detect_x86_gcc.cpp' for the gcc compiler version
+/// This file is to be compiled in Windows platform with Microsoft Visual C++
+/// Compiler. Please see 'cpu_detect_x86_gcc.cpp' for the gcc compiler version
/// for all GNU platforms.
///
/// Author : Copyright (c) Olli Parviainen
@@ -69,85 +69,61 @@ uint detectCPUextensions(void)
{
uint res = 0;
- if(_dwDisabledISA == 0xffffffff) return 0;
+ if (_dwDisabledISA == 0xffffffff) return 0;
- _asm
+ _asm
{
+ ; check if 'cpuid' instructions is available by toggling eflags bit 21
;
- check if 'cpuid' instructions is available by toggling eflags bit 21
- ;
- xor esi, esi ;
- clear esi = result register
-
- pushfd ;
- save eflags to stack
- mov eax, dword ptr [esp] ;
- load eax from stack(with eflags)
- mov ecx, eax ;
- save the original eflags values to ecx
- xor eax, 0x00200000 ;
- toggle bit 21
- mov dword ptr [esp], eax ;
- store toggled eflags to stack
- popfd ;
- load eflags from stack
-
- pushfd ;
- save updated eflags to stack
- mov eax, dword ptr [esp] ;
- load eax from stack
- popfd ;
- pop stack to restore stack pointer
-
- xor edx, edx ;
- clear edx for defaulting no mmx
- cmp eax, ecx ;
- compare to original eflags values
- jz end ;
- jumps to 'end' if cpuid not present
+ xor esi, esi ; clear esi = result register
- ;
- cpuid instruction available, test for presence of mmx instructions
+ pushfd ; save eflags to stack
+ mov eax,dword ptr [esp] ; load eax from stack (with eflags)
+ mov ecx, eax ; save the original eflags values to ecx
+ xor eax, 0x00200000 ; toggle bit 21
+ mov dword ptr [esp],eax ; store toggled eflags to stack
+ popfd ; load eflags from stack
+
+ pushfd ; save updated eflags to stack
+ mov eax,dword ptr [esp] ; load eax from stack
+ popfd ; pop stack to restore stack pointer
+
+ xor edx, edx ; clear edx for defaulting no mmx
+ cmp eax, ecx ; compare to original eflags values
+ jz end ; jumps to 'end' if cpuid not present
+
+ ; cpuid instruction available, test for presence of mmx instructions
mov eax, 1
cpuid
test edx, 0x00800000
- jz end ;
- branch if MMX not available
+ jz end ; branch if MMX not available
- or esi, SUPPORT_MMX ;
- otherwise add MMX support bit
+ or esi, SUPPORT_MMX ; otherwise add MMX support bit
- test edx, 0x02000000
- jz test3DNow ;
- branch if SSE not available
+ test edx, 0x02000000
+ jz test3DNow ; branch if SSE not available
- or esi, SUPPORT_SSE ;
- otherwise add SSE support bit
+ or esi, SUPPORT_SSE ; otherwise add SSE support bit
test3DNow:
- ;
- test for precense of AMD extensions
+ ; test for precense of AMD extensions
mov eax, 0x80000000
cpuid
cmp eax, 0x80000000
- jbe end ;
- branch if no AMD extensions detected
+ jbe end ; branch if no AMD extensions detected
- ;
- test for precense of 3DNow! extension
+ ; test for precense of 3DNow! extension
mov eax, 0x80000001
cpuid
test edx, 0x80000000
- jz end ;
- branch if 3DNow! not detected
+ jz end ; branch if 3DNow! not detected
- or esi, SUPPORT_3DNOW ;
- otherwise add 3DNow support bit
+ or esi, SUPPORT_3DNOW ; otherwise add 3DNow support bit
end:
- mov res, esi
-}
+ mov res, esi
+ }
-return res & ~_dwDisabledISA;
+ return res & ~_dwDisabledISA;
}