mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-03-11 05:22:56 +00:00
a64_emit_x64: Ensure host has updated ticks in EmitA64GetCNTPCT
Discovered by @Subv. Fixes incomplete fix begun in 5a91c94dca47c9702dee20fbd5ae1f4c07eef9df. That fix fails to take into account that LinkBlock doesn't update ticks until there are no remaining ticks to be executed. Test added to confirm fix.
This commit is contained in:
@@ -313,3 +313,24 @@ TEST_CASE("A64: 128-bit exclusive read/write", "[a64]") {
|
||||
REQUIRE(env.MemoryRead64(0x1234567812345678) == 0xaf00d1e5badcafe0);
|
||||
REQUIRE(env.MemoryRead64(0x1234567812345680) == 0xd0d0cacad0d0caca);
|
||||
}
|
||||
|
||||
TEST_CASE("A64: CNTPCT_EL0", "[a64]") {
|
||||
TestEnv env;
|
||||
Dynarmic::A64::Jit jit{Dynarmic::A64::UserConfig{&env}};
|
||||
|
||||
env.code_mem[0] = 0xd53be021; // MRS X1, CNTPCT_EL0
|
||||
env.code_mem[1] = 0xd503201f; // NOP
|
||||
env.code_mem[2] = 0xd503201f; // NOP
|
||||
env.code_mem[3] = 0xd503201f; // NOP
|
||||
env.code_mem[4] = 0xd503201f; // NOP
|
||||
env.code_mem[5] = 0xd503201f; // NOP
|
||||
env.code_mem[6] = 0xd503201f; // NOP
|
||||
env.code_mem[7] = 0xd53be022; // MRS X2, CNTPCT_EL0
|
||||
env.code_mem[8] = 0xcb010043; // SUB X3, X2, X1
|
||||
env.code_mem[9] = 0x14000000; // B .
|
||||
|
||||
env.ticks_left = 10;
|
||||
jit.Run();
|
||||
|
||||
REQUIRE(jit.GetRegister(3) == 7);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user