mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-03-09 01:32:09 +00:00
HostFeatures: Adds support for querying CLWB availability
The x86 runner doesn't support CLWB natively.
This commit is contained in:
parent
965c6ff6cc
commit
bd36bd55ca
@ -79,6 +79,7 @@ HostFeatures::HostFeatures() {
|
|||||||
SupportsSHA = true;
|
SupportsSHA = true;
|
||||||
SupportsBMI1 = true;
|
SupportsBMI1 = true;
|
||||||
SupportsBMI2 = true;
|
SupportsBMI2 = true;
|
||||||
|
SupportsCLWB = true;
|
||||||
|
|
||||||
if (!SupportsAtomics) {
|
if (!SupportsAtomics) {
|
||||||
WARN_ONCE_FMT("Host CPU doesn't support atomics. Expect bad performance");
|
WARN_ONCE_FMT("Host CPU doesn't support atomics. Expect bad performance");
|
||||||
@ -128,6 +129,7 @@ HostFeatures::HostFeatures() {
|
|||||||
SupportsSHA = Features.has(Xbyak::util::Cpu::tSHA);
|
SupportsSHA = Features.has(Xbyak::util::Cpu::tSHA);
|
||||||
SupportsBMI1 = Features.has(Xbyak::util::Cpu::tBMI1);
|
SupportsBMI1 = Features.has(Xbyak::util::Cpu::tBMI1);
|
||||||
SupportsBMI2 = Features.has(Xbyak::util::Cpu::tBMI2);
|
SupportsBMI2 = Features.has(Xbyak::util::Cpu::tBMI2);
|
||||||
|
SupportsBMI2 = Features.has(Xbyak::util::Cpu::tCLWB);
|
||||||
SupportsPMULL_128Bit = Features.has(Xbyak::util::Cpu::tPCLMULQDQ);
|
SupportsPMULL_128Bit = Features.has(Xbyak::util::Cpu::tPCLMULQDQ);
|
||||||
|
|
||||||
// xbyak doesn't know how to check for CLZero
|
// xbyak doesn't know how to check for CLZero
|
||||||
|
@ -27,6 +27,7 @@ class HostFeatures final {
|
|||||||
bool SupportsSHA{};
|
bool SupportsSHA{};
|
||||||
bool SupportsBMI1{};
|
bool SupportsBMI1{};
|
||||||
bool SupportsBMI2{};
|
bool SupportsBMI2{};
|
||||||
|
bool SupportsCLWB{};
|
||||||
bool SupportsPMULL_128Bit{};
|
bool SupportsPMULL_128Bit{};
|
||||||
|
|
||||||
// Float exception behaviour
|
// Float exception behaviour
|
||||||
|
@ -72,6 +72,7 @@ class HostFeatures(Flag) :
|
|||||||
FEATURE_CLZERO = (1 << 5)
|
FEATURE_CLZERO = (1 << 5)
|
||||||
FEATURE_BMI1 = (1 << 6)
|
FEATURE_BMI1 = (1 << 6)
|
||||||
FEATURE_BMI2 = (1 << 7)
|
FEATURE_BMI2 = (1 << 7)
|
||||||
|
FEATURE_CLWB = (1 << 8)
|
||||||
|
|
||||||
RegStringLookup = {
|
RegStringLookup = {
|
||||||
"NONE": Regs.REG_NONE,
|
"NONE": Regs.REG_NONE,
|
||||||
@ -143,6 +144,7 @@ HostFeaturesLookup = {
|
|||||||
"CLZERO" : HostFeatures.FEATURE_CLZERO,
|
"CLZERO" : HostFeatures.FEATURE_CLZERO,
|
||||||
"BMI1" : HostFeatures.FEATURE_BMI1,
|
"BMI1" : HostFeatures.FEATURE_BMI1,
|
||||||
"BMI2" : HostFeatures.FEATURE_BMI2,
|
"BMI2" : HostFeatures.FEATURE_BMI2,
|
||||||
|
"CLWB" : HostFeatures.FEATURE_CLWB,
|
||||||
}
|
}
|
||||||
|
|
||||||
def parse_hexstring(s):
|
def parse_hexstring(s):
|
||||||
|
@ -385,6 +385,7 @@ namespace FEX::HarnessHelper {
|
|||||||
FEATURE_CLZERO = (1 << 5),
|
FEATURE_CLZERO = (1 << 5),
|
||||||
FEATURE_BMI1 = (1 << 6),
|
FEATURE_BMI1 = (1 << 6),
|
||||||
FEATURE_BMI2 = (1 << 7),
|
FEATURE_BMI2 = (1 << 7),
|
||||||
|
FEATURE_CLWB = (1 << 8),
|
||||||
};
|
};
|
||||||
|
|
||||||
bool Requires3DNow() const { return BaseConfig.OptionHostFeatures & HostFeatures::FEATURE_3DNOW; }
|
bool Requires3DNow() const { return BaseConfig.OptionHostFeatures & HostFeatures::FEATURE_3DNOW; }
|
||||||
@ -395,6 +396,7 @@ namespace FEX::HarnessHelper {
|
|||||||
bool RequiresCLZERO() const { return BaseConfig.OptionHostFeatures & HostFeatures::FEATURE_CLZERO; }
|
bool RequiresCLZERO() const { return BaseConfig.OptionHostFeatures & HostFeatures::FEATURE_CLZERO; }
|
||||||
bool RequiresBMI1() const { return BaseConfig.OptionHostFeatures & HostFeatures::FEATURE_BMI1; }
|
bool RequiresBMI1() const { return BaseConfig.OptionHostFeatures & HostFeatures::FEATURE_BMI1; }
|
||||||
bool RequiresBMI2() const { return BaseConfig.OptionHostFeatures & HostFeatures::FEATURE_BMI2; }
|
bool RequiresBMI2() const { return BaseConfig.OptionHostFeatures & HostFeatures::FEATURE_BMI2; }
|
||||||
|
bool RequiresCLWB() const { return BaseConfig.OptionHostFeatures & HostFeatures::FEATURE_CLWB; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FEX_CONFIG_OPT(ConfigDumpGPRs, DUMPGPRS);
|
FEX_CONFIG_OPT(ConfigDumpGPRs, DUMPGPRS);
|
||||||
@ -534,6 +536,7 @@ namespace FEX::HarnessHelper {
|
|||||||
bool RequiresCLZERO() const { return Config.RequiresCLZERO(); }
|
bool RequiresCLZERO() const { return Config.RequiresCLZERO(); }
|
||||||
bool RequiresBMI1() const { return Config.RequiresBMI1(); }
|
bool RequiresBMI1() const { return Config.RequiresBMI1(); }
|
||||||
bool RequiresBMI2() const { return Config.RequiresBMI2(); }
|
bool RequiresBMI2() const { return Config.RequiresBMI2(); }
|
||||||
|
bool RequiresCLWB() const { return Config.RequiresCLWB(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
constexpr static uint64_t STACK_SIZE = FHU::FEX_PAGE_SIZE;
|
constexpr static uint64_t STACK_SIZE = FHU::FEX_PAGE_SIZE;
|
||||||
|
@ -178,7 +178,8 @@ int main(int argc, char **argv, char **const envp) {
|
|||||||
(!HostFeatures.SupportsSHA && Loader.RequiresSHA()) ||
|
(!HostFeatures.SupportsSHA && Loader.RequiresSHA()) ||
|
||||||
(!HostFeatures.SupportsCLZERO && Loader.RequiresCLZERO()) ||
|
(!HostFeatures.SupportsCLZERO && Loader.RequiresCLZERO()) ||
|
||||||
(!HostFeatures.SupportsBMI1 && Loader.RequiresBMI1()) ||
|
(!HostFeatures.SupportsBMI1 && Loader.RequiresBMI1()) ||
|
||||||
(!HostFeatures.SupportsBMI2 && Loader.RequiresBMI2());
|
(!HostFeatures.SupportsBMI2 && Loader.RequiresBMI2()) ||
|
||||||
|
(!HostFeatures.SupportsCLWB && Loader.RequiresCLWB());
|
||||||
|
|
||||||
if (TestUnsupported) {
|
if (TestUnsupported) {
|
||||||
FEXCore::Context::DestroyContext(CTX);
|
FEXCore::Context::DestroyContext(CTX);
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
{
|
{
|
||||||
"RegData": {
|
"RegData": {
|
||||||
"RAX": "1"
|
"RAX": "1"
|
||||||
}
|
},
|
||||||
|
"HostFeatures": ["CLWB"]
|
||||||
}
|
}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user