X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=frontend%2Fmain.c;h=d52fe211fb527118b7a72d50cf5c7c1d11fc3b72;hb=6f860c2b80233f3721c08d7fb3e5e37423b84149;hp=d846d3ce47d197dd534af14e9990fddde8371f8f;hpb=2d724e28a974472f4d24dc71f8cd489fbcd27869;p=pcsx_rearmed.git diff --git a/frontend/main.c b/frontend/main.c index d846d3ce..d52fe211 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -29,6 +29,14 @@ #include "arm_features.h" #include "revision.h" +#if defined(__has_builtin) +#define DO_CPU_CHECKS __has_builtin(__builtin_cpu_init) +#elif defined(__x86_64__) || defined(__i386__) +#define DO_CPU_CHECKS 1 +#else +#define DO_CPU_CHECKS 0 +#endif + #ifndef NO_FRONTEND #include "libpicofe/input.h" #include "libpicofe/plat.h" @@ -411,6 +419,24 @@ void emu_on_new_cd(int show_hud_msg) } } +static void log_wrong_cpu(void) +{ +#if DO_CPU_CHECKS + __builtin_cpu_init(); + #define CHECK_CPU(name) if (!__builtin_cpu_supports(name)) \ + SysPrintf("ERROR: compiled for " name ", which is unsupported by the CPU\n") +#ifdef __SSE2__ + CHECK_CPU("sse2"); +#endif +#ifdef __SSSE3__ + CHECK_CPU("ssse3"); +#endif +#ifdef __SSE4_1__ + CHECK_CPU("sse4"); +#endif +#endif // DO_CPU_CHECKS +} + int emu_core_preinit(void) { // what is the name of the config file? @@ -425,6 +451,8 @@ int emu_core_preinit(void) #endif emuLog = stdout; + log_wrong_cpu(); + SetIsoFile(NULL); memset(&Config, 0, sizeof(Config));