summaryrefslogtreecommitdiff
path: root/docs/lifecycle/jit.md
diff options
context:
space:
mode:
authornodist <kevin.comas.git@gmail.com>2026-07-18 14:01:26 -0400
committernodist <kevin.comas.git@gmail.com>2026-07-18 14:01:26 -0400
commit003119b9f285e5610f56186bce845441409265ae (patch)
tree34a123532811537a0dd30aa797578be8f732b45b /docs/lifecycle/jit.md
parente950f786e25967a222cfa7bce7327ffd458e8c95 (diff)
op and ir matching definitions
Diffstat (limited to 'docs/lifecycle/jit.md')
-rw-r--r--docs/lifecycle/jit.md25
1 files changed, 25 insertions, 0 deletions
diff --git a/docs/lifecycle/jit.md b/docs/lifecycle/jit.md
index 3ff7079..3ef73e0 100644
--- a/docs/lifecycle/jit.md
+++ b/docs/lifecycle/jit.md
@@ -53,3 +53,28 @@ kpl_x64_inst(INSTRUCTION, [TYPE, VALUE]..., END)
kpl_x64_inst_pfx(PREFIX, INSTRUCTION, [TYPE, VALUE]..., END)
```
+
+# Ir Matching
+
+Use tree with sub trees to match Ir operations to JIT functions
+
+1. Match Name
+2. Match Args until None or End
+3. Run JIT Fn
+
+## Object Definitions
+
+```c
+typedef struct _kpl_ir_match {
+ int32_t tree_weight;
+ union {
+ kpl_ir_name ir_name;
+ kpl_type_header type_header;
+ } match;
+ union {
+ struct _kpl_ir_match *children;
+ void *jit_fn; // TODO
+ } next;
+ struct _kpl_ir_match *tree_left *tree_right;
+} kpl_ir_match;
+```