mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 01:27:16 +08:00
Fix __cpuid() compile error with gcc
Use same __cpuid() signature used under Windows. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
11
src/types.h
11
src/types.h
@@ -80,11 +80,14 @@ typedef uint64_t Bitboard;
|
|||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER)
|
||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
inline void __cpuid(unsigned int op,
|
inline void __cpuid(int CPUInfo[4], int InfoType)
|
||||||
unsigned int *eax, unsigned int *ebx,
|
|
||||||
unsigned int *ecx, unsigned int *edx)
|
|
||||||
{
|
{
|
||||||
*eax = op;
|
int* eax = CPUInfo + 0;
|
||||||
|
int* ebx = CPUInfo + 1;
|
||||||
|
int* ecx = CPUInfo + 2;
|
||||||
|
int* edx = CPUInfo + 3;
|
||||||
|
|
||||||
|
*eax = InfoType;
|
||||||
*ecx = 0;
|
*ecx = 0;
|
||||||
__asm__("cpuid" : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
|
__asm__("cpuid" : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
|
||||||
: "0" (*eax), "2" (*ecx));
|
: "0" (*eax), "2" (*ecx));
|
||||||
|
|||||||
Reference in New Issue
Block a user