ps4delta/code/core/arch/arch.h
Force67 39720568fa Last changes as of 02/05/20
-includes a new filesystem
-complete rewrite of the PRX loader (still in progress)
-rewritten kernel infrastructure
-and much more
2020-02-05 13:58:11 +01:00

43 lines
No EOL
1.2 KiB
C++

#pragma once
/*
* PS4Delta : PS4 emulation and research project
*
* Copyright 2019-2020 Force67.
* For information regarding licensing see LICENSE
* in the root of the source tree.
*/
#include <xbyak_util.h>
#include <logger/logger.h>
namespace arch {
inline bool validateCpu() {
std::string missingFeatures;
Xbyak::util::Cpu cpu;
#define CHECK_FEATURE(x, y) \
if (!cpu.has(Xbyak::util::Cpu::t##x)) { \
missingFeatures += ";" + std::string(y); \
}
CHECK_FEATURE(SSE, "SSE");
CHECK_FEATURE(SSE2, "SSE2");
CHECK_FEATURE(SSE3, "SSE3");
CHECK_FEATURE(SSSE3, "SSSE3");
CHECK_FEATURE(SSE41, "SSE4.1");
CHECK_FEATURE(SSE42, "SSE4.2");
CHECK_FEATURE(AESNI, "AES");
CHECK_FEATURE(AVX, "AVX");
CHECK_FEATURE(PCLMULQDQ, "CLMUL");
CHECK_FEATURE(F16C, "F16C");
CHECK_FEATURE(BMI1, "BM1");
if (!missingFeatures.empty()) {
LOG_ERROR("Your cpu is missing the following instructions: {}", missingFeatures);
return false;
}
return true;
}
}