refactor: Humongous Commit

Major architectural refactorbto focus exclusively on JIT development.

JIT & Decoder Architecture
-    Implemented scripts/generate_jit_decoder_a32_table.py to parse
     instruction definitions at build-time rather than runtime.
-    Moves decoder lookup tables from RAM to ROM.

Scope Reduction:
-    Removed frontend, GUI, and rendering dependencies.
-    delete src/frontend, src/target, and associated design docs.

Most importantly, this commit starts the transition of this codebase
from C++ to C. I cant stand creating C++ code, and since no one else
is contributing to this project this change shouldnt matter.

Signed-off-by: Ronald Caesar <github43132@proton.me>
This commit is contained in:
Ronald Caesar 2025-11-29 14:53:02 -04:00
parent 2ea7647dc2
commit 2b5131e56c
No known key found for this signature in database
GPG key ID: 04307C401999C596
37 changed files with 834 additions and 1999 deletions

42
src/jit/decoder/arm32.c Normal file
View file

@ -0,0 +1,42 @@
#include "arm32.h"
#include "arm32_table_generated.h"
#include "common/passert.h"
#include <string.h>
#include <stdbool.h>
#define LOG_MODULE "jit"
#include "common/logging.h"
const pvm_jit_decoder_arm32_instruction_info_t *
pvm_jit_decoder_arm32_decode (const uint32_t instruction)
{
/* Extract hash key: Bits [27:20] and [7:4] */
const uint32_t major = (instruction >> 20U) & 0xFFU;
const uint32_t minor = (instruction >> 4U) & 0xFU;
const uint16_t index = (uint16_t)((major << 4U) | minor);
const decode_bucket_t *bucket = &g_decoder_lookup_table[index];
for (size_t i = 0; i < bucket->count; ++i)
{
const pvm_jit_decoder_arm32_instruction_info_t *info = bucket->instructions[i];
if ((instruction & info->mask) == info->expected)
{
if (0 == strcmp(info->name, "UDF"))
{
LOG_WARNING("Instruction 0x%08X is undefined", instruction);
}
else
{
LOG_TRACE("Instruction found for 0x%08X: %s", instruction, info->name);
}
return info;
}
}
LOG_WARNING("Cannot decode instruction 0x%08X", instruction);
return NULL;
}