diff options
| author | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:31:46 -0800 |
|---|---|---|
| committer | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:46:31 -0800 |
| commit | f56bb35301836e56582a575a75864392a0177875 (patch) | |
| tree | de61ddd39de3e7df52759711950b4c288592f0dc /mp/src/tier1/processor_detect_linux.cpp | |
| parent | Mark some more files as text. (diff) | |
| download | source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip | |
Fix line endings. WHAMMY.
Diffstat (limited to 'mp/src/tier1/processor_detect_linux.cpp')
| -rw-r--r-- | mp/src/tier1/processor_detect_linux.cpp | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/mp/src/tier1/processor_detect_linux.cpp b/mp/src/tier1/processor_detect_linux.cpp index 8e4f709f..c7c95d04 100644 --- a/mp/src/tier1/processor_detect_linux.cpp +++ b/mp/src/tier1/processor_detect_linux.cpp @@ -1,47 +1,47 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose: linux dependant ASM code for CPU capability detection
-//
-// $Workfile: $
-// $NoKeywords: $
-//=============================================================================//
-
-#define cpuid(in,a,b,c,d) \
- asm("pushl %%ebx\n\t" "cpuid\n\t" "movl %%ebx,%%esi\n\t" "pop %%ebx": "=a" (a), "=S" (b), "=c" (c), "=d" (d) : "a" (in));
-
-bool CheckMMXTechnology(void)
-{
- unsigned long eax,ebx,edx,unused;
- cpuid(1,eax,ebx,unused,edx);
-
- return edx & 0x800000;
-}
-
-bool CheckSSETechnology(void)
-{
- unsigned long eax,ebx,edx,unused;
- cpuid(1,eax,ebx,unused,edx);
-
- return edx & 0x2000000L;
-}
-
-bool CheckSSE2Technology(void)
-{
- unsigned long eax,ebx,edx,unused;
- cpuid(1,eax,ebx,unused,edx);
-
- return edx & 0x04000000;
-}
-
-bool Check3DNowTechnology(void)
-{
- unsigned long eax, unused;
- cpuid(0x80000000,eax,unused,unused,unused);
-
- if ( eax > 0x80000000L )
- {
- cpuid(0x80000001,unused,unused,unused,eax);
- return ( eax & 1<<31 );
- }
- return false;
-}
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: linux dependant ASM code for CPU capability detection +// +// $Workfile: $ +// $NoKeywords: $ +//=============================================================================// + +#define cpuid(in,a,b,c,d) \ + asm("pushl %%ebx\n\t" "cpuid\n\t" "movl %%ebx,%%esi\n\t" "pop %%ebx": "=a" (a), "=S" (b), "=c" (c), "=d" (d) : "a" (in)); + +bool CheckMMXTechnology(void) +{ + unsigned long eax,ebx,edx,unused; + cpuid(1,eax,ebx,unused,edx); + + return edx & 0x800000; +} + +bool CheckSSETechnology(void) +{ + unsigned long eax,ebx,edx,unused; + cpuid(1,eax,ebx,unused,edx); + + return edx & 0x2000000L; +} + +bool CheckSSE2Technology(void) +{ + unsigned long eax,ebx,edx,unused; + cpuid(1,eax,ebx,unused,edx); + + return edx & 0x04000000; +} + +bool Check3DNowTechnology(void) +{ + unsigned long eax, unused; + cpuid(0x80000000,eax,unused,unused,unused); + + if ( eax > 0x80000000L ) + { + cpuid(0x80000001,unused,unused,unused,eax); + return ( eax & 1<<31 ); + } + return false; +} |