mirror of
https://github.com/azahar-emu/dynarmic
synced 2025-11-13 10:30:07 +01:00
fuzz_with_unicorn: Move data outside loop
Given we know we're only ever going to use one instruction, we can just presize the vector and reassign to it instead of potentially reallocating the same memory 100000 times
This commit is contained in:
parent
cd69c6a17c
commit
71422c2b48
@ -96,13 +96,14 @@ static void RunTestInstance(const std::array<u64, 31>& regs, const std::array<Ve
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("A64: Single random instruction", "[a64]") {
|
TEST_CASE("A64: Single random instruction", "[a64]") {
|
||||||
|
std::array<u64, 31> regs;
|
||||||
|
std::array<Vector, 32> vecs;
|
||||||
|
std::vector<u32> instructions(1);
|
||||||
|
|
||||||
for (size_t iteration = 0; iteration < 100000; ++iteration) {
|
for (size_t iteration = 0; iteration < 100000; ++iteration) {
|
||||||
std::array<u64, 31> regs;
|
|
||||||
std::generate(regs.begin(), regs.end(), []{ return RandInt<u64>(0, ~u64(0)); });
|
std::generate(regs.begin(), regs.end(), []{ return RandInt<u64>(0, ~u64(0)); });
|
||||||
std::array<Vector, 32> vecs;
|
|
||||||
std::generate(vecs.begin(), vecs.end(), RandomVector);
|
std::generate(vecs.begin(), vecs.end(), RandomVector);
|
||||||
std::vector<u32> instructions;
|
instructions[0] = GenRandomInst(0, true);
|
||||||
instructions.push_back(GenRandomInst(0, true));
|
|
||||||
u32 pstate = RandInt<u32>(0, 0xF) << 28;
|
u32 pstate = RandInt<u32>(0, 0xF) << 28;
|
||||||
|
|
||||||
INFO("Instruction: 0x" << std::hex << instructions[0]);
|
INFO("Instruction: 0x" << std::hex << instructions[0]);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user