Commit graph

9 commits

Author SHA1 Message Date
Ronald Caesar
2ea7647dc2
jit/decoder: Fix decoder hash logic
Fixes `relevant_mask` calculation in arm32_init() to use bitwise AND
instead of OR. The previous logic incorrectly validated bits outside the
hash region, preventing valid instructions like 'BX` from being added to
the lookup table.

Increased LOOKUP_TABLE_MAX_BUCKET_SIZE from 8 to 16. Instructions with
wildcard bits in the hash region (eg, AND, EOR) must map to multiple
buckets to ensure O(1) lookup.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-11-29 07:47:49 -04:00
Ronald Caesar
27710ca8c9
jit/decoder: Overhaul arm32 decoder
Rewrites the Arm32 instruction decoder to align with high integrity
software standards such as MISRA C and BARR-C.

Key Architectural  Changes:

- Added compile time validation.
- Removed dependency on memory allocator. The decoder now uses
   statically allocated global storage.
- Implement a hash-based lookup table to reduce decoding complexity to
   O(1).
- Removed decoder_t in favour of a singleton pattern.
- Add documentation stating thread safety, preconditions, and
   postconditions for all public functions.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-11-28 23:50:27 -04:00
Ronald Caesar
1c3b730899
jit: Add Barr C code standard
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-10-26 13:59:48 -04:00
Ronald Caesar
a543f78b77
jit: made private functions static
This comforms to Rule 6.2 of Barr C code standard.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-10-26 06:07:29 -04:00
Ronald Caesar
a0ed4382a5
jit: Implement arm32 instruction decoding logic
Introduces the core Arm32 decoder, including the instruction parsing
mechanism and an initial set of defined instructions.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-10-26 02:19:35 -04:00
ramenrrami
aff8491a19
jit: inline ARM32 instruction logging and remove redundant traces 2025-10-17 21:28:07 -04:00
ramenrrami
15938b667b
jit: add detailed logging for ARM32 instruction registration 2025-10-17 21:23:34 -04:00
Ronald Caesar
7aac83b2f2
jit: Add more foundational code
Strengthens the decoder's foundation but does not yet implement the core
instruction lookup table logic or the public arm32_decode API. These
will be addressed in future patches.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-10-12 21:51:24 -04:00
Ronald Caesar
ccedf3b251
jit: Instruction decoder temp
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-10-04 22:17:36 -04:00