mirror of
				https://github.com/PurpleI2P/i2pd.git
				synced 2025-11-04 08:30:46 +00:00 
			
		
		
		
	do not use builtin cpu detect, cpuid is enough
This commit is contained in:
		
							parent
							
								
									ad3bfcaaa5
								
							
						
					
					
						commit
						faf04def31
					
				
					 1 changed files with 2 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -30,17 +30,14 @@ namespace cpu
 | 
			
		|||
	void Detect(bool AesSwitch, bool AvxSwitch)
 | 
			
		||||
	{
 | 
			
		||||
#if defined(__x86_64__) || defined(__i386__)
 | 
			
		||||
		__builtin_cpu_init();
 | 
			
		||||
		int info[4];
 | 
			
		||||
		__cpuid(0, info[0], info[1], info[2], info[3]);
 | 
			
		||||
		if (info[0] >= 0x00000001) {
 | 
			
		||||
			__cpuid(0x00000001, info[0], info[1], info[2], info[3]);
 | 
			
		||||
#ifdef __AES__
 | 
			
		||||
			if ((info[2] & bit_AES || __builtin_cpu_supports("aes")) && AesSwitch) {
 | 
			
		||||
			if (info[2] & bit_AES && AesSwitch) {
 | 
			
		||||
				aesni = true;
 | 
			
		||||
			}
 | 
			
		||||
#endif // __AES__
 | 
			
		||||
			if ((info[2] & bit_AVX || __builtin_cpu_supports("avx")) && AvxSwitch) {
 | 
			
		||||
			if (info[2] & bit_AVX && AvxSwitch) {
 | 
			
		||||
				avx = true;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue