mirror of
				https://github.com/Ryujinx/SDL.git
				synced 2025-11-04 15:04:51 +00:00 
			
		
		
		
	cpuinfo: use __cpuidex instead of __cpuid
The classic Intel Compiler does not clear the ecx register prior to executing the cpuid opcode.
This commit is contained in:
		
							parent
							
								
									1158cff9ea
								
							
						
					
					
						commit
						5aa76de35f
					
				| 
						 | 
					@ -262,15 +262,16 @@ done:
 | 
				
			||||||
        __asm mov c, ecx \
 | 
					        __asm mov c, ecx \
 | 
				
			||||||
        __asm mov d, edx                   \
 | 
					        __asm mov d, edx                   \
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
#elif defined(_MSC_VER) && defined(_M_X64)
 | 
					#elif (defined(_MSC_VER) && defined(_M_X64))
 | 
				
			||||||
#define cpuid(func, a, b, c, d) \
 | 
					/* Use __cpuidex instead of __cpuid because ICL does not clear ecx register */
 | 
				
			||||||
    {                           \
 | 
					#define cpuid(func, a, b, c, d)      \
 | 
				
			||||||
        int CPUInfo[4];         \
 | 
					    {                                \
 | 
				
			||||||
        __cpuid(CPUInfo, func); \
 | 
					        int CPUInfo[4];              \
 | 
				
			||||||
        a = CPUInfo[0];         \
 | 
					        __cpuidex(CPUInfo, func, 0); \
 | 
				
			||||||
        b = CPUInfo[1];         \
 | 
					        a = CPUInfo[0];              \
 | 
				
			||||||
        c = CPUInfo[2];         \
 | 
					        b = CPUInfo[1];              \
 | 
				
			||||||
        d = CPUInfo[3];         \
 | 
					        c = CPUInfo[2];              \
 | 
				
			||||||
 | 
					        d = CPUInfo[3];              \
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
#define cpuid(func, a, b, c, d) \
 | 
					#define cpuid(func, a, b, c, d) \
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue