mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 05:01:41 +00:00
- Add an alternate PIC-compliant __cpuid macro in x86.cpp.
SVN r1793 (trunk)
This commit is contained in:
parent
6214177f1f
commit
b528b987da
2 changed files with 12 additions and 0 deletions
|
@ -2,6 +2,7 @@ September 5, 2009 (Changes by Graf Zahl)
|
|||
- made menu dimming a mapping option but kept the CVARS as user override.
|
||||
|
||||
September 4, 2009
|
||||
- Add an alternate PIC-compliant __cpuid macro in x86.cpp.
|
||||
- Fixed: S_LoadSound() did not byte-swap the frequency and length it reads
|
||||
from DMX sounds.
|
||||
- Fixed: PNGTexture must not use the FArchive >> operator as a short hand
|
||||
|
|
11
src/x86.cpp
11
src/x86.cpp
|
@ -25,10 +25,21 @@ void DumpCPUInfo(const CPUInfo *cpu)
|
|||
#include <mmintrin.h>
|
||||
#include <emmintrin.h>
|
||||
|
||||
|
||||
#ifdef __GNUC__
|
||||
#if defined(__i386__) && defined(__PIC__)
|
||||
// %ebx may by the PIC register. */
|
||||
#define __cpuid(output, func) \
|
||||
__asm__ __volatile__("xchgl\t%%ebx, %1\n\t" \
|
||||
"cpuid\n\t" \
|
||||
"xchgl\t%%ebx, %1\n\t" \
|
||||
: "=a" ((output)[0]), "=r" ((output)[1]), "=c" ((output)[2]), "=d" ((output)[3]) \
|
||||
: "a" (func));
|
||||
#else
|
||||
#define __cpuid(output, func) __asm__ __volatile__("cpuid" : "=a" ((output)[0]),\
|
||||
"=b" ((output)[1]), "=c" ((output)[2]), "=d" ((output)[3]) : "a" (func));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void CheckCPUID(CPUInfo *cpu)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue