mirror of
https://github.com/pound-emu/pound.git
synced 2025-12-19 04:37:03 +00:00
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:
parent
2ea7647dc2
commit
2b5131e56c
37 changed files with 834 additions and 1999 deletions
|
|
@ -6,9 +6,6 @@
|
|||
* This module provides the interface for decoding 32-bit ARM instructions
|
||||
* into internal metadata structures.
|
||||
*
|
||||
* @note
|
||||
* While the decoding lookup is thread-safe after initialization, the
|
||||
* initialization phase itself is NOT thread-safe.
|
||||
*/
|
||||
|
||||
#ifndef POUND_JIT_DECODER_ARM32_H
|
||||
|
|
@ -16,39 +13,34 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
namespace pound::jit::decoder {
|
||||
|
||||
/*! @brief Represents static metadata associated with a specific ARM32 instruction. */
|
||||
/*! @brief Represents static metadata associated with a specific ARM32
|
||||
* instruction. */
|
||||
typedef struct
|
||||
{
|
||||
/*! @brief The instruction mnemonic (e.g., "ADD", "LDR"). */
|
||||
const char *name;
|
||||
|
||||
/*!
|
||||
* @brief The bitmask indicating which bits in the instruction word are significant.
|
||||
* @details 1 = significant bit, 0 = variable field (register, immediate, etc.).
|
||||
* @brief The raw bitstring representation.
|
||||
* @details Used during initialization to calculate mask and expected
|
||||
* values.
|
||||
*/
|
||||
uint32_t mask;
|
||||
const char *bitstring;
|
||||
|
||||
/*!
|
||||
* @brief The bitmask indicating which bits in the instruction word are
|
||||
* significant.
|
||||
* @details 1 = significant bit, 0 = variable field (register, immediate,
|
||||
* etc.).
|
||||
*/
|
||||
uint32_t mask;
|
||||
|
||||
/*!
|
||||
* @brief The expected value of the instruction after applying the mask.
|
||||
* @details (instruction & mask) == expected.
|
||||
*/
|
||||
uint32_t expected;
|
||||
} arm32_instruction_info_t;
|
||||
|
||||
/*!
|
||||
* @brief Initializes the ARM32 decoder lookup tables.
|
||||
*
|
||||
* @details
|
||||
* Populates the internal hash table used for O(1) instruction decoding.
|
||||
*
|
||||
* @pre This function must be called during the application startup phase.
|
||||
* @post The internal global decoder state is initialized and ready for use.
|
||||
*
|
||||
* @warning *!Thread Safety*!: Unsafe. This function modifies global state without locking.
|
||||
*/
|
||||
void arm32_init(void);
|
||||
uint32_t expected;
|
||||
} pvm_jit_decoder_arm32_instruction_info_t;
|
||||
|
||||
/*!
|
||||
* @brief Decodes a raw 32-bit ARM instruction.
|
||||
|
|
@ -62,13 +54,9 @@ void arm32_init(void);
|
|||
* @return A pointer to the instruction metadata if a match is found.
|
||||
* @return `nullptr` if the instruction is undefined or invalid.
|
||||
*
|
||||
* @pre `arm32_init()` must have been called successfully.
|
||||
* @post The returned pointer (if not null) points to static read-only memory.
|
||||
*
|
||||
* @note *!Thread Safety*!: Safe. This function is read-only re-entrant.
|
||||
*/
|
||||
const arm32_instruction_info_t *arm32_decode(const uint32_t instruction);
|
||||
|
||||
} // namespace pound::jit::decoder
|
||||
const pvm_jit_decoder_arm32_instruction_info_t *pvm_jit_decoder_arm32_decode(
|
||||
const uint32_t instruction);
|
||||
|
||||
#endif // POUND_JIT_DECODER_ARM32_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue