34 Commits
Author SHA1 Message Date
Ronald Caesar 6b412faec1 docs: add more programming rules
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-06-05 03:49:36 -04:00
Ronald Caesar 720275ba2e docs: update ir design doc
Lots of small little changes added to the IR design doc since its
quite outdated.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-04-21 07:26:47 -04:00
Ronald Caesar 3a84526a93 docs: add armv8 reference manual
Provides an easy way to access ARMv8 specification manual without
visiting the ARM website.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-03-09 17:12:28 +00:00
Ronald Caesar d9d6c2a630 engine: upgrade constant pool to uint64_t
The engine is built for 32-bit constants which is wrong since Ballistic
is an ARM64 recompiler. Instructions like MOVZ with LSR #32 or LSR #48
would fail.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-02-17 14:13:22 -04:00
smiRaphi 5588d931e9 docs: typos, grammatic, formatting/unicode errors & inconsistent wording 2026-02-16 23:29:38 +01:00
Ronald Caesar 5e73e88145 ir: fix incorrect instruction bitfield size
An instruction is suppose to have 17-bit operands but it was actually
18-bit. So I reduce the bitfields by one bit and give the remaining bits
to opcode. An opcode is now 13 bits.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-17 04:19:24 -04:00
Ronald Caesar f910745a55 docs: add read only data handling to programming rules
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-13 21:18:50 -04:00
Ronald Caesar 99f4afb9fc docs: add handling arrays in programming rules
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-13 20:57:16 -04:00
Ronald Caesar 6e4c1edfda docs: add programming rules
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-13 20:32:41 -04:00
Ronald Caesar e9ec38bcfd docs: add template files
These template files come from the Barr C style guide.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-09 18:23:35 -04:00
Ronald Caesar 6cf4df24bf docs: add table of contents
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-09 17:26:45 -04:00
Ronald Caesar 74aa9be671 docs: Update outdated instruction operand width
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-09 17:17:13 -04:00
Ronald Caesar bf146b681a docs: Add initial static assumption implementation
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-08 19:53:52 -04:00
Ronald Caesar 2778c94a15 docs: Split ssa_versions[]
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-08 19:25:26 -04:00
Ronald Caesar f97fcf7df9 docs: Add scenario to extension instruction
This accidentally got removed in previous commits

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-08 18:58:01 -04:00
Ronald Caesar 317c33b557 docs: Fix incorrect block limit statement
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-08 18:54:05 -04:00
Ronald Caesar 8b642a1e9f docs: Add limitations to extention instruction
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-08 18:50:52 -04:00
Ronald Caesar 624505af17 docs: Switch instruction and instruction encoding sections
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-08 18:25:05 -04:00
Ronald Caesar 4115204ab9 docs: Shrink instruction_t operands by one
Having 18-bit opcodes means a block has at most 131,072 instructions
which is simply too big. All of these instructions cannot fit into the
L1 cache, which results in cache thrashing.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-08 18:18:32 -04:00
Ronald Caesar e7a8a873e6 docs: Replace ssa_version_t type attribute
We have enough bits in the opcode bitfield in instruction_t
to encode register classes (ADD_INT, ADD_FLOAT, ADD_VECTOR). However,
encoding the bit width (ADD_INT8, ADD_INT32) will massively increase the
amount of opcodes needed. So we replace `type` in ssa_version_t with
`bit_width`.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-08 18:09:07 -04:00
Ronald Caesar fde3d195bd docs: Replace def extensions with block args
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-08 17:52:25 -04:00
Ronald Caesar e002fbcc6a docs: Add block size limit rule
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-06 18:37:36 -04:00
Ronald Caesar 020aa8dca8 docs: Fix Hot-Cold Splitting contradiction
Rule 4.2 states: "If a basic block is deemed cold, it should move to a
separate buffer." This violates Rule 3.1 Implicit Indexing. If v100 is
located at instructions[100] and we move it to a cold buffer, it id no
longer at index 100. If we keep the index 100 but store the data
elsewhere, you break the linear memory array performance benefits.

Hot-cols splitting will be done during code generation.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-06 18:18:53 -04:00
Ronald Caesar cf805cdd86 docs: Fix incorrect block scope comments
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-05 21:45:43 -04:00
Ronald Caesar ee594332c9 docs: Refactor IR to merge-at-bottom SSA model
- Replace value-returning IFs with Void IFs and explicit OPCODE_MERGE.
- Move SSA definitions to block exits to eliminate backpatching.
- Formalize Control Scope Stack for tracking yields and arity.
- Update loop peeling logic to respect new merge semantics.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-01-05 21:26:14 -04:00