unittests: Support skipping unit tests based on host feature support

For these unit tests we no longer need to put them in the disabled tests
file. Instead it will be skipped if the host doesn't support the feature
required.
This commit is contained in:
Ryan Houdek 2022-08-14 19:58:45 -07:00
parent bba58732e0
commit edad24479b
64 changed files with 211 additions and 161 deletions

View File

@ -63,8 +63,15 @@ class Mode(Flag) :
MODE_64 = 1
class HostFeatures(Flag) :
ANY = 0
AVX_ONLY = 1
FEATURE_ANY = 0
FEATURE_3DNOW = (1 << 0)
FEATURE_SSE4A = (1 << 1)
FEATURE_AVX = (1 << 2)
FEATURE_RAND = (1 << 3)
FEATURE_SHA = (1 << 4)
FEATURE_CLZERO = (1 << 5)
FEATURE_BMI1 = (1 << 6)
FEATURE_BMI2 = (1 << 7)
RegStringLookup = {
"NONE": Regs.REG_NONE,
@ -128,8 +135,14 @@ ModeStringLookup = {
}
HostFeaturesLookup = {
"ANY" : HostFeatures.ANY,
"AVX" : HostFeatures.AVX_ONLY,
"3DNOW" : HostFeatures.FEATURE_3DNOW,
"SSE4A" : HostFeatures.FEATURE_SSE4A,
"AVX" : HostFeatures.FEATURE_AVX,
"RAND" : HostFeatures.FEATURE_RAND,
"SHA" : HostFeatures.FEATURE_SHA,
"CLZERO" : HostFeatures.FEATURE_CLZERO,
"BMI1" : HostFeatures.FEATURE_BMI1,
"BMI2" : HostFeatures.FEATURE_BMI2,
}
def parse_hexstring(s):
@ -152,7 +165,7 @@ def parse_json(json_text, output_file):
OptionIgnore = Regs.REG_NONE
OptionABI = ABI.ABI_SYSTEMV
OptionMode = Mode.MODE_64
OptionHostFeatures = HostFeatures.ANY
OptionHostFeatures = HostFeatures.FEATURE_ANY
OptionStackSize = 4096
OptionEntryPoint = 1
OptionRegData = {}
@ -208,10 +221,15 @@ def parse_json(json_text, output_file):
if ("HOSTFEATURES" in json_object):
data = json_object["HOSTFEATURES"]
data = data.upper()
if not (data in HostFeaturesLookup):
sys.exit("Invalid host feature")
OptionHostFeatures = HostFeaturesLookup[data]
if not (type(data) is list):
sys.exit("HostFeatures value must be list of features")
for data_key in data:
data_key = data_key.upper()
if not (data_key in HostFeaturesLookup):
sys.exit("Invalid host feature")
OptionHostFeatures |= HostFeaturesLookup[data_key]
if ("STACKSIZE" in json_object):
data = json_object["STACKSIZE"]

View File

@ -374,7 +374,27 @@ namespace FEX::HarnessHelper {
}
bool Is64BitMode() const { return BaseConfig.OptionMode == 1; }
bool RequiresAVX() const { return BaseConfig.OptionHostFeatures == 1; }
enum HostFeatures {
FEATURE_ANY = 0,
FEATURE_3DNOW = (1 << 0),
FEATURE_SSE4A = (1 << 1),
FEATURE_AVX = (1 << 2),
FEATURE_RAND = (1 << 3),
FEATURE_SHA = (1 << 4),
FEATURE_CLZERO = (1 << 5),
FEATURE_BMI1 = (1 << 6),
FEATURE_BMI2 = (1 << 7),
};
bool Requires3DNow() const { return BaseConfig.OptionHostFeatures & HostFeatures::FEATURE_3DNOW; }
bool RequiresSSE4A() const { return BaseConfig.OptionHostFeatures & HostFeatures::FEATURE_SSE4A; }
bool RequiresAVX() const { return BaseConfig.OptionHostFeatures & HostFeatures::FEATURE_AVX; }
bool RequiresRAND() const { return BaseConfig.OptionHostFeatures & HostFeatures::FEATURE_RAND; }
bool RequiresSHA() const { return BaseConfig.OptionHostFeatures & HostFeatures::FEATURE_SHA; }
bool RequiresCLZERO() const { return BaseConfig.OptionHostFeatures & HostFeatures::FEATURE_CLZERO; }
bool RequiresBMI1() const { return BaseConfig.OptionHostFeatures & HostFeatures::FEATURE_BMI1; }
bool RequiresBMI2() const { return BaseConfig.OptionHostFeatures & HostFeatures::FEATURE_BMI2; }
private:
FEX_CONFIG_OPT(ConfigDumpGPRs, DUMPGPRS);
@ -506,7 +526,14 @@ namespace FEX::HarnessHelper {
}
bool Is64BitMode() const { return Config.Is64BitMode(); }
bool RequiresAVX() const { return Config.RequiresAVX(); }
bool Requires3DNow() const { return Config.Requires3DNow(); }
bool RequiresSSE4A() const { return Config.RequiresSSE4A(); }
bool RequiresAVX() const { return Config.RequiresAVX(); }
bool RequiresRAND() const { return Config.RequiresRAND(); }
bool RequiresSHA() const { return Config.RequiresSHA(); }
bool RequiresCLZERO() const { return Config.RequiresCLZERO(); }
bool RequiresBMI1() const { return Config.RequiresBMI1(); }
bool RequiresBMI2() const { return Config.RequiresBMI2(); }
private:
constexpr static uint64_t STACK_SIZE = FHU::FEX_PAGE_SIZE;

View File

@ -139,7 +139,7 @@ int main(int argc, char **argv, char **const envp) {
FEX_CONFIG_OPT(Core, CORE);
std::unique_ptr<FEX::HLE::MemAllocator> Allocator;
if (!Loader.Is64BitMode()) {
// Setup our userspace allocator
uint32_t KernelVersion = FEX::HLE::SyscallHandler::CalculateHostKernelVersion();
@ -159,6 +159,32 @@ int main(int argc, char **argv, char **const envp) {
bool DidFault = false;
bool SupportsAVX = false;
FEXCore::Core::CPUState State;
FEXCore::Context::InitializeStaticTables(Loader.Is64BitMode() ? FEXCore::Context::MODE_64BIT : FEXCore::Context::MODE_32BIT);
auto CTX = FEXCore::Context::CreateNewContext();
FEXCore::Context::InitializeContext(CTX);
// Skip any tests that the host doesn't support features for
auto HostFeatures = FEXCore::Context::GetHostFeatures(CTX);
SupportsAVX = HostFeatures.SupportsAVX;
bool TestUnsupported =
(!HostFeatures.Supports3DNow && Loader.Requires3DNow()) ||
(!HostFeatures.SupportsSSE4A && Loader.RequiresSSE4A()) ||
(!SupportsAVX && Loader.RequiresAVX()) ||
(!HostFeatures.SupportsRAND && Loader.RequiresRAND()) ||
(!HostFeatures.SupportsSHA && Loader.RequiresSHA()) ||
(!HostFeatures.SupportsCLZERO && Loader.RequiresCLZERO()) ||
(!HostFeatures.SupportsBMI1 && Loader.RequiresBMI1()) ||
(!HostFeatures.SupportsBMI2 && Loader.RequiresBMI2());
if (TestUnsupported) {
FEXCore::Context::DestroyContext(CTX);
return 0;
}
if (Core != FEXCore::Config::CONFIG_CUSTOM) {
jmp_buf LongJump{};
int LongJumpVal{};
@ -175,12 +201,6 @@ int main(int argc, char **argv, char **const envp) {
}, true);
// Run through FEX
FEXCore::Context::InitializeStaticTables(Loader.Is64BitMode() ? FEXCore::Context::MODE_64BIT : FEXCore::Context::MODE_32BIT);
auto CTX = FEXCore::Context::CreateNewContext();
FEXCore::Context::InitializeContext(CTX);
auto SyscallHandler = Loader.Is64BitMode() ? FEX::HLE::x64::CreateHandler(CTX, SignalDelegation.get())
: FEX::HLE::x32::CreateHandler(CTX, SignalDelegation.get(), std::move(Allocator));
@ -195,14 +215,13 @@ int main(int argc, char **argv, char **const envp) {
FEXCore::Context::SetSignalDelegator(CTX, SignalDelegation.get());
FEXCore::Context::SetSyscallHandler(CTX, SyscallHandler.get());
bool Result1 = FEXCore::Context::InitCore(CTX, Loader.DefaultRIP(), Loader.GetStackPointer());
if (!Result1) {
return 1;
}
SupportsAVX = FEXCore::Context::GetHostFeatures(CTX).SupportsAVX;
LongJumpVal = setjmp(LongJump);
if (!LongJumpVal) {
FEXCore::Context::RunUntilExit(CTX);
@ -212,8 +231,6 @@ int main(int argc, char **argv, char **const envp) {
FEXCore::Context::GetCPUState(CTX, &State);
SyscallHandler.reset();
FEXCore::Context::DestroyContext(CTX);
FEXCore::Context::ShutdownStaticTables();
} else {
// Run as host
SupportsAVX = true;
@ -227,12 +244,15 @@ int main(int argc, char **argv, char **const envp) {
RunAsHost(SignalDelegation, Loader.DefaultRIP(), Loader.GetStackPointer(), &State);
}
FEXCore::Context::DestroyContext(CTX);
FEXCore::Context::ShutdownStaticTables();
bool Passed = !DidFault && Loader.CompareStates(&State, nullptr, SupportsAVX);
LogMan::Msg::IFmt("Faulted? {}", DidFault ? "Yes" : "No");
LogMan::Msg::IFmt("Passed? {}", Passed ? "Yes" : "No");
SignalDelegation.reset();
FEXCore::Config::Shutdown();

View File

@ -5,7 +5,8 @@
"MM1": ["0x43000000c3000000", "0x0"],
"MM2": ["0xc700000046fffe00", "0x0"],
"MM3": ["0x0", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -5,7 +5,8 @@
"MM1": ["0x43000000c3000000", "0x0"],
"MM2": ["0xbf8000003f800000", "0x0"],
"MM3": ["0x0", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -2,7 +2,8 @@
{
"RegData": {
"RAX": "0xFFFF"
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -5,7 +5,8 @@
"MM1": ["0x00000080FFFFFF80", "0x0"],
"MM2": ["0xFFFF800000007FFF", "0x0"],
"MM3": ["0x0", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -5,7 +5,8 @@
"MM1": ["0x00000080FFFFFF80", "0x0"],
"MM2": ["0xFFFFFFFF00000001", "0x0"],
"MM3": ["0x0", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -4,7 +4,8 @@
"MM0": ["0x3f800000bf800000", "0x0"],
"MM1": ["0x3c000000bc000000", "0x0"],
"MM2": ["0xbf8000003f800000", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -4,7 +4,8 @@
"MM0": ["0x3e8000003f800000", "0x0"],
"MM1": ["0x3e4ccccd3f000000", "0x0"],
"MM2": ["0x3f8000003eaaaaab", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -3,7 +3,8 @@
"RegData": {
"MM0": ["0x44000000c0000000", "0x0"],
"MM1": ["0x44800000c3800000", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -3,7 +3,8 @@
"RegData": {
"MM0": ["0x00000000c0000000", "0x0"],
"MM1": ["0x00000000c3800000", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -5,7 +5,8 @@
"MM1": ["0xFFFFFFFF00000000", "0x0"],
"MM2": ["0xFFFFFFFFFFFFFFFF", "0x0"],
"MM3": ["0x00000000FFFFFFFF", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -5,7 +5,8 @@
"MM1": "0x3f80000000000000",
"MM2": "0x00000000bf800000",
"MM3": "0x0"
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -4,7 +4,8 @@
"MM0": ["0xbf800000bf800000", "0x0"],
"MM1": ["0xbc000000bc000000", "0x0"],
"MM2": ["0x3f8000003f800000", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -4,7 +4,8 @@
"MM0": ["0x3f8000003f800000", "0x0"],
"MM1": ["0x3f0000003f000000", "0x0"],
"MM2": ["0x3eaaaaab3eaaaaab", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -3,7 +3,8 @@
"RegData": {
"MM0": ["0x43808000c3808000", "0x0"],
"MM1": ["0x44200000c4200000", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -3,7 +3,8 @@
"RegData": {
"MM0": ["0xc37f0000437f0000", "0x0"],
"MM1": ["0xc3c0000043c00000", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -5,7 +5,8 @@
"MM1": ["0xFFFFFFFF00000000", "0x0"],
"MM2": ["0xFFFFFFFFFFFFFFFF", "0x0"],
"MM3": ["0x00000000FFFFFFFF", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -5,7 +5,8 @@
"MM1": ["0x3f8000003f800000", "0x0"],
"MM2": ["0x00000000bf800000", "0x0"],
"MM3": ["0x3f8000003f800000", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -3,7 +3,8 @@
"RegData": {
"MM0": ["0x9192939481828384", "0x0"],
"MM1": ["0xB1B2B3B4A1A2A3A4", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -3,7 +3,8 @@
"RegData": {
"MM0": ["0x9192939481828384", "0x0"],
"MM1": ["0xB1B2B3B4A1A2A3A4", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -3,7 +3,8 @@
"RegData": {
"MM0": ["0xc380800043808000", "0x0"],
"MM1": ["0xc420000044200000", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -3,7 +3,8 @@
"RegData": {
"MM0": ["0x0", "0x0"],
"MM1": ["0x0", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -5,7 +5,8 @@
"MM1": ["0xFFFFFFFF00000000", "0x0"],
"MM2": ["0xFFFFFFFFFFFFFFFF", "0x0"],
"MM3": ["0x00000000FFFFFFFF", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -3,7 +3,8 @@
"RegData": {
"MM0": ["0xc3800000c3800000", "0x0"],
"MM1": ["0xc7800000c7800000", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -3,7 +3,8 @@
"RegData": {
"MM0": ["0x9192939481828384", "0x0"],
"MM1": ["0xB1B2B3B4A1A2A3A4", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -5,7 +5,8 @@
"MM1": "0x0",
"MM2": "0x3fff000100000001",
"MM3": "0x0000000200000004"
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -3,7 +3,8 @@
"RegData": {
"MM0": ["0x8182838491929394", "0x0"],
"MM1": ["0xA1A2A3A4B1B2B3B4", "0x0"]
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -8,9 +8,7 @@
"MM4": "0x1ed68638699d35ca",
"MM5": "0x165c42291f28194c"
},
"MemoryRegions": {
"0x100000000": "4096"
}
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -1,3 +1 @@
# RNG tests unsupported on this runner
Test_Secondary/09_XX_06.asm
Test_Secondary/09_XX_07.asm
# Nothing here yet

View File

@ -1,3 +1 @@
# RNG tests unsupported on this runner
Test_Secondary/09_XX_06.asm
Test_Secondary/09_XX_07.asm
# Nothing here yet

View File

@ -1,3 +1 @@
# RNG tests unsupported on this runner
Test_Secondary/09_XX_06.asm
Test_Secondary/09_XX_07.asm
# Nothing here yet

View File

@ -1,50 +1,10 @@
# Uses thunks
Test_TwoByte/0F_3F.asm
# Intel doesn't support SSE4a, Technically neither does FEX
Test_REP/F3_2B.asm
Test_REPNE/F2_2B.asm
# 3DNow! no longer exists on AMD Zen CPUs
Test_TwoByte/0F_0E.asm
# Intel doesn't support CLZero, which the CI uses
Test_SecondaryModRM/Reg_7_4.asm
Test_SecondaryModRM/Reg_7_4_2.asm
# Not guaranteed to work in 64bit mode
Test_Primary/Primary_8C.asm
Test_Primary/Primary_8C_2.asm
# CI runners don't have 3DNow!
Test_3DNow/0C.asm
Test_3DNow/0D.asm
Test_3DNow/0E.asm
Test_3DNow/1C.asm
Test_3DNow/1D.asm
Test_3DNow/86.asm
Test_3DNow/87.asm
Test_3DNow/8A.asm
Test_3DNow/8E.asm
Test_3DNow/90.asm
Test_3DNow/94.asm
Test_3DNow/96.asm
Test_3DNow/97.asm
Test_3DNow/9A.asm
Test_3DNow/9E.asm
Test_3DNow/A0.asm
Test_3DNow/A4.asm
Test_3DNow/A6.asm
Test_3DNow/A7.asm
Test_3DNow/AA.asm
Test_3DNow/AE.asm
Test_3DNow/B0.asm
Test_3DNow/B4.asm
Test_3DNow/B6.asm
Test_3DNow/B7.asm
Test_3DNow/BB.asm
Test_3DNow/BF.asm
# Intel CI doesn't have a new enough kernel to support this
Test_Secondary/15_F3_00.asm
Test_Secondary/15_F3_01.asm
@ -52,13 +12,3 @@ Test_Secondary/15_F3_02.asm
Test_Secondary/15_F3_03.asm
Test_Secondary/15_F3_02_2.asm
Test_Secondary/15_F3_03_2.asm
# CI currently doesn't support the x86 SHA extensions
Test_H0F38/sha1msg1.asm
Test_H0F38/sha1msg2.asm
Test_H0F38/sha1nexte.asm
Test_H0F3A/sha1rnds4.asm
Test_H0F38/sha256msg1.asm
Test_H0F38/sha256msg2.asm
Test_H0F38/sha256rnds2.asm

View File

@ -1,3 +1 @@
# Intel doesn't support CLZero, which the CI uses
Test_SecondaryModRM/Reg_7_4.asm
Test_SecondaryModRM/Reg_7_4_2.asm
# Nothing here yet

View File

@ -3,7 +3,8 @@
"RegData": {
"XMM1": ["0x5790A6E435CD1A3E", "0x3CEC3979BF41FAEF"],
"XMM2": ["0x6868C3F3AAED56E0", "0xF0FCE9E294E6E6DE"]
}
},
"HostFeatures": ["SHA"]
}
%endif

View File

@ -3,7 +3,8 @@
"RegData": {
"XMM1": ["0x1B0233CC7FCDBB45", "0x1ECD2142EC058BF8"],
"XMM2": ["0x6868C3F3AAED56E0", "0xF0FCE9E294E6E6DE"]
}
},
"HostFeatures": ["SHA"]
}
%endif

View File

@ -3,7 +3,8 @@
"RegData": {
"XMM1": ["0x6868C3F3AAED56E0", "0xD7DD078194E6E6DE"],
"XMM2": ["0x6868C3F3AAED56E0", "0xF0FCE9E294E6E6DE"]
}
},
"HostFeatures": ["SHA"]
}
%endif

View File

@ -3,7 +3,8 @@
"RegData": {
"XMM1": ["0x43DEA25DAB8EF585", "0x1D30D1491042EED2"],
"XMM2": ["0x6868C3F3AAED56E0", "0xF0FCE9E294E6E6DE"]
}
},
"HostFeatures": ["SHA"]
}
%endif

View File

@ -3,7 +3,8 @@
"RegData": {
"XMM1": ["0x915D686150BD9E36", "0xB499245E9B33D33D"],
"XMM2": ["0x6868C3F3AAED56E0", "0xF0FCE9E294E6E6DE"]
}
},
"HostFeatures": ["SHA"]
}
%endif

View File

@ -3,7 +3,8 @@
"RegData": {
"XMM1": ["0x97D4574EE323773D", "0xA934C32F562D8E88"],
"XMM2": ["0x6868C3F3AAED56E0", "0xF0FCE9E294E6E6DE"]
}
},
"HostFeatures": ["SHA"]
}
%endif

View File

@ -6,7 +6,8 @@
"XMM3": ["0xA8B3BD15FA04D6D7", "0xDE761956A1F750B1"],
"XMM4": ["0xCFBBDFA4E5E4712D", "0x76AD0D46447127D3"],
"XMM5": ["0x9BDCA44510E70C65", "0x4474BFAA2B70A524"]
}
},
"HostFeatures": ["SHA"]
}
%endif

View File

@ -4,9 +4,7 @@
"XMM0": ["0x4142434445464748", "0x5152535455565758"],
"XMM1": ["0x0000000045464748", "0x0"]
},
"MemoryRegions": {
"0x100000000": "4096"
}
"HostFeatures": ["SSE4A"]
}
%endif

View File

@ -11,9 +11,7 @@
"R12": "0x20",
"R11": "0x10"
},
"MemoryRegions": {
"0x100000000": "4096"
}
"HostFeatures": ["BMI1"]
}
%endif

View File

@ -4,9 +4,7 @@
"XMM0": ["0x4142434445464748", "0x5152535455565758"],
"XMM1": ["0x4142434445464748", "0x0"]
},
"MemoryRegions": {
"0x100000000": "4096"
}
"HostFeatures": ["SSE4A"]
}
%endif

View File

@ -6,7 +6,8 @@
"RDX": "1",
"R9": "1",
"R10": "1"
}
},
"HostFeatures": ["RAND"]
}
%endif

View File

@ -6,7 +6,8 @@
"RDX": "1",
"R9": "1",
"R10": "1"
}
},
"HostFeatures": ["RAND"]
}
%endif

View File

@ -2,7 +2,8 @@
{
"RegData": {
"RBX": "0x0"
}
},
"HostFeatures": ["CLZERO"]
}
%endif

View File

@ -4,7 +4,8 @@
"RBX": "0x0",
"RCX": "0x000000020A121A20",
"RDX": "0x0A121A2000000000"
}
},
"HostFeatures": ["CLZERO"]
}
%endif

View File

@ -4,7 +4,8 @@
},
"MemoryRegions": {
"0x100000000": "4096"
}
},
"HostFeatures": ["3DNOW"]
}
%endif

View File

@ -5,7 +5,8 @@
"RBX": "0",
"RCX": "0xFFFFFFFF",
"RDX": "0"
}
},
"HostFeatures": ["BMI1"]
}
%endif
@ -19,4 +20,4 @@ mov rdx, -1
andn ecx, ecx, edx
andn edx, edx, ecx
hlt
hlt

View File

@ -6,7 +6,8 @@
"RSI": "0",
"R14": "0x7F",
"R15": "0x838"
}
},
"HostFeatures": ["BMI1"]
}
%endif
@ -32,4 +33,4 @@ mov rsi, -1
mov rdi, 0
bextr esi, esi, edi
hlt
hlt

View File

@ -7,7 +7,8 @@
"RDX": "1",
"RSI": "0xFF000000",
"RDI": "0x01000000"
}
},
"HostFeatures": ["BMI1"]
}
%endif
@ -31,4 +32,4 @@ mov rsi, 0xFF000000
mov rdi, 0
blsi edi, esi
hlt
hlt

View File

@ -7,7 +7,8 @@
"RDX": "1",
"RSI": "0xFF000000",
"RDI": "0x01FFFFFF"
}
},
"HostFeatures": ["BMI1"]
}
%endif
@ -29,4 +30,4 @@ blsmsk edx, edx
mov rsi, 0xFF000000
blsmsk edi, esi
hlt
hlt

View File

@ -7,7 +7,8 @@
"RDX": "10",
"RSI": "0xFF000000",
"RDI": "0xFE000000"
}
},
"HostFeatures": ["BMI1"]
}
%endif
@ -29,4 +30,4 @@ blsr edx, edx
mov rsi, 0xFF000000
blsr edi, esi
hlt
hlt

View File

@ -9,7 +9,8 @@
"RDI": "32",
"RBP": "0x00000000000003FF",
"RSP": "10"
}
},
"HostFeatures": ["BMI2"]
}
%endif

View File

@ -7,7 +7,8 @@
"RDX": "0xFFFFFFFE",
"RSI": "1",
"RDI": "1"
}
},
"HostFeatures": ["BMI2"]
}
%endif
@ -33,4 +34,4 @@ mov esi, -1
mov edx, -1
mulx edx, esi, esi
hlt
hlt

View File

@ -7,7 +7,8 @@
"RDX": "0x0801256708012567",
"RSI": "0xFF00FF00FF00FF00",
"RDI": "0x0800010025006700"
}
},
"HostFeatures": ["BMI2"]
}
%endif
@ -21,4 +22,4 @@ mov rdx, 0x0801256708012567
mov rsi, 0xFF00FF00FF00FF00
pdep rdi, rdx, rsi
hlt
hlt

View File

@ -7,7 +7,8 @@
"RDX": "0x1234567812345678",
"RSI": "0xFF00FF00FF00FF00",
"RDI": "0x12561256"
}
},
"HostFeatures": ["BMI2"]
}
%endif
@ -21,4 +22,4 @@ mov rdx, 0x1234567812345678
mov rsi, 0xFF00FF00FF00FF00
pext rdi, rdx, rsi
hlt
hlt

View File

@ -7,7 +7,8 @@
"RDX": "0x80000000",
"RSI": "0xFF",
"RDI": "0xF000000F"
}
},
"HostFeatures": ["BMI2"]
}
%endif
@ -35,4 +36,4 @@ rorx edi, esi, 4,
; Test that we mask the rotation amount above the operand size (should leave edi's value alone).
rorx edi, edi, 32
hlt
hlt

View File

@ -7,7 +7,8 @@
"RDX": "127",
"RSI": "63",
"RDI": "0x00000000FFFFFFFF"
}
},
"HostFeatures": ["BMI2"]
}
%endif
@ -28,4 +29,4 @@ mov edi, 0x80000000
mov esi, 63
sarx edi, edi, esi
hlt
hlt

View File

@ -7,7 +7,8 @@
"RDX": "127",
"RSI": "63",
"RDI": "0x80000000"
}
},
"HostFeatures": ["BMI2"]
}
%endif
@ -28,4 +29,4 @@ mov edi, 1
mov esi, 63
shlx edi, edi, esi
hlt
hlt

View File

@ -7,7 +7,8 @@
"RDX": "127",
"RSI": "63",
"RDI": "1"
}
},
"HostFeatures": ["BMI2"]
}
%endif
@ -28,4 +29,4 @@ mov edi, 0x80000000
mov esi, 63
shrx edi, edi, esi
hlt
hlt

View File

@ -6,7 +6,7 @@
; "XMM6": ["0x0000000000002120","0x0000000000000000"],
; "XMM7": ["0x0000000000000020","0x0000000000000000"]
; },
; "HostFeatures": "AVX",
; "HostFeatures": ["AVX"],
; "MemoryRegions": {
; "0x1000000": "4096"
; },