mirror of
https://github.com/yuzu-mirror/dynarmic.git
synced 2026-04-06 06:43:47 +00:00
fuzz_arm: Add fuzzing for thumb instructions
This commit is contained in:
parent
8b612edb75
commit
331a02e02e
3 changed files with 172 additions and 36 deletions
|
|
@ -35,10 +35,16 @@ u32 RandomFpcr() {
|
|||
}
|
||||
|
||||
InstructionGenerator::InstructionGenerator(const char* format){
|
||||
ASSERT(std::strlen(format) == 32);
|
||||
const size_t format_len = std::strlen(format);
|
||||
ASSERT(format_len == 16 || format_len == 32);
|
||||
|
||||
for (int i = 0; i < 32; i++) {
|
||||
const u32 bit = 1u << (31 - i);
|
||||
if (format_len == 16) {
|
||||
// Begin with 16 zeros
|
||||
mask |= 0xFFFF0000;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < format_len; i++) {
|
||||
const u32 bit = 1u << (format_len - i - 1);
|
||||
switch (format[i]) {
|
||||
case '0':
|
||||
mask |= bit;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue