mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-01-04 21:55:06 +01:00
Implemented the PKHTB and PKHBT instructions with tests. (#40)
This commit is contained in:
parent
780ff8e00e
commit
32615d0eff
4 changed files with 65 additions and 3 deletions
|
|
@ -929,4 +929,24 @@ TEST_CASE("Test ARM SEL instruction", "[JitX64]") {
|
|||
return sel_instr.Generate(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("Fuzz ARM packing instructions", "[JitX64]") {
|
||||
auto is_pkh_valid = [](u32 inst) -> bool {
|
||||
// R15 as Rd, Rn, or Rm is UNPREDICTABLE
|
||||
return Bits<16, 19>(inst) != 0b1111 &&
|
||||
Bits<12, 15>(inst) != 0b1111 &&
|
||||
Bits<0, 3>(inst) != 0b1111;
|
||||
};
|
||||
|
||||
const std::array<InstructionGenerator, 2> instructions = {{
|
||||
InstructionGenerator("cccc01101000nnnnddddvvvvv001mmmm", is_pkh_valid), // PKHBT
|
||||
InstructionGenerator("cccc01101000nnnnddddvvvvv101mmmm", is_pkh_valid), // PKHTB
|
||||
}};
|
||||
|
||||
SECTION("Packing") {
|
||||
FuzzJitArm(1, 1, 10000, [&instructions]() -> u32 {
|
||||
return instructions[RandInt<size_t>(0, instructions.size() - 1)].Generate();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue