src/cpuinfo/SDL_cpuinfo.c
changeset 1442 e3242177fe4a
parent 1426 ef9a9064bff2
child 1487 dc6b59e925a2
equal deleted inserted replaced
1441:b9f034536fa0 1442:e3242177fe4a
    94 "1:                                                                    \n"
    94 "1:                                                                    \n"
    95 	: "=m" (has_CPUID)
    95 	: "=m" (has_CPUID)
    96 	:
    96 	:
    97 	: "%rax", "%rcx"
    97 	: "%rax", "%rcx"
    98 	);
    98 	);
    99 #elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_X86_))
    99 #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
   100 	__asm {
   100 	__asm {
   101         pushfd                      ; Get original EFLAGS
   101         pushfd                      ; Get original EFLAGS
   102         pop     eax
   102         pop     eax
   103         mov     ecx, eax
   103         mov     ecx, eax
   104         xor     eax, 200000h        ; Flip ID bit in EFLAGS
   104         xor     eax, 200000h        ; Flip ID bit in EFLAGS
   163 "        movl    %%edi,%%ebx\n"
   163 "        movl    %%edi,%%ebx\n"
   164 	: "=m" (features)
   164 	: "=m" (features)
   165 	:
   165 	:
   166 	: "%eax", "%ecx", "%edx", "%edi"
   166 	: "%eax", "%ecx", "%edx", "%edi"
   167 	);
   167 	);
   168 #elif defined(_MSC_VER)  && (defined(_M_IX86) || defined(_X86_))
   168 #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
   169 	__asm {
   169 	__asm {
   170         xor     eax, eax            ; Set up for CPUID instruction
   170         xor     eax, eax            ; Set up for CPUID instruction
   171         cpuid                       ; Get and save vendor ID
   171         cpuid                       ; Get and save vendor ID
   172         cmp     eax, 1              ; Make sure 1 is valid input for CPUID
   172         cmp     eax, 1              ; Make sure 1 is valid input for CPUID
   173         jl      done                ; We dont have the CPUID instruction
   173         jl      done                ; We dont have the CPUID instruction
   215 "        movl    %%edi,%%ebx\n"
   215 "        movl    %%edi,%%ebx\n"
   216 	: "=m" (features)
   216 	: "=m" (features)
   217 	:
   217 	:
   218 	: "%eax", "%ecx", "%edx", "%edi"
   218 	: "%eax", "%ecx", "%edx", "%edi"
   219 	);
   219 	);
   220 #elif defined(_MSC_VER)  && (defined(_M_IX86) || defined(_X86_))
   220 #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
   221 	__asm {
   221 	__asm {
   222         mov     eax,80000000h       ; Query for extended functions
   222         mov     eax,80000000h       ; Query for extended functions
   223         cpuid                       ; Get extended function limit
   223         cpuid                       ; Get extended function limit
   224         cmp     eax,80000001h
   224         cmp     eax,80000001h
   225         jl      done                ; Nope, we dont have function 800000001h
   225         jl      done                ; Nope, we dont have function 800000001h