Commit graph

268 commits

Author SHA1 Message Date
Ronald Caesar
04b5af2517 build: Disable most 3rd party dependencies
SDL3, ImGUI, and OpenGL are unused dependencies. They will be enabled
once a GUI becomes necessary

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-11-28 04:04:15 -04:00
Ronald Caesar
0011bb7825
jit/ir: remove the prefix p_ from pointers
Although this is mandated in the Barr C style guide, I find this
specific rule uneccesarry and tedious.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-11-27 16:03:01 -04:00
Ronald Caesar
d61fbe3514
jit/ir: Remove instruction linked list
The linked list was implemented to store instructions in a basic block.
Instructions will now be stored in arrays to keep logic simple and
straight-foward.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-11-27 15:59:16 -04:00
Ronald Caesar
21c0f0bdef
Remove PVM folder
The folder will be rewritten once the JIT compiler is completed.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-11-25 22:58:50 -04:00
Ronald Caesar
d6c29e412a
Fix formatting compiler warnings
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-11-23 04:54:41 -04:00
Ronald Caesar
e47570693f
Rewrote Contributing guidelines
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-11-22 22:37:51 -04:00
Ronald Caesar
bd0bf1deba
jit/ir: Implement IR instruction management
Introduces IR instruction management, including instruction_t and
instruction_list_t definitions and their implementations. It also added
const-correctness to the value_t API.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-11-22 22:12:22 -04:00
Ronald Caesar
ffea35bc8f
Merge branch 'Xphalnos-memory' into arm64
Xphalnos says:
==============
The memory arena is created but not destroyed at the end of execution.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-11-21 16:33:17 -04:00
Xphalnos
7d6a721e36 Memory deallocation at the end of execution 2025-11-16 13:51:07 +01:00
Ronald Caesar
523d1e6656
jit/ir: Add opcode interface
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-11-09 13:01:23 -04:00
Ronald Caesar
fa1f91dc94
jit/ir: Include A32 opcodes
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-11-09 09:11:02 -04:00
Ronald Caesar
304aeed9f6
tests/jit: Add IR tests
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-11-08 16:37:41 -04:00
Ronald Caesar
a57ce183a1
extern/googletest: Add testing library
Need a testing framework to test the IR layer. GoogleTest is a popular
choice so it was chosen.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-11-08 15:41:04 -04:00
Ronald Caesar
d832bb1151
jit/ir: Define value_t interface
Introduces jit/ir/value.h, which defines the value_t structure which is
a polymorphic container designed to hold various kinds of data that IR
instructions operate on or produce.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-11-08 14:45:13 -04:00
Ronald Caesar
dfd91ced48
jit/ir: add value_t getter functions
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-11-02 14:08:58 -04:00
Ronald Caesar
14ef99faf9
jit/ir: Introduce A32 register type definitions
A new header, jit/a32_types.h, defines a32_register_t, an enum for Arm32
general purpose register's R0-R15, including standard aliases for SP,
LR, and PC.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-11-02 13:22:23 -04:00
Ronald Caesar
621665c659
jit/ir: Add value_t struct
This type is designed to hold various kinds of data that IR instructions
operate on, starting with immediate integer constants.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-11-01 16:09:22 -04:00
Ronald Caesar
cf504e107e
jit/ir: Add type.h
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-10-31 17:04:38 -04:00
Ronald Caesar
49dbc25818
jit/ir: Change namespace from decoder to IR
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-10-30 00:21:09 -04:00
Ronald Caesar
a25e4ccbe0
jit/ir: Add IR types
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-10-27 12:45:04 -04:00
Ronald Caesar
ac950250a8
jit: Remove global decoder variable
The decoder is created in main.cpp so having a global decoder is
useless.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-10-26 14:01:59 -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
Ronald Caesar
2e2b5df20c
Merge branch 'ramenrrami-arm64' into arm64 2025-10-17 21:32:33 -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
9341e8d4ee
Merge remote-tracking branch 'Xphalnos/arm64' into arm64
Made freeing memory from our arena allocator safer. Replaced free() with munmap().
2025-10-17 17:13:47 -04:00
Ronald Caesar
194b15b556
host: add assertions
Munmap can fail if the length argument is 0, and the address being freed
is not a multiple of the host's page size.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-10-17 16:28:02 -04:00
Xphalnos
51e7adcbee Replace free() by munmap()
Signed-off-by: Xphalnos <yiga.steam@gmail.com>
2025-10-16 08:16:32 +02: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
OwnedByWuigi
09da076aaf
Update to macOS 15-intel ahead of macOS 13's depreciation
Signed-off-by: OwnedByWuigi <120682622+OwnedByWuigi@users.noreply.github.com>
2025-10-10 12:40:37 +01:00
Ronald Caesar
b96c58c71a
Merge branch 'Xphalnos-arm64' into arm64
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-10-08 16:39:17 -04:00
Xphalnos
8c40261fee Revert SDL3 Submodule Update 2025-10-08 13:45:49 +02:00
GloriousTacoo
078af2f528
Merge branch 'arm64' into arm64 2025-10-07 16:25:11 -04:00
Ronald Caesar
0d4e5fd765
Merge branch 'Xphalnos-VirtualAlloc' into arm64
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-10-07 16:21:37 -04:00
Xphalnos
328292ce55 Minor Changes
Signed-off-by: Xphalnos <yiga.steam@gmail.com>
2025-10-07 07:47:31 +02:00
Xphalnos
8434b4a368 Windows: Use VirtualAlloc
Signed-off-by: Xphalnos <yiga.steam@gmail.com>
2025-10-07 07:42:10 +02:00
Ronald Caesar
ccedf3b251
jit: Instruction decoder temp
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-10-04 22:17:36 -04:00
Ronald Caesar
ee9fbf5253
Update Readme
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-10-04 19:51:38 -04:00
Ronald Caesar
9d7b05d6ae
rename kvm references to pvm
The term KVM is missleading because we are not using linux kernel
virtualization. PVM stands for "Pound Virtual Machine" which is more
accurate.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-30 18:13:48 -04:00
Ronald Caesar
70a1abc62f
docs: Remove mmio design doc
The mmio will not be touchwd for a couple months while we focus on
executing arm instructions. Once we get to that point this design doc
will be rewritten.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-29 23:30:37 -04:00
Ronald Caesar
8eb0398803
docs: Update Readme
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-29 22:09:51 -04:00
Ronald Caesar
ae041bff84
docs: Clarify contributing rules
I failed to mentiones that the memory allocation and OOP rules are
temporary.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-29 22:05:18 -04:00
Ronald Caesar
69abf0efc8
Add PR template
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-28 13:39:41 -04:00
Ronald Caesar
6bdfd6fcea
Big Commit
The changes affects multiple places in the repo and this one of the rare
instances where I cant be bothered writing a comprehensive commit. Look
at the diff for changes.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-27 09:16:49 -04:00
Ronald Caesar
4dd8506346 Update 3rd_Party/SDL3 to a96677bdf6b4acb84af4ec294e5f60a4e8cbbe03: Since the build system is being refactered, all submodules will be updated to their latest release 2025-09-21 23:10:05 -04:00
Ronald Caesar
d0f9fd8686 Update 3rd_Party/imgui to bf75bfec48fc00f532af8926130b70c0e26eb099: Since the build system is being refactered, all submodules will be updated to their latest release 2025-09-21 22:50:55 -04:00
Ronald Caesar
4d363ea3b2 Remove fmt library
This library wasnt used anywhere in the source code.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-21 18:37:06 -04:00
Ronald Caesar
8713dd751a docs: Add githib vuln scanning design doc
Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-21 18:36:28 -04:00