@@ -143,7 +143,7 @@ XRCORE_API u64 qpc_freq = 0;
143143XRCORE_API u64 qpc_overhead = 0 ;
144144XRCORE_API u32 qpc_counter = 0 ;
145145
146- XRCORE_API _processor_info ID;
146+ XRCORE_API processor_info ID;
147147
148148XRCORE_API u64 QPC ()
149149{
@@ -164,7 +164,7 @@ u64 __fastcall GetCLK(void)
164164void Detect ()
165165{
166166 // General CPU identification
167- if (!_cpuid (&ID))
167+ if (!query_processor_info (&ID))
168168 {
169169 // Core.Fatal ("Fatal error: can't detect CPU/FPU.");
170170 abort ();
@@ -234,44 +234,36 @@ bool g_initialize_cpu_called = false;
234234// ------------------------------------------------------------------------------------
235235void _initialize_cpu (void )
236236{
237- Msg (" * Detected CPU: %s [%s], F%d/M%d/S%d, %.2f mhz, %d-clk 'rdtsc'" , CPU::ID.model_name , CPU::ID.v_name ,
237+ Msg (" * Detected CPU: %s [%s], F%d/M%d/S%d, %.2f mhz, %d-clk 'rdtsc'" , CPU::ID.modelName , CPU::ID.vendor ,
238238 CPU::ID.family , CPU::ID.model , CPU::ID.stepping , float (CPU::clk_per_second / u64 (1000000 )),
239239 u32 (CPU::clk_overhead));
240240
241241 // DUMP_PHASE;
242242
243243 if (strstr (Core.Params , " -x86" ))
244244 {
245- CPU::ID.feature &= ~_CPU_FEATURE_MMX ;
246- CPU::ID.feature &= ~_CPU_FEATURE_3DNOW ;
247- CPU::ID.feature &= ~_CPU_FEATURE_SSE ;
248- CPU::ID.feature &= ~_CPU_FEATURE_SSE2 ;
249- CPU::ID.feature &= ~_CPU_FEATURE_SSE3 ;
250- CPU::ID.feature &= ~_CPU_FEATURE_SSSE3 ;
251- CPU::ID.feature &= ~_CPU_FEATURE_SSE4_1 ;
252- CPU::ID.feature &= ~_CPU_FEATURE_SSE4_2 ;
245+ CPU::ID.hasFeature (CpuFeature::Mmx) ;
246+ CPU::ID.hasFeature (CpuFeature::_3dNow) ;
247+ CPU::ID.hasFeature (CpuFeature::Sse) ;
248+ CPU::ID.hasFeature (CpuFeature::Sse2) ;
249+ CPU::ID.hasFeature (CpuFeature::Sse3) ;
250+ CPU::ID.hasFeature (CpuFeature::Ssse3) ;
251+ CPU::ID.hasFeature (CpuFeature::Sse41) ;
252+ CPU::ID.hasFeature (CpuFeature::Sse42) ;
253253 };
254254
255255 string256 features;
256256 xr_strcpy (features, sizeof (features), " RDTSC" );
257- if (CPU::ID.feature & _CPU_FEATURE_MMX)
258- xr_strcat (features, " , MMX" );
259- if (CPU::ID.feature & _CPU_FEATURE_3DNOW)
260- xr_strcat (features, " , 3DNow!" );
261- if (CPU::ID.feature & _CPU_FEATURE_SSE)
262- xr_strcat (features, " , SSE" );
263- if (CPU::ID.feature & _CPU_FEATURE_SSE2)
264- xr_strcat (features, " , SSE2" );
265- if (CPU::ID.feature & _CPU_FEATURE_SSE3)
266- xr_strcat (features, " , SSE3" );
267- if (CPU::ID.feature & _CPU_FEATURE_SSSE3)
268- xr_strcat (features, " , SSSE3" );
269- if (CPU::ID.feature & _CPU_FEATURE_SSE4_1)
270- xr_strcat (features, " , SSE4.1" );
271- if (CPU::ID.feature & _CPU_FEATURE_SSE4_2)
272- xr_strcat (features, " , SSE4.2" );
273- if (CPU::ID.feature & _CPU_FEATURE_HTT)
274- xr_strcat (features, " , HTT" );
257+ if (CPU::ID.hasFeature (CpuFeature::Mmx)) xr_strcat (features, " , MMX" );
258+ if (CPU::ID.hasFeature (CpuFeature::_3dNow)) xr_strcat (features, " , 3DNow!" );
259+ if (CPU::ID.hasFeature (CpuFeature::Sse)) xr_strcat (features, " , SSE" );
260+ if (CPU::ID.hasFeature (CpuFeature::Sse2)) xr_strcat (features, " , SSE2" );
261+ if (CPU::ID.hasFeature (CpuFeature::Sse3)) xr_strcat (features, " , SSE3" );
262+ if (CPU::ID.hasFeature (CpuFeature::MWait)) xr_strcat (features, " , MONITOR/MWAIT" );
263+ if (CPU::ID.hasFeature (CpuFeature::Ssse3)) xr_strcat (features, " , SSSE3" );
264+ if (CPU::ID.hasFeature (CpuFeature::Sse41)) xr_strcat (features, " , SSE4.1" );
265+ if (CPU::ID.hasFeature (CpuFeature::Sse42)) xr_strcat (features, " , SSE4.2" );
266+ if (CPU::ID.hasFeature (CpuFeature::HT)) xr_strcat (features, " , HTT" );
275267
276268 Msg (" * CPU features: %s" , features);
277269 Msg (" * CPU cores/threads: %d/%d\n " , CPU::ID.n_cores , CPU::ID.n_threads );
@@ -304,7 +296,7 @@ void _initialize_cpu_thread()
304296 xrDebug::OnThreadSpawn ();
305297 if (!Core.PluginMode )
306298 FPU::m24r ();
307- if (CPU::ID.feature & _CPU_FEATURE_SSE )
299+ if (CPU::ID.hasFeature (CpuFeature::Sse) )
308300 {
309301 // _mm_setcsr ( _mm_getcsr() | (_MM_FLUSH_ZERO_ON+_MM_DENORMALS_ZERO_ON) );
310302 _MM_SET_FLUSH_ZERO_MODE (_MM_FLUSH_ZERO_ON);
0 commit comments