Skip to content

Commit

Permalink
InstcountCI: Support AVX flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonicadvance1 committed Jun 24, 2024
1 parent 58a8b81 commit 14f8b4d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Scripts/InstructionCountParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class HostFeatures(Flag) :
FEATURE_FLAGM2 = (1 << 9)
FEATURE_CRYPTO = (1 << 10)
FEATURE_AES256 = (1 << 11)
FEATURE_AVX = (1 << 12)

HostFeaturesLookup = {
"SVE128" : HostFeatures.FEATURE_SVE128,
Expand All @@ -68,6 +69,7 @@ class HostFeatures(Flag) :
"FLAGM2" : HostFeatures.FEATURE_FLAGM2,
"CRYPTO" : HostFeatures.FEATURE_CRYPTO,
"AES256" : HostFeatures.FEATURE_AES256,
"AVX" : HostFeatures.FEATURE_AVX,
}

def GetHostFeatures(data):
Expand Down
12 changes: 11 additions & 1 deletion Source/Tools/CodeSizeValidation/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,8 @@ int main(int argc, char** argv, char** const envp) {
FEATURE_FLAGM = (1U << 8),
FEATURE_FLAGM2 = (1U << 9),
FEATURE_CRYPTO = (1U << 10),
FEATURE_AES256 = (1U << 11),
FEATURE_AVX = (1U << 12),
};

uint64_t SVEWidth = 0;
Expand Down Expand Up @@ -544,6 +546,9 @@ int main(int argc, char** argv, char** const envp) {
if (TestHeaderData->EnabledHostFeatures & FEATURE_CRYPTO) {
HostFeatureControl |= static_cast<uint64_t>(FEXCore::Config::HostFeatures::ENABLECRYPTO);
}
if (TestHeaderData->EnabledHostFeatures & FEATURE_AVX) {
HostFeatureControl |= static_cast<uint64_t>(FEXCore::Config::HostFeatures::ENABLEAVX);
}

// Always enable ARMv8.1 LSE atomics.
HostFeatureControl |= static_cast<uint64_t>(FEXCore::Config::HostFeatures::ENABLEATOMICS);
Expand All @@ -552,7 +557,9 @@ int main(int argc, char** argv, char** const envp) {
HostFeatureControl |= static_cast<uint64_t>(FEXCore::Config::HostFeatures::DISABLESVE);
}
if (TestHeaderData->DisabledHostFeatures & FEATURE_SVE256) {
HostFeatureControl |= static_cast<uint64_t>(FEXCore::Config::HostFeatures::DISABLEAVX);
if (TestHeaderData->EnabledHostFeatures & FEATURE_SVE128) {
SVEWidth = 128;
}
}
if (TestHeaderData->DisabledHostFeatures & FEATURE_CLZERO) {
HostFeatureControl |= static_cast<uint64_t>(FEXCore::Config::HostFeatures::DISABLECLZERO);
Expand Down Expand Up @@ -581,6 +588,9 @@ int main(int argc, char** argv, char** const envp) {
if (TestHeaderData->DisabledHostFeatures & FEATURE_CRYPTO) {
HostFeatureControl |= static_cast<uint64_t>(FEXCore::Config::HostFeatures::DISABLECRYPTO);
}
if (TestHeaderData->DisabledHostFeatures & FEATURE_AVX) {
HostFeatureControl |= static_cast<uint64_t>(FEXCore::Config::HostFeatures::DISABLEAVX);
}

// Always enable preserve_all abi.
HostFeatureControl |= static_cast<uint64_t>(FEXCore::Config::HostFeatures::ENABLEPRESERVEALLABI);
Expand Down

0 comments on commit 14f8b4d

Please sign in to comment.