/* ================ Sys_GetCPUId ================ */ cpuid_t Sys_GetCPUId() { int flags; // check for an AMD flags = CPUID_GENERIC; // check for Multi Media Extensions if( SDL_HasMMX() ) { flags |= CPUID_MMX; } // check for 3DNow! if( SDL_Has3DNow() ) { flags |= CPUID_3DNOW; } // check for Streaming SIMD Extensions if( SDL_HasSSE() ) { flags |= CPUID_SSE | CPUID_FTZ; } // check for Streaming SIMD Extensions 2 if( SDL_HasSSE2() ) { flags |= CPUID_SSE2; } // check for Streaming SIMD Extensions 3 aka Prescott's New Instructions #if 0 //SDL_VERSION_ATLEAST(2,0,0) if( SDL_HasSSE3() ) { flags |= CPUID_SSE3; } #endif /* // check for Hyper-Threading Technology if( HasHTT() ) { flags |= CPUID_HTT; } // check for Conditional Move (CMOV) and fast floating point comparison (FCOMI) instructions if( HasCMOV() ) { flags |= CPUID_CMOV; } // check for Denormals-Are-Zero mode if( HasDAZ() ) { flags |= CPUID_DAZ; } */ return ( cpuid_t )flags; }
static mrb_value mrb_sdl2_cpuinfo_has_sse3(mrb_state *mrb, mrb_value self) { return (SDL_HasSSE3() == SDL_FALSE) ? mrb_false_value() : mrb_true_value(); }