early-access version 1475
This commit is contained in:
28
externals/dynarmic/tests/A64/a64.cpp
vendored
28
externals/dynarmic/tests/A64/a64.cpp
vendored
@@ -634,3 +634,31 @@ TEST_CASE("A64: Optimization failure when folding ADD", "[a64]") {
|
||||
REQUIRE(jit.GetPstate() == 0x20000000);
|
||||
REQUIRE(jit.GetVector(30) == Vector{0xf7f6f5f4, 0});
|
||||
}
|
||||
|
||||
TEST_CASE("A64: Cache Maintenance Instructions", "[a64]") {
|
||||
class CacheMaintenanceTestEnv final : public A64TestEnv {
|
||||
void InstructionCacheOperationRaised(A64::InstructionCacheOperation op, VAddr value) override {
|
||||
REQUIRE(op == A64::InstructionCacheOperation::InvalidateByVAToPoU);
|
||||
REQUIRE(value == 0xcafed00d);
|
||||
}
|
||||
void DataCacheOperationRaised(A64::DataCacheOperation op, VAddr value) override {
|
||||
REQUIRE(op == A64::DataCacheOperation::InvalidateByVAToPoC);
|
||||
REQUIRE(value == 0xcafebabe);
|
||||
}
|
||||
};
|
||||
|
||||
CacheMaintenanceTestEnv env;
|
||||
A64::UserConfig conf{&env};
|
||||
conf.hook_data_cache_operations = true;
|
||||
A64::Jit jit{conf};
|
||||
|
||||
jit.SetRegister(0, 0xcafed00d);
|
||||
jit.SetRegister(1, 0xcafebabe);
|
||||
|
||||
env.code_mem.emplace_back(0xd50b7520); // ic ivau, x0
|
||||
env.code_mem.emplace_back(0xd5087621); // dc ivac, x1
|
||||
env.code_mem.emplace_back(0x14000000); // B .
|
||||
|
||||
env.ticks_left = 3;
|
||||
jit.Run();
|
||||
}
|
||||
|
2
externals/dynarmic/tests/A64/testenv.h
vendored
2
externals/dynarmic/tests/A64/testenv.h
vendored
@@ -15,7 +15,7 @@
|
||||
|
||||
using Vector = Dynarmic::A64::Vector;
|
||||
|
||||
class A64TestEnv final : public Dynarmic::A64::UserCallbacks {
|
||||
class A64TestEnv : public Dynarmic::A64::UserCallbacks {
|
||||
public:
|
||||
u64 ticks_left = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user