[CPU] Print a message and crash if the CPU does not support AVX.

This commit is contained in:
Dr. Chat 2018-05-03 22:12:36 -05:00
parent 926b133a0f
commit 198cc9b9b9
1 changed files with 8 additions and 1 deletions

View File

@ -13,7 +13,9 @@
#include "third_party/capstone/include/capstone.h" #include "third_party/capstone/include/capstone.h"
#include "third_party/capstone/include/x86.h" #include "third_party/capstone/include/x86.h"
#include "xenia/base/exception_handler.h" #include "xenia/base/exception_handler.h"
#include "xenia/base/logging.h"
#include "xenia/cpu/backend/x64/x64_assembler.h" #include "xenia/cpu/backend/x64/x64_assembler.h"
#include "xenia/cpu/backend/x64/x64_code_cache.h" #include "xenia/cpu/backend/x64/x64_code_cache.h"
#include "xenia/cpu/backend/x64/x64_emitter.h" #include "xenia/cpu/backend/x64/x64_emitter.h"
@ -65,11 +67,16 @@ bool X64Backend::Initialize(Processor* processor) {
return false; return false;
} }
Xbyak::util::Cpu cpu;
if (!cpu.has(Xbyak::util::Cpu::tAVX)) {
XELOGE("This CPU does not support AVX. The emulator will now crash.");
return false;
}
RegisterSequences(); RegisterSequences();
// Need movbe to do advanced LOAD/STORE tricks. // Need movbe to do advanced LOAD/STORE tricks.
if (FLAGS_enable_haswell_instructions) { if (FLAGS_enable_haswell_instructions) {
Xbyak::util::Cpu cpu;
machine_info_.supports_extended_load_store = machine_info_.supports_extended_load_store =
cpu.has(Xbyak::util::Cpu::tMOVBE); cpu.has(Xbyak::util::Cpu::tMOVBE);
} else { } else {