From 29b0b17f50f27905a4a00f342f404c2ba0b0547b Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sat, 9 Jan 2016 22:31:49 +0100 Subject: [PATCH] x86emitter: add BMI1 & BMI2 instruction detection --- common/include/x86emitter/tools.h | 2 ++ common/src/x86emitter/cpudetect.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/common/include/x86emitter/tools.h b/common/include/x86emitter/tools.h index 0ab33fa76c..53fa79ddcd 100644 --- a/common/include/x86emitter/tools.h +++ b/common/include/x86emitter/tools.h @@ -90,6 +90,8 @@ public: u32 hasStreamingSIMD4Extensions2 :1; u32 hasAVX :1; u32 hasAVX2 :1; + u32 hasBMI1 :1; + u32 hasBMI2 :1; u32 hasFMA :1; // AMD-specific CPU Features diff --git a/common/src/x86emitter/cpudetect.cpp b/common/src/x86emitter/cpudetect.cpp index 717ca8972a..2658e9dab9 100644 --- a/common/src/x86emitter/cpudetect.cpp +++ b/common/src/x86emitter/cpudetect.cpp @@ -278,6 +278,9 @@ void x86capabilities::Identify() } } + hasBMI1 = ( SEFlag >> 3 ) & 1; + hasBMI2 = ( SEFlag >> 8 ) & 1; + // Ones only for AMDs: hasMultimediaExtensionsExt = ( EFlags >> 22 ) & 1; //mmx2 hasAMD64BitArchitecture = ( EFlags >> 29 ) & 1; //64bit cpu