Commit Graph

6 Commits

Author SHA1 Message Date
Ronald Caesar
fd080b323c decoder: static assert bitfield width
This guarantees the bitfield is 5 bits, so if someone in the future
decides to shift bits around in the struct it wont break Ballistic.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-23 18:57:09 -04:00
Ronald Caesar
3b9703f316 decoder: include operands in metadata
Stores operand bit positions and types in the decoder metadata. This
makes it way easier to emit IR instructions.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-18 02:44:40 -04:00
Ronald Caesar
2596a20f31 decoder: rewrite docs for cdoc
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-17 18:25:43 -04:00
Ronald Caesar
f72da3e121 decoder: add ir opcode to metadata struct
Instead of using strcmp() on each decoded intruction's mnemonic to
translate it, we embedd an IR opcode into the struct. This is a very
barebones implementation and does not cover the entire ARM instruction
set. ARM instructions that does not have an IR opcode equivalent will be
marked with `OPCODE_TRAP` and should be implemented in the future.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-13 23:31:06 -04:00
Ronald Caesar
e671b6a4f1 ir: add compiler hints for cold functions
Also marked more functions as hot.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-12 09:19:27 -04:00
Ronald Caesar
4aa8335612 decoder: Make decoder API public
The decoder API is now suitable to be made public. decoder.h is the sole
entry point for the decoder and it has been moved to `include/`

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-12-12 18:11:43 -04:00